Geant4 Cross Reference |
1 This repository contains the set of scripts us 2 in this example. 3 4 - root2h5.py: translation of ROOT file with sh 5 - core/constants.py: defines the set of common 6 - core/model.py: defines the VAE model class a 7 - utils/preprocess.py: defines the data loadin 8 - utils/hyperparameter_tuner.py: defines the H 9 - utils/gpu_limiter.py: defines a logic respon 10 - utils/observables.py: defines a set of obser 11 - utils/plotter.py: defines plotting classes r 12 - train.py: performs model training. 13 - generate.py: generate showers using a saved 14 - observables.py: defines a set of shower obse 15 - validate.py: creates validation plots using 16 - convert.py: defines the conversion function 17 - tune_model.py: performs hyperparameters opti 18 19 ## Getting Started 20 21 `setup.py` script creates necessary folders us 22 23 ``` 24 python3 setup.py 25 ``` 26 27 ## Full simulation dataset 28 29 The full simulation dataset can be downloaded 30 31 If custom simulation is used, the output of fu 32 33 ## Training 34 35 In order to launch the training: 36 37 ``` 38 python3 train.py 39 ``` 40 41 You may specify those three following flags. I 42 43 ```--max-gpu-memory-allocation``` specifies a 44 an integer. 45 46 ```--gpu-ids``` specifies IDs of physical GPUs 47 If you specify more than one GPU then automati 48 training. 49 50 ```--study-name``` specifies a study name. Thi 51 directory for saving models. 52 53 ## Hyperparameters tuning 54 55 If you want to tune hyperparameters, specify i 56 parameters: discrete, continuous and categoric 57 the categorical parameter requires a list of p 58 59 ``` 60 python3 tune_model.py 61 ``` 62 63 If you want to parallelize tuning process you 64 setting `--storage="URL_TO_MYSQL_DATABASE"`. T 65 66 ``` 67 python3 tune_model.py --storage="URL_TO_MYSQL_ 68 ``` 69 70 Similarly to training procedure, you may speci 71 ```--study-name```. 72 73 ## ML shower generation (MLFastSim) 74 75 In order to generate showers using the ML mode 76 and angle of the particle and the epoch of the 77 specified (by default is set to 10.000): 78 79 ``` 80 python3 generate.py --geometry=SiW --energy=64 81 ``` 82 83 If you do not specify an epoch number the base 84 85 ## Validation 86 87 In order to validate the MLFastSim and the ful 88 geometry, energy and angle of the particle: 89 90 ``` 91 python3 validate.py --geometry=SiW --energye=6 92 ``` 93 94 ## Conversion 95 96 After training and validation, the model can b 97 use `convert.py` script: 98 99 ``` 100 python3 convert.py --epoch 1000 101 ```