physics
calorimeter
fast-simulation
generative-model
flow-matching
lorenzov506 commited on
Commit
6e077ea
·
0 Parent(s):

Multi-geometry pretrained count models (paper release)

Browse files
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - physics
5
+ - calorimeter
6
+ - fast-simulation
7
+ - generative-model
8
+ - flow-matching
9
+ library_name: pytorch
10
+ datasets:
11
+ - FLC-QU-hep/calorimeter-showers-multi-geometry
12
+ ---
13
+
14
+ # PointCountFM, multi-geometry pre-trained models
15
+
16
+ [![arXiv](https://img.shields.io/badge/arXiv-2608.18233-b31b1b?logo=arxiv&logoColor=white)](https://arxiv.org/abs/2608.18233)
17
+ [![Python Version](https://img.shields.io/badge/Python_3.13-306998?logo=python&logoColor=white)](https://www.python.org/)
18
+ [![PyTorch Version](https://img.shields.io/badge/PyTorch_2.8-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org/)
19
+
20
+ Flow-matching models (fully connected) for the **per-layer hit counts** of
21
+ electromagnetic calorimeter showers. PointCountFM is the condition producer in
22
+ the cascade of *[Transferable Fast Calorimeter Shower Generation via Multi-Geometry Pre-training](https://arxiv.org/abs/2608.18233)*: it samples the number of points in
23
+ each calorimeter layer, which then conditions the shower point cloud model
24
+ [FLC-QU-hep/AllShowers-multi-geometry](https://huggingface.co/FLC-QU-hep/AllShowers-multi-geometry).
25
+
26
+ Conditioning inputs: incident energy, sampling fraction, number of layers, and
27
+ the direction unit vector, in the order `[E, SF, n_layers, dir_x, dir_y, dir_z]`.
28
+
29
+ ## Checkpoints
30
+
31
+ | Folder | Pre-training data | Output dim (layers) |
32
+ |---|---|---|
33
+ | `simplebox/` | 4M showers, SimpleBox parametric geometry | 45 |
34
+ | `lemurs/` | 4M showers, 4 detectors (Par04 SciPb, Par04 SiW, ODD, CLD) | 90 |
35
+
36
+ Architecture (both): fully connected flow-matching network, hidden dims
37
+ [128, 256, 512, 256, 128], 6-dim condition, 6-dim time embedding.
38
+
39
+ ## Files and usage
40
+
41
+ ```
42
+ <folder>/
43
+ ├── best_model.pt # best-validation checkpoint (includes fitted norm_stats)
44
+ └── conf.yaml # architecture + transform pipeline definitions
45
+ ```
46
+
47
+ The checkpoint stores the fitted normalization statistics (`norm_stats`), so
48
+ these two files are all that is needed. With the
49
+ [PointCountFM repository](https://github.com/FLC-QU-hep/PointCountFM/tree/multi-geometry)
50
+ code, point the model loader at the downloaded folder:
51
+
52
+ ```python
53
+ from huggingface_hub import snapshot_download
54
+ model_dir = snapshot_download("FLC-QU-hep/PointCountFM-multi-geometry",
55
+ allow_patterns="lemurs/*") + "/lemurs"
56
+ # then load with load_pcfm_model() from src/pcfm_conditioning.py, which reads
57
+ # best_model.pt + conf.yaml from this directory and restores the transforms
58
+ # from the checkpoint's norm_stats
59
+ ```
60
+
61
+ For `lemurs/`, the 90-dim output is zero-padded at the tail: for a detector with
62
+ `n_layers` layers, take entries `0..n_layers-1`.
63
+
64
+ ## Training data
65
+
66
+ The pre-training datasets (Geant4, LEMURS + SimpleBox) are published at
67
+ [doi:10.25592/uhhfdm.19103](https://doi.org/10.25592/uhhfdm.19103).
68
+
69
+ ## Citation
70
+
71
+ If you use these weights, please cite:
72
+
73
+ ```bibtex
74
+ @article{Buss2026b,
75
+ author = {Buss, Thorsten and Day-Hall, Henry and Gaede, Frank and Kasieczka, Gregor and Kr{\"u}ger, Katja and McKeown, Peter and Valente, Lorenzo},
76
+ title = "{Transferable Fast Calorimeter Shower Generation via Multi-Geometry Pre-training}",
77
+ eprint = "2608.18233",
78
+ archivePrefix = "arXiv",
79
+ primaryClass = "physics.ins-det",
80
+ month = "8",
81
+ year = "2026"
82
+ }
83
+ ```
lemurs/best_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54363caf57619cf73f701b30e600fa0b44c93da6ce5da4c774f6e3160cfd995a
3
+ size 1424629
lemurs/conf.yaml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: pretrain_lemurs
2
+ result_path: .
3
+
4
+ data:
5
+ data_file: LEMURS_pretraining_4M.h5
6
+ batch_size: 1024
7
+ batch_size_val: 4096
8
+ train_fraction: 0.975
9
+ max_samples: null
10
+ use_nlayers_conditioning: true
11
+ use_direction_conditioning: true
12
+ transform_num_points:
13
+ - [Log, {alpha: 0.5}]
14
+ - [StandardScaler, {shape: [1, 90]}]
15
+ transform_fsamp:
16
+ - [MinMaxScaler, {shape: [1, 1], target_min: -1.0, target_max: 1.0}]
17
+ transform_nlayers:
18
+ - [MinMaxScaler, {shape: [1, 1], target_min: -1.0, target_max: 1.0}]
19
+ # directions are unit vectors — used as-is (no transform needed)
20
+
21
+ model:
22
+ name: FullyConnected
23
+ dim_input: 90 # max layers across LEMURS detectors (par04_siw=90, par04_scipb=45, odd=48, fccee_cld=40)
24
+ dim_condition: 6 # energy + sampling_fraction + n_layers + dir_x + dir_y + dir_z
25
+ dim_time: 6
26
+ hidden_dims: [128, 256, 512, 256, 128]
27
+
28
+ training:
29
+ epochs: 400
30
+ test_every: 100
31
+
32
+ # Early stopping on val flow-matching loss.
33
+ # Trainer reads `patience` (trainer.py:105). 0 = disabled.
34
+ patience: 30
35
+
36
+ optimizer:
37
+ name: Adam
38
+ lr: 1.0e-4
39
+ scheduler:
40
+ name: OneCycleLR
41
+ pct_start: 0.5
simplebox/best_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a32077c0a5677786bf83495026a0dfd6b3d2589a8b93a2200f74fc0286304d81
3
+ size 1377781
simplebox/conf.yaml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: pretrain_SimpleBox
2
+ result_path: .
3
+
4
+ data:
5
+ data_file: SimpleBox_pretraining_4M.h5
6
+ batch_size: 1024
7
+ batch_size_val: 4096
8
+ train_fraction: 0.975
9
+ max_samples: null
10
+ use_nlayers_conditioning: true
11
+ use_direction_conditioning: true
12
+ transform_num_points:
13
+ - [Log, {alpha: 0.5}]
14
+ - [StandardScaler, {shape: [1, 45]}]
15
+ transform_fsamp:
16
+ - [MinMaxScaler, {shape: [1, 1], target_min: -1.0, target_max: 1.0}]
17
+ transform_nlayers:
18
+ - [MinMaxScaler, {shape: [1, 1], target_min: -1.0, target_max: 1.0}]
19
+ # directions are unit vectors — used as-is (no transform needed)
20
+
21
+ model:
22
+ name: FullyConnected
23
+ dim_input: 45 # num layers
24
+ dim_condition: 6 # energy + sampling_fraction + n_layers + dir_x + dir_y + dir_z
25
+ dim_time: 6
26
+ hidden_dims: [128, 256, 512, 256, 128]
27
+
28
+ training:
29
+ epochs: 5000
30
+ test_every: 100
31
+
32
+ optimizer:
33
+ name: Adam
34
+ lr: 1.0e-4
35
+ scheduler:
36
+ name: OneCycleLR
37
+ pct_start: 0.5