MLP( Multilayer Perceptron)

I am trying to use MLP. I would like to ask how do i get the values of the weights of the network so i can use it later.

and could anyone share a program using MLP … thanks


Use TMultiLayerPerceptron::Export or the TMultiLayerPerceptron::DumpWeights and LoadWeights combination (see

See $ROOTSYS/tutorials/mlpHiggs.C for classification and tutorials/mlpRegression.C for regression.


Thanks for the info… I should have read the class first thoroughly before I ask!!! sorry :blush:

Well, my next question is from the example MLPHiggs.C there was a script
" TMultiLayerPerceptron *mlp = new TMultiLayerPerceptron("@msumf,@ptsumf,@acolin:5:3:type", “ptsumf”,simu,“Entry$%2”,"(Entry$+1)%2");

What does “Entry$%2”,"(Entry$+1)%2" mean???

The MLP uses extensively the TTree query mecjhanism. See a description
of the query syntax and in particular the section “Special functions and variables” at



as you know, the TMultiLayerPerceptron constructor expects as arg 4 and 5 const char* training and const char* test. The doc says “training and test are two cuts (see TTreeFormula) defining events to be used during the neural net training and testing.” If you look at TTree’s doc at, it says [quote] Entry$: A TTree::Draw formula can use the special variable Entry$
to access the entry number being read. For example to draw every
other entry use:
tree.Draw(“myvar”,“Entry$%2==0”);[/quote] I assume you know the operator %, so you’ll see that Entry$%2 for training and (Entry$+1)%2 for test means “use even events for test, use odd events for training”.

Cheers, Axel.