This repository contains the framework for training the Pinpoint neutrino energy regression code
This code is configured using hydra and pytorch lightning
To setup the enviroment install micromaba, if you've every used miniconda before, the usage is very similar - mamba is just a bit faster.
With micromaba installed you can install the environment with:
mamba env create -f environment.yamlThe code is steered by nuRegressor.py which can operate in in one of three modes:
preprocess: Run the preprocessing step to convert the Pinpoint Geant4 root NTuples into the.ptpytorch files which contain the event image projrections and the training targets. An example command looks like:
python3 nuRegressor.py mode=preprocess preprocessing.input_dirpath=../path/to/Ntuples/10000/*.root preprocessing.output_dirpath=data/10000train: Run the training step. Unless overrridden, the output of the training and tensorboard logs will be saved tologs/energy_regression_train/<date-time>/. An example command looks like:
python3 nuRegressor.py mode=train training.learning_rate=0.00001
test: Run inference on test dataset and make the resolution plots. Will load thelogs/energy_regression_train/<data-time>/.hydra/config.yamlconfig to reload the checkpointed model:
python3 nuRegressor.py mode=test testing.run_dir=logs/energy_regression_train/2026-01-31_16-12-00/The config/config.yaml file contains all the parameters that will be used for the preprocessing, training and testing. Through hydra you can override any of the parameters from the command line when you run nuRegressor.py. For example, if you just wanted to regress the neutrino and primary lepton energy during training you could run
python3 nuRegressor.py mode=train training.targets=["E_nu","E_lep"]