-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[TMVA][Preprocessing] - Additional normalisation method #4141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can one of the admins verify this patch? |
|
Very nice PR. Thank you very much for your contribution! |
|
Hi Imoneta, Modifying tutorials/tmva/keras/ClassificationKeras.py to add an 'S' transformation Line 63-66 becomes: Updated script attached: Before the changes the output from running We can see that the training sample transformation is limited to be between -1 and 1:
Scaling is working... is it being saved and loaded again ok? We can check the 'Test' phase in the same script since TMVA saves transformations to file, then loads them to re-apply to testing data
The limits are no longer exactly -0.54435 to 1.0, but they linearly match the D,G transformation (see DG.log file). If we had a larger data sample the training and test transformations would have more similar ranges. We can also see at the end of the training that the training and test data classification accuracy match each other, also showing the transformation is working:
Any questions please ask Thank you |
|
@phsft-bot build |
|
Starting build on |
|
Build failed on windows10/cxx14. Errors:
|
|
@phsft-bot build |
Ahha I dont have that power. I saw the build failed and that this branch was waay behind the master branch so simply merged in the current version of the protject-root/master |
sitongan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Is there anything I can do to help expediate this pull request? |
Please do instead a rebase with current master (e.g. with git rebase --interactive)
Based on your tutorial above, create a test either in the roottest or tmva/test folders. |
…y scales the data but the sign of the input and output data is retained).
|
Thank you very much! Given that this PR got a positive review by a TMVA expert, I don't think it should be held back from merging. |
| { | ||
| TString UseOffsetOrNot; | ||
|
|
||
| gTools().ReadAttr(trfnode, "UseOffsetOrNot", UseOffsetOrNot ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fairly certain this breaks the reading of existing TMVA files that have not been written with the UseOffsetOrNot tag.
I currently get messages like:
<FATAL> : Trying to read non-existing attribute 'UseOffsetOrNot' from xml node 'Transform'
I am currently trying a simple fix locally and will open a PR once I have validated that works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! That is very kind.
Add scaling VarTransform functionality to TMVA preproccessing (like normalisation it linearly scales the data but the sign of the input and output data is retained).
I have added to the functionality of the VariableNormalizeTransform class in the style of the VariableGaussTransform class to transform data such that it remains in the range of [-1,1], there is no offset, so the sign of the input data is unchanged by the transformation.
This is proving essential for my neural network analyses that treat a detector hit data like an image classification problem and use ReLU activation functions at the beginning of my network.
I have also added a description to the TMVA documentation