This macro run the SOFIE parser on the Keras model obtaining running TMVA_Higgs_Classification.C You need to run that macro before this one
Author: Lorenzo Moneta
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Monday, March 27, 2023 at 09:59 AM.
using namespace TMVA::Experimental;
Arguments are defined.
const char * modelFile = "Higgs_trained_model.h5";
check if the input file exists
if (gSystem->AccessPathName(modelFile)) {
Error("TMVA_SOFIE_RDataFrame","You need to run TMVA_Higgs_Classification.C to generate the Keras trained model");
return;
}
parse the input Keras model into RModel object
SOFIE::RModel model = SOFIE::PyKeras::Parse(modelFile);
TString modelHeaderFile = modelFile;
modelHeaderFile.ReplaceAll(".h5",".hxx");
Generating inference code
model.Generate();
model.OutputGenerated(std::string(modelHeaderFile));
copy include in $ROOTSYS/tutorials
std::cout << "include is in " << gROOT->GetIncludeDir() << std::endl;