Skip to content

New features - #5

Merged
aniketkhanal merged 11 commits into
mainfrom
dev_features
Oct 30, 2026
Merged

aniketkhanal merged 11 commits into
mainfrom
dev_features

Conversation

@aniketkhanal

Copy link
Copy Markdown
Collaborator

Major features added:

  1. Finetune after resetting optimizer (optional)
  2. Labels (optional) input in config file
  3. Masked classes: allow option to train with certain events without passing them through activation function

- optional `labels:` section: the class names in label order; classes = labels
  when given, else rest + outputs; every output name must be a label; the main
  score is the class of the first output (spec.main_class) in the trainer,
  evaluator, validator and report
- the last input channel of a context collection is fed to the network as given
  (+1/-1 from the loader; an external caller may pass a 0/1 quality flag)
- all slots of one leaf role in one node are embedded in a single call and share
  the ghost-batch statistics (one updateMeanStd per node and role)
- docs: EventInfo.md, Dataset.md, README; tests: labels, grouped embedding
Since the grouped leaf embedding (57e8ce4) the training-mode forward, backward and trainer
no longer match the research code bit for bit; eval mode, parameter counts, loader tensors and
stored checkpoints still do.

- tests/reference: test_forward_backward_parity -> test_eval_forward_parity (frozen statistics
  equal except the leaf embedders, equal to float32 rounding; eval outputs torch.equal);
  test_trainer_parity keeps state-dict keys/shapes/integer buffers, predicted events and the
  lr / batch-size schedule
- tests/test_training_regression.py + tests/training_regression.py: hh4b and bbww on 1,024
  events of the small example files, CPU, one thread: frozen statistics, training-mode outputs,
  first-step gradients, 5 SGD steps, eval outputs, against tests/golden/{hh4b,bbww}.npz
  (relative tolerance 1e-4)
- scripts/make_golden.py regenerates them (noise probes, size limit 2 MB)
- tests/reference: the bbWW reference is configs/hcr/dscan/bbww_reflect_d8.yaml (eta reflection,
  as the example after the doi-1.0.0 merge) with the paper's checkpoint
  models/bbww_d8_e20bestreflect_r3_best; the configuration test compares the training options
  after the defaults are filled in
- CONTRIBUTING.md: reference tests and golden-file regeneration

The bbWW and ttH examples state reflect_eta: true explicitly (docs/TTH.md mirrors it); the bbWW parity reference is configs/hcr/dscan/bbww_reflect_d8.yaml with the paper's reflected checkpoint, and the configuration comparison is on the parsed training spec.
… the fine-tuning stage

At freeze_epoch, with the option on, a new Adam over the trainable parameters and a new MultiStepLR replace the main-stage optimizer. Off by default; documented in Options.md and the hyperparameter examples; tests in tests/test_recipe_options.py.
… events

For events with EVENT/<flag> true, the listed classes are set to -inf in the training and validation cross-entropy; evaluation uses the full softmax. The loader and the validator reject a flagged event that carries an excluded label. Off by default; documented in Options.md and Dataset.md.
@aniketkhanal
aniketkhanal merged commit 37dbb7d into main Oct 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant