Skip to content

Commit 7f86fca

Browse files
Nick  VaccarelloNick  Vaccarello
authored andcommitted
docs(next-steps): add nano-Transformer baseline and MLflow/Hydra experiment tracking; add actionable tasks
1 parent 432e229 commit 7f86fca

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

medical_diagnosis_model/NEXT_STEPS.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ Acceptance:
115115
- Config toggles in `configs/training.yaml` enable Adam/L2/dropout; seed fixed.
116116
- Training summary logs include optimizer, regularization, and early stopping status.
117117
- Class weighting or balanced sampling applied if class counts are imbalanced; documented in DATA_CARD.
118+
119+
- Transformer baseline
120+
- Implement a tiny Transformer classifier as a comparative baseline to the current MLP.
121+
- Acceptance criteria:
122+
- `foundational_brain/nano_transformer.py` with tokenization (symptom IDs), embeddings, 2–4 attention blocks, and classifier head; trained with cross‑entropy.
123+
- CLI to train/evaluate on v0.2 data and save metrics: `python -m foundational_brain.nano_transformer --jsonl medical_diagnosis_model/data/v02/cases_v02.jsonl`.
124+
- Report comparing MLP vs Transformer on accuracy, confusion, and ECE written to `medical_diagnosis_model/reports/transformer_baseline.json`.
125+
- README snippet explaining differences (sequence modeling, attention) and when Transformer helps.
118126
- Metrics & calibration
119127
- AUROC, AUPRC, F1, Top‑k, confusion per class.
120128
- Reliability diagrams + ECE; re‑tune temperature on held‑out set; subgroup calibration (age/sex/season). Add drift monitors for class priors and feature distributions.
@@ -164,9 +172,11 @@ Acceptance:
164172
## Ops & tooling (parallel)
165173

166174
- Experiment tracking & configs
167-
- YAML configs, fixed seeds, run logs; simple experiment registry.
175+
- YAML configs, fixed seeds, run logs; MLflow for runs/artifacts; Hydra for hierarchical configs.
168176
- Acceptance criteria:
169-
- Each run saves `configs/*.yaml`, seed, code commit, and metrics in `runs/{timestamp}/`.
177+
- MLflow tracking enabled locally: params/metrics/artifacts (model, reports) recorded per run under `mlruns/`.
178+
- Hydra‑based configs under `medical_diagnosis_model/configs/` with overrides for optimizer, regularization, and model type (mlp|transformer).
179+
- Each run logs code commit hash, dataset version, seed; outputs in `runs/{timestamp}/` include a summary JSON and links to MLflow artifacts.
170180
- A summary index CSV lists runs with key metrics for comparison.
171181
- Batch CLI
172182
- Score CSV/JSONL → outputs with predictions, differentials, confidence, flags.
@@ -557,5 +567,7 @@ medical_diagnosis_model/
557567
9. Build batch CLI to score CSV and emit results JSON/CSV.
558568

559569
10. Implement adaptive questioning selector stub (`backend/selector/eig_selector.py`) with unit tests on toy distributions; wire a no‑UI CLI demo.
570+
11. Add nano‑Transformer baseline (`foundational_brain/nano_transformer.py`) + CLI; compare vs MLP and write `reports/transformer_baseline.json`.
571+
12. Wire MLflow tracking and Hydra configs for both MLP and Transformer runs; log params/metrics/artifacts and enable easy overrides.
560572

561573
> Tip: keep a changelog and version datasets/runs (seed, config, code commit) for reproducibility.

0 commit comments

Comments
 (0)