Feature/ivysaurus - #3
Open
imawby wants to merge 2 commits into
Open
Conversation
added 2 commits
July 29, 2026 12:02
AndyChappell
requested changes
Jul 30, 2026
Comment on lines
+88
to
+89
| pfpVars_train = pfpVars[:,0][train_idx] | ||
| pfpVars_test = pfpVars[:,0][test_idx] |
| # Split training sample into contained and exiting | ||
| this_detector_boundaries = detector_boundaries.get(args.detector) | ||
|
|
||
| (startGridU, startGridU_valid, |
Member
There was a problem hiding this comment.
It would be useful to have a comment that briefly notes the structures of the variables here.
| train_idx = indices[:ntrain] | ||
| test_idx = indices[ntrain:ntrain + ntest] | ||
|
|
||
| startGridU_train = startGridU[train_idx] |
Member
There was a problem hiding this comment.
It does seem as though having some of these variables as dictionaries keyed on U/V/W could make thiscode much more concise/
| ######################################################################################################## | ||
|
|
||
| def readTree(args, detector) : | ||
|
|
Comment on lines
+246
to
+250
| displacement_valid = displacement > -0.5 | ||
| dca_valid = dca > -0.5 | ||
| trackStubLength_valid = trackStubLength > -0.5 | ||
| nuVertexAvSeparation_valid = nuVertexAvSeparation > -0.5 | ||
| nuVertexChargeAsymmetry_valid = nuVertexChargeAsymmetry > -0.5 |
Member
There was a problem hiding this comment.
Why compare to -0.5 here? Would > -1 not be more direct? Is it also worth adding an "invalid" value and using that in the comparison?
| particlePDG[abs(particlePDG) == 13] = 0 | ||
| particlePDG[abs(particlePDG) == 2212] = 1 | ||
| particlePDG[abs(particlePDG) == 211] = 2 | ||
| # particlePDG[abs(particlePDG) == 321] = 3 |
Comment on lines
+92
to
+97
| startGridU = startGridU[target_mask] | ||
| startGridV = startGridV[target_mask] | ||
| startGridW = startGridW[target_mask] | ||
| endGridU = endGridU[target_mask] | ||
| endGridV = endGridV[target_mask] | ||
| endGridW = endGridW[target_mask] |
Member
There was a problem hiding this comment.
Not as big an effect as previously, but again, map based definitions here could compress some of the code
| @@ -0,0 +1,41 @@ | |||
| # Grid | |||
Member
There was a problem hiding this comment.
Brief comment about where these numbers come from
| from sklearn.metrics import classification_report | ||
| from sklearn.metrics import confusion_matrix | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
This PR add the Ivysaurus training scripts to the LArPython repository, creating the
ml/networks/training/structure as requested.The workflow is as follows:
larpandoraanalyserpython3 CreateTrainArrays.py --file_name ivy_0.root --input_dir ~/LArPython/files/ --output_dir ~/LArPython/files/python3 train.py --n_epochs=10 --input_dir ~/LArPython/primary_files/ --output_dir ~/LArPython/model/primary/ --learning_rate 0.00005 --batch_size 64The network architecture is found in
ivysaurus_model.pyandNormalisation.pycontains the normalisation constants used to normalise each parameter for training.Although the
.npztraining files are split on the basis containment, the training can proceed on all particles.