TMultiLayerPerceptron questions

Hi,
I have a whole list of questions. I’m trying to create an ANN using TMultiLayerPerceptron (TMLP), see attached macro and example file.

i) Everything goes well, but when I try to plot the result I get “Error in TMultiLayerPerceptron::DrawResult(): no dataset.” - even though it’s specified in its c’tor. I realize I should use the TMLPAnalyzer (and I will use it) , but TMLP offers this method, and it seems I don’t understand its prerequisites.
Okay, got it now - I have to specify “test” or “train” as option. IMHO it’d make sense to default to test, and allow the option “train”.
ii) The progress canvas Train(“graph”) is updated twice per epoch:

residual_plot->GetYaxis()->UnZoom(); canvas->Modified(); canvas->Update(); residual_plot->GetYaxis()->SetTitleOffset(1.4); residual_plot->GetYaxis()->SetDecimals(); canvas->Modified(); canvas->Update();
This adds some time penalty when running via remote X export. Is the first Update really needed?
iii) In the mlpHiggs tutorial it says

TMultiLayerPerceptron *mlp = new TMultiLayerPerceptron("msumf,ptsumf,acolin:5:3:type", "ptsumf",simu,"Entry$%2","Entry$/2");
Why isn’t the test data cut “(Entry$+1)%2”?
iv) The documentation doesn’t mention how the const char* parameters for test, train in the TMultiLayerPerceptron c’tor are to be used. Could that be added?
v) in the class description of TMLP it says
Example: TMultiLayerPerceptron(“x/F,y/F:10:5:f/F”,inputTree);
But specifying “/F” will make TMLP unhappy.

It might not be obvious from my comments, but: TMLP is wonderful, thanks so much, Christophe!
Cheers, Axel.
ANNdata.root (6.95 KB)
ANN_MuCorr.C (458 Bytes)

Hello Axel,

i)

[quote]I get “Error in TMultiLayerPerceptron::DrawResult(): no dataset.” - even though it’s specified in its c’tor.
[/quote]
yes, you should specify on which dataset you want to run (train or test) in the option field.
You got an error since there is no default. Test should probably be put as default, and the doc modified accordingly.

ii)

[quote]The progress canvas Train(“graph”) is updated twice per epoch. This adds some time penalty when running via remote X export
[/quote]
I remember that this was needed when I wrote the code. Otherwise the axis were not well recomputed. If you want to be faster, you can specify the option “update=X”, where X is the step you want for the refresh on screen.

iii)

[quote]Why isn’t the test data cut “(Entry$+1)%2”?
[/quote]
Yes, “(Entry$+1)%2” should be used… I was probably tired that night :slight_smile:
If you don’t apply this change, test and training datasets are not orthogonal.

iv)

[quote]The documentation doesn’t mention how the const char* parameters for test, train in the TMultiLayerPerceptron c’tor are to be used. Could that be added?
[/quote]
Yes. I’ll update the doc when I have time. To make it short, it has to contain a TCut that can be used to define the datasets.

v)

[quote]in the class description of TMLP it says
Example: TMultiLayerPerceptron(“x/F,y/F:10:5:f/F”,inputTree);
But specifying “/F” will make TMLP unhappy.
[/quote]
Ooops… this is a old synthax that has been removed long time ago. This should be changed. Since TFormulas are used internally, the branch type has not to be specified anymore.

I’ll try to fix what has to be fixed as soon as possible… when I found time.
Christophe.