Views
No views yet
| file | contents |
|---|---|
best.pt | model weights (state_dict), the checkpoint with the best validation accuracy across training |
log.json | full per-epoch training history (train/val loss, val accuracy, timing) |
Conv2d(1, 256, kernel_size=16, stride=16) on a 384x384
single-channel input image → 24x24 = 576 patch tokens(p/60, (eta-2.5)/1.0, cos(phi), sin(phi)) into one 256-dim token,
concatenated alongside the cls token and the 576 patch tokens
(578 tokens total) — added because ring size alone is degenerate across
species (a kaon and proton can share a ring radius at different
momenta), so the model needs momentum/direction to disambiguateLinear(256, 4) on the final cls token outputtrain_bl_ath (527,697 events — above each species' own
aerogel Cherenkov threshold, n=1.026), full-detector-extent images
(384x384 px, pixel = log1p(hit count))test_bl_ath
(58,670 events):| species | efficiency |
|---|---|
| electron | 93.9% |
| pion | 85.5% |
| kaon | 85.9% |
| proton | 87.4% |
img: (B, 1, 384, 384) float32 — log1p(hit count) per pixel, full
detector extent (3540mm window, matching the dRICH sensor plane's
physical size), no crop/centeringkin: (B, 4) float32 — [momentum/60.0, (eta-2.5)/1.0, cos(phi), sin(phi)](B, 4) logits, order [electron, pion, kaon, proton].1import torch
2from huggingface_hub import hf_hub_download
3# RingViT class definition -- see predict_from_root.py in this repo, or
4# the training repo's vit/model.py
5
6ckpt_path = hf_hub_download("deepaksamuel-cuk/drich-vit-baseline", "best.pt")
7model = RingViT(num_classes=4)
8model.load_state_dict(torch.load(ckpt_path, map_location="cpu"))
9model.eval()
10
11img = torch.zeros(1, 1, 384, 384) # replace with a real rasterized event
12kin = torch.zeros(1, 4) # replace with real [p, eta, phi] features
13with torch.no_grad():
14 probs = torch.softmax(model(img, kin), dim=1)
15print(probs) # [P(electron), P(pion), P(kaon), P(proton)]predict_from_root.py in this repo for a complete, self-contained
script (includes the model class inline, no need to clone the training
repo) that takes a raw Geant4 simulation .root output file, extracts
DRICHHits/DRICHHits.cellID, resolves it to physical hit positions via
the sensor geometry lookup table (cellid_positions.npz, hosted in the
simhits data
repo), rasterizes it exactly as in training, and prints the predicted
species with per-class probabilities:1pip install torch uproot awkward numpy huggingface_hub
2python predict_from_root.py sim_2212_30.0_2.0_3.14.root