I’m using TMVA Keras to train a feed-forward NN to regress a feature.
When performing the pre-processing with VariableTransform, I realized that the target distribution also gets transformed, e.g. Gaussian, Normalize. I use only one of those at a time.
I must undo the transformation to compare my output distribution with truth values and later perform a fit to theory. Is there an easy way to inverse-transform the output of the TMVA neural network during inference or after?
I thought you were using TMVA::MethodPyKeras.cxx for the regression evaluation and then not SOFIE.
In the case of SOFIE you need then to apply yourself the transformation, both for the input variables and for the output. So you would need to add the lines shown above( from 757 until 767) where fOutput will be the return vector of SOFIE.
I could help you doing this, but I need to know how are you using SOFIE. Are you using within the Reader class ? Because you need access to the TransformationHandler and to the TMVA::Event class.
Thanks a lot for the help!
The output is now as expected.
Just for my understanding: You mentioned above that we need also to do the transformation of the inputs manually. Does this still apply to the snippet you posted above?
Do I need to transform the input distributions before calling SOFIE for the inference?
Hi,
In the code you have sent to me there is input transformation is applied. You are not giving to SOFIE as input the variables directly from the TTree, but the values from the values from the TMVA::Event class which are transformed.
One thing to do for us, given this use case, is to integrate the SOFIE inference in the TMVA::Reader class so the transformation are applied automatically.