Spaces:
Running on Zero
Fix BRCA training collapse, mobile layout and results history
This PR fixes the BRCA training collapse using Jubair's hyperparameter grid. It replaces #2 and includes its mobile layout fix.
Problem: with the old defaults (Adam, lr 0.001, weight decay 0.01), BRCA training predicted class 3 for every sample (macro F1 0.133).
New defaults: Adam, lr 0.01, L2 0.01, batch 32, projection 64, tanh/relu/tanh activations, 200 epochs (early stopping still applies), and the single-cell GenePT file Jubair recommended. This was the most stable configuration from the grid: macro F1 0.749 ± 0.018 across 8 seeds on BRCA, with no collapses.
Also included:
- 75/25 stratified train/validation split.
- The Results page training-history plot now shows data.
- Activation functions and SGD momentum are configurable.
- Mobile layout fix and stable element ids for e2e tests.
- Diagnostics with reproduction scripts in
diagnostics/.
model.py and the artifact format are unchanged, and previously saved models still load. All 22 tests pass. The PR is based on the current main, so it merges without conflicts.
For review:
- The default activations now differ from the published relu/sigmoid/tanh, which collapse at lr 0.01 / L2 0.01.
- Only BRCA has been tested so far.
num_ex_neuronisn't supported yet.