model.pair_bias adds a per-head attention bias from an MLP of the pair
features [deta, dphi, dR, log(1 + m^2)] (Particle Transformer style); it is
on in configs/gamgam_transformer.yaml. configs/gamgam_deep_sets.yaml adds
Deep Sets, the order-independent baseline without object interactions. Both
share an ObjectEmbedding and export to ONNX.
The transformer now uses its own pre-norm blocks on scaled_dot_product_attention:
nn.TransformerEncoder's inference fast path returns NaN with a per-head mask.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(transformer): type embedding instead of positions, pre-norm, ONNX export
Objects are stored by type, so the position embedding mostly relearned the
object type and made the output depend on object order. Tokens are now a
linear map of the kinematics (phi as cos/sin) plus a node-type embedding;
model.max_seq_len is gone. The transformer exports to ONNX with tokens and
token_mask inputs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore: keep only the final epoch of each pretrained model
Fine-tuning loads a single checkpoint, so drop the 114 intermediate
model_epoch_N.pt files and keep multiclass epoch 71 and multilabel
epoch 44.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refactor: flat modules, one YAML per experiment, no Hydra
Replace the 14 subpackages with 13 flat modules (6.7k -> 2.7k lines),
the Hydra config groups with typed dataclasses and one self-contained
YAML file per experiment (configs/), and the docs with docs/usage.md and
docs/design.md. All capabilities stay: GamGam, ttH CP, Delphes, binary
and multiclass tasks, transformer, fine-tuning from Pretrained_GNN, DDP,
torch.compile/CUDA graphs/bfloat16, predict and ONNX export.
Behavior: prepared caches, pretrained-model logits and two CPU training
epochs are bit-identical to the previous code on the fixtures and a 60k
event GamGam subset. Energies are now computed with one vectorized cosh
(<= 2.4e-7 relative difference on 969 of the full GamGam objects). The
ttH and Delphes configs now use Number % 10 as the fold (the raw event
index selected only the first 10 events), and use the paper recipe
(64/4/4, Adam 1e-4, decay 0.99). The ROOT score writer handles jagged
trees. Prediction files store source file and entry instead of sample
ids, and checkpo…