GammaLearn
Deep Learning for Imaging Cherenkov Telescopes Data Analysis.
GammaLearn is a collaborative project to apply deep learning to the analysis of low-level Imaging Atmospheric Cherenkov Telescopes such as CTA. It provides a framework to easily train and apply models from a configuration file.
Table of Contents
Implementation
Usage
Contributing
Cite Us
License
Implementation
Dependencies
PyTorch (>= 1.7)
Numpy
PyTables
Matplotlib
scikit-image
PyTorch Lightning (>=1.4.6)
TensorBoard
IndexedConv (>=1.3)
ctapipe
dl1-data-handler
lstchain (~0.7)
torch-tb-profiler
Installation procedure
We recommend the use of Anaconda with Python 3.8.
Create the environment:
VERSION=0.12.0
wget https://gitlab.in2p3.fr/gammalearn/gammalearn/-/raw/v${VERSION}/environment.yml -O glearn_${VERSION}_env.yml
conda install mamba -n base -c conda-forge
mamba env create -f glearn_${VERSION}_env.yml
conda activate glearn
Note for OSX and/or no-gpu users: please edit the environment file to remove cudatoolkit
from the dependencies.
Install GammaLearn
with pip (recommended for users)
pip install gammalearn==$VERSION
or from source (for developpers):
git clone --depth 1 https://gitlab.in2p3.fr/gammalearn/gammalearn cd gammalearn pip install .
Usage
First activate your conda environment
To run an experiment
gammalearn path_to_your_experiment_settings_file.py
you can find an example of setting file in https://gitlab.in2p3.fr/gammalearn/gammalearn/-/tree/master/gammalearn/data/example_settings and some sample data in https://gitlab.in2p3.fr/gammalearn/gammalearn/-/tree/master/share/data
To visualise the results from your experiment, GammaLearn integrates with GammaBoard that provides high-level metrics and plots to assess IACTs reconstruction performances
To visualise the convolution kernels of your trained network (experimental feature)
gexplore-net path_to_your_experiments experiment_name checkpoint_version
Contributing
Contributions are very much welcome.
Open an issue to first discuss potential changes/additions.
Cite Us
Please cite
*Jacquemont M, Vuillaume T, Benoit A, Maurin G, Lambert P, Lamanna G, Brill A. GammaLearn: A Deep Learning Framework for IACT Data. In36th International Cosmic Ray Conference (ICRC2019) 2019 Jul (Vol. 36, p. 705). DOI: https://doi.org/10.22323/1.358.0705*
For reproducibility purposes, please also cite the exact version of GammaLearn you used by citing the corresponding DOI on Zenodo:
Version 0.7.4: .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.5879804.svg
- target:
- alt:
DOI
License
Copyright (c), 2018, GammaLearn
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- GammaLearn package API
- Subpackages
- gammalearn.callbacks module
LogFeatures
LogGradNormTracker
LogGradientCosineSimilarity
LogGradientNorm
LogGradientNormPerTask
LogLambda
LogLinearGradient
LogLossWeighting
LogModelParameters
LogModelWeightNorm
LogReLUActivations
LogUncertaintyTracker
WriteADistance
WriteAccuracy
WriteAccuracyDomain
WriteAutoEncoder
WriteAutoEncoderDL1
WriteConfusionMatrix
WriteDL2Files
WriteData
make_activation_sender()
make_feature_logger()
make_linear_gradient_logger()
- gammalearn.constants module
- gammalearn.criterions module
DANNLoss
DeepCORALLoss
DeepJDOTLoss
EqualWeighting
FocalLoss
GaussianKernel
GradNorm
GradientToolBox
LossComputing
MKMMDLoss
ManualWeighting
MovingAverageMetric
MultiLossBalancing
OutOfBalancing
RandomLossWeighting
UncertaintyWeighting
angular_separation_loss()
cross_entropy_loss()
cross_entropy_loss_nn()
focal_loss()
nll_nn()
one_hot()
- gammalearn.data_handlers module
- gammalearn.datasets module
AddPoissonNoise
AddPoissonNoiseMC
BaseLSTDataset
CleanImages
FileLSTDataset
FlattenNumpy
GLearnCompose
GlearnDomainAdaptationDataset
HDF5Dataset
MemoryLSTDataset
MockLSTDataset
NormalizePixel
NumpyDataset
NumpyToTensor
Patchify
ReducePixelValue
ResampleImage
RescaleCharge
RotateImage
TqdmLoggingHandler
TransformIACT
VisionDataset
VisionDomainAdaptationDataset
WrongGeometryError
augment_via_duplication()
fetch_dataset_geometry()
- gammalearn.experiment_runner module
- gammalearn.gl_dl1_to_dl2 module
- gammalearn.logging module
- gammalearn.optimizers module
- gammalearn.steps module
get_eval_step_dann()
get_eval_step_deepcoral()
get_eval_step_deepjdot()
get_eval_step_mae()
get_eval_step_mkmmd()
get_eval_step_mt()
get_test_step_mt()
get_training_step_dann()
get_training_step_deepcoral()
get_training_step_deepjdot()
get_training_step_mae()
get_training_step_mkmmd()
get_training_step_mt()
get_training_step_mt_gradient_penalty()
run_model()
- gammalearn.utils module
BaseW
DistributionW
ExponentialW
TrainerLogger
TrainerTensorboardLogger
TrainerWandbLogger
add_tokens_to_pos_embed()
browse_folder()
calculate_pos_emb()
center_time()
check_grid()
check_particle_mapping()
check_patches()
cleaning_filter()
compute_dann_hparams()
compute_total_parameter_number()
dump_config_filters()
dump_experiment_config()
emission_cone_filter()
energyband_filter()
fetch_data_module_settings()
find_datafiles()
format_name()
get_2d_sincos_pos_embedding_from_grid()
get_2d_sincos_pos_embedding_from_patch_centroids()
get_camera_layout_from_geom()
get_centroids_from_patches()
get_dataset_geom()
get_index_matrix_from_geom()
get_patch_indices_and_centroids_from_geometry()
get_patch_indices_and_grid()
get_torch_weights_from_lightning_checkpoint()
impact_distance_filter()
inject_geometry_into_parameters()
intensity_filter()
is_datafile_healthy()
leakage_filter()
load_camera_parameters()
merge_list_of_dict()
nets_definition_path()
post_process_data()
prepare_dict_of_tensors()
prepare_experiment_folder()
prepare_gammaboard_folder()
rgb_to_grays()
rotated_indices()
shower_position_filter()
telescope_multiplicity_filter()
write_dataframe()
write_dl2_dataframe()
write_dl2_file()
- gammalearn.version module
- Module contents
- GammaLearn CLI programs