Use TMVA to make a ROOT macro?

I’m fairly new to the whole ML world and somewhat of a novice coder, so I hope this question isn’t too basic for here. I’ve made a simple, multilayer perceptron in Python for a metric that I’d like to be able to call in ROOT. I have the model and all the weights; is there a way to migrate the prediction model into ROOT? I’m not looking to do any of the training in ROOT; just use the end result. It’s built with Keras using TensorFlow backend.

Barring that, is there a way to just pull the weights and hand-code the matrix multiplication? It’s only a few layers (ReLU and sigmoid), so it ought to be pretty straightforward, but I can’t quite figure it out (also, I want to learn how to do this in TMVA if possible for when the model gets more robust). Thanks!


I think these two tutorials could be helpful for you:

  1. Creating a model for use with TMVA
  2. Using a model with TMVA

Both can be found here.


I’ll check those out; thank you!