TMVA::RSofieReader class for reading external Machine Learning models in ONNX files, Keras .h5 files or PyTorch .pt files and performing the inference using SOFIE It is reccomended to use ONNX if possible since there is a larger support for model operators.
Definition at line 45 of file RSofieReader.hxx.
Public Member Functions | |
RSofieReader (const std::string &path, std::vector< std::vector< size_t > > inputShapes={}, int verbose=0) | |
Create TMVA model from ONNX file print level can be 0 (minimal) 1 with info , 2 with all ONNX parsing info. | |
std::vector< float > | Compute (const std::vector< float > &x) |
Compute model prediction on vector. | |
RTensor< float > | Compute (RTensor< float > &x) |
Compute model prediction on input RTensor The shape of the input tensor should be {nevents, nfeatures} and the return shape will be {nevents, noutputs}. | |
Private Attributes | |
std::function< std::vector< float >(void *, const float *)> | fFuncPtr |
bool | fInitialized = false |
void * | fSessionPtr = nullptr |
#include <TMVA/RSofieReader.hxx>
|
inline |
Create TMVA model from ONNX file print level can be 0 (minimal) 1 with info , 2 with all ONNX parsing info.
Definition at line 51 of file RSofieReader.hxx.
|
inline |
Compute model prediction on vector.
Definition at line 220 of file RSofieReader.hxx.
Compute model prediction on input RTensor The shape of the input tensor should be {nevents, nfeatures} and the return shape will be {nevents, noutputs}.
Definition at line 237 of file RSofieReader.hxx.
|
private |
Definition at line 261 of file RSofieReader.hxx.
|
private |
Definition at line 259 of file RSofieReader.hxx.
|
private |
Definition at line 260 of file RSofieReader.hxx.