Repository navigation
feat(ml): T7 tier A training tooling, ignore-aware eval and results - #30
Merged
Merged
Conversation
Adds what the T7 training runs needed and records their results: - ml/kaggle/build_dataset.py assembles the stage-A/B Kaggle dataset (tier A labels, downsized real images, uncertain_* regions painted out of real train/valid); ml/kaggle/t7_session.py runs stage A then stage B in one time-budgeted GPU session. - train.py and train_kaggle.py take --time HOURS (wall-clock budget). - evaluate.py masks T4 uncertain_* ignore regions (unmapped stay scored), reports generate_v2 held-out-style test images as their own domain, and predicts one image at a time (a list source made ultralytics decode the whole split up front and run out of memory on the synthetic test set). - Frozen-set hash covers ignore regions; registers real_t4_test and synth_v2_seed1_n8000_test. - agent_docs/ml-pipeline.md: T7 results. The phase 2 gate is not met: synthetic held-out styles miss VDD and XOR, and every gateable real class plus JUNCTION recall (0.729) misses; the notes say which data would fix it.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for digisim canceled.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
T7 results: the accuracy targets are NOT met
This PR ships the training and evaluation tooling and an honest record of the runs. The trained detector does not meet the phase 2 accuracy targets, so phase 2 is not reached. No weights are committed; they stay outside git. Full tables, configuration, hashes and notes are in
agent_docs/ml-pipeline.md("T7 Results").The best model is the GPU stage B (mixed) run: Kaggle 2x T4, yolov8s at 960 px, digisim-t7-run-a, private. It was evaluated with the T6 harness on the hash-verified frozen sets (conf 0.35, IoU 0.5, Wilson 95% CIs).
Real held-out test (
real_t4_test, 99 images). Targets: F1 >= 0.85 per class with >= 30 instances, JUNCTION recall >= 0.90.Six classes have too few real test instances to judge, so the synthetic test is the only evidence for them: OUTPUT_PORT (28), NOT (10), NAND (1), NOR (1), XOR (1), XNOR (0).
Synthetic held-out-style test (391 images in styles never seen in training; target F1 >= 0.95 and accuracy >= 0.95). 12 of 14 classes pass. Two fail:
On the seen-style half, every class is at 0.98 or above.
Likely causes and data fixes:
A retrain cycle aimed at these causes follows on a separate branch.
Intent
DigiSim is a neglected project. Pull up the latest changes in Linux. It is high time to start training the model for it. I have not been able to provide the data. Figure out, get the data, train a model, make improvements and fix that. Do not come to me until you absolutely need me.
Context: the ML scout report found that the only trained detector uses 12 gate-era classes and detects nothing on the transistor-first schematics the app now uses, that the transistor-level training data does not exist yet, and that the wire/net tracing assumes left-to-right gates. It split the work into tasks T1-T11. T1 (class schema), T2 (synthetic generator v2), T4 (real data), T5 (training harness), T6 (evaluation harness v2) and T8 (net tracing v2) are merged on the default branch.
This task is T7, the training runs: train the transistor-first detector on the synthetic and real data now on the default branch and measure it with the evaluation harness.
What Changed
ml/kaggle/build_dataset.pyassembles a self-contained dataset from the synthetic v2 output and converted real data (tier A labels only, downsized real images,uncertain_*ignore regions painted out of training copies), andml/kaggle/t7_session.pyruns stage A (synthetic pretrain) then stage B (mixed fine-tune with real images oversampled) in one GPU session. Added a--timewall-clock budget option toml/train.pyandml/kaggle/train_kaggle.py, recorded astime_hoursin the plan and metrics.ml/eval_metrics.pyaddsdrop_ignored, andml/evaluate.pyapplies it by default for theuncertain_fet,uncertain_supplyanduncertain_terminalreasons (new--ignore-reasonflag,nonedisables), so unmatched predictions on objects that could not be labelled are not counted as false positives. Synthetic images flagged as held-out styles in the generator manifest get their own_heldout_styledomain,predict_splitnow predicts one image at a time to avoid running out of RAM, and the Markdown report notes ignore masking.ml/eval_frozen.pynow includes ignore-region files in the split digest, andml/frozen_sets.jsonis updated.agent_docs/ml-pipeline.mdand added tests for the Kaggle dataset build, ignore-region masking, the evaluate changes and the frozen-set hashing.Risk Assessment
✅ Low: The change is ML tooling, evaluation masking, and results docs. No committed weights, no production paths touched, the new logic traced correct on concrete inputs, tests exercise behavior, and the docs state honestly that the phase gate was missed.
Testing
I drove the changed ML tooling live on disposable data in /tmp, which I removed afterwards. The training
--timebudget, the ignore-region masking, the frozen-set hash guard and the Kaggle dataset builder all behaved as intended, and the 33 targeted unit tests pass. The real trained model and the real CGHD data (ml/data_real) are not in the worktree, so I could not evaluate a trained transistor-first detector against the real frozen sets. The smoke models detect almost nothing, so the F1 gates are not exercised. Nothing is left in the worktree.train.py --preset smoke --time 0.01runs real CPU training,--timeoverrides the preset's epoch count, and the budget is recorded in metrics.json_heldout_styledomain--ignore-reason nonedisables maskingpython -m real_data.build) and a GPU or Kaggle session are not in this worktree. I exercised the full train, evaluate and build path on dispos…Evidence: Evaluation report with ignore masking line
Evidence: Evaluation report showing held-out-style domain
Evidence: Scenario results summary
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
train.py --preset smoke --time 0.01runs real CPU training,--timeoverrides the preset's epoch count, and the budget is recorded in metrics.json_heldout_styledomain--ignore-reason nonedisables maskingpython -m real_data.build) and a GPU or Kaggle session are not in this worktree. I exercised the full train, evaluate and build path on dispos…uv run pytest tests/test_evaluate.py tests/test_eval_metrics.py tests/test_eval_frozen.py tests/test_kaggle_build.py(33 passed)uv run python train.py --preset smoke --time 0.01 --device cpuon a disposable dataset: real CPU training, val and ONNX export; args.yaml time=0.01 overrode epochs=2 (14 epoch rows), metrics.json records time_hourstrain.py --dry-run --time 0.01prints time_hours in the planpython -m data_gen.generate_v2 --count 60real generator output, smoke-trained on it, evaluated withevaluate.py: held-out-style images get their ownunknown_heldout_styledomainevaluate.py --freezethen evaluation on the generator output; adding ignore/*.json changed the split hash and the frozen check refused to evaluate until it was re-frozenevaluate.py --conf 0.001with--ignore-reason none, the default reasons, a non-masked reason, anduncertain_fetonly: false positives 433, 189, 374 and 189; dropped-prediction counts and the Markdown ignore line matchedml/kaggle/build_dataset.pywith the synthetic output plus a disposable real-data tree: uncertain_fet region painted out (pixel 0 to 254), region over a labelled box left untouched, painted_regions recorded in build_info.json; default real path missing gives a clear FileNotFoundError✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.