Troubling running TMultiLayerPerceptron with ROOT 5.08/00

From: Nick West <>
Date: Wed, 8 Mar 2006 17:36:49 -0000

Dear RootTalk,

We are using TMultiLayerPerceptron but recently its behaviour has changed in ways that we don't understand: fits the previously worked now give degenerate results.

The network we are using has

o 3 input neurons: trkPHperPlane


o One hidden layer with 5 neurons

o 1 output neuron: type

We have a TTree called inTree containing the branches: trkPHperPlane, eventPlanes, shwPHperStrip and type. We take 4 out of every 5 events in the TTree for training purposes, so our constructor is:-

    TMultiLayerPerceptron("@trkPHperPlane, @eventPlanes,


We have been using the default training method (kBFGS - Broyden, Fletcher, Goldfarb, Shanno). We noticed the problem when migrating from ROOT 4.04/02 to 5.08/00. Sometimes the resulting net became quasi degenerate - giving basically the same output for any input. In exploring the problem we discovered that changing the method:-


enhanced the effect. With 4.04/02 the fit gives a plausible network every time, but with 5.08/00 it is almost always degenerate.

To demonstrate the problem we have a tar file containing:-


It can be found at:- m.tar.gz

Unwind the tar file and:-

  root -b -q testMlp.C

testMlp.C consists of:-



  TFile input("exampleTree.root");
  TTree *inTree = input.Get("smallTree");

  TMultiLayerPerceptron *mlp = new
TMultiLayerPerceptron("@trkPHperPlane, @eventPlanes,
@shwPHperStrip:5:type", inTree, "Entry$%5","!(Entry$%5)");


  cout << "Test set distribution. Mean : " << MLP_test0.GetMean() << " RMS " << MLP_test0.GetRMS() << endl;


After defining and training the net, the results of applying to the test set is displayed and then, using the wonders of CINT, the mean and RMS of that histogram are displayed.

Here are some typical results from 4.04/02

  Test set distribution.  Mean : 0.73054  RMS 0.212484
  Test set distribution.  Mean : 0.93671  RMS 0.241446
  Test set distribution.  Mean : 0.590702 RMS 0.231579
  Test set distribution.  Mean : 0.727839 RMS 0.167396

Contrast this with the results from 5.08/00

  Test set distribution.  Mean : 0.49273  RMS 0.0481377
  Test set distribution.  Mean : 0.515413 RMS 0.0805224
  Test set distribution.  Mean : 0.9872   RMS 0.0317544
  Test set distribution.  Mean : 0.891544 RMS 0.0351175

Notice the much smaller RMS showing that the distribution has collapsed to a narrow peak. The same behaviour persists to the lastest ROOT as of last night.

TMultiLayerPerceptron has changed significantly since 4.04/02, have we missed a significant change in usage?

Our platform is Scientific Linux SL Release 3.0.4 (SL) with gcc version 3.2.3


Nick West. Received on Wed Mar 08 2006 - 18:37:02 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:57 MET