TMlpANN broken in recent ROOT versions?

Dear TMVAers,

I recently upgraded from ROOT-6.05.02 to ROOT-6.14.06.
I observed that after a successful training using the TMlpANN algorithm, the classification application, performed using reader->BookMVA(“TMlpANN”,weight_file) and reader->EvaluateMVA(“TMlpANN”), returns me for all events 1.80e-308.
Doing exactly the same with the “MLP” algo works fine…

Therefore, I ran the tmva/tutorials (root -l TMVAClassification.C(“TMlpANN,MLP”) and TMVAClassificationApplication.C(“TMlpANN,MLP”)) and could reproduce this behavior:

  • TMlpANN training go through and the ROC curve is fine
  • good classifiers returned with ROOT-6.04.10 and ROOT-6.05.02 by the classification application.
  • NULL TMlpANN classifiers returned by reader->Evaluate() for recent versions > ROOT-6.14.xx

Do you experience the same issue while running the tmva tutorials?
If yes, do you have any understanding?

Cheers,
Yoann

Hi,

I can reproduce the problems in fairly recent version of the master branch. I’ll file a bug report and we’ll look into it as soon as possible.

You can follow it here: https://sft.its.cern.ch/jira/browse/ROOT-9991

Cheers,
Kim

Dear Kim,

Is there any update from your side concerning the issue raised here?
Sounds like I also get the same issue with freshly installed ROOT-6.04.10 (on recent Scientific Linux 7.4) but not with old ROOT-6.04.10 install (installed on Scientific Linux 7.1).

Cheers,
Yoann

Dear TMVAers,

I found a bug in TMVA, specific to the TMlpANN algorithm as far as I understand, related to the definition of the temporary weighting file location.
In ROOT 6.14.06 for example:

  • in ./tmva/tmva/src/MethodTMlpANN.cxx - l. 361
// dump weights first in temporary txt file, read from there into xml
   const TString tmpfile=GetWeightFileDir()+"/TMlp.nn.weights.temp";

but GetWeightFileDir() points to nothing as it is never defined. Hence, this temporary file is tentatively created under the root directory “/” which cannot be done on most servers with non-admin rights.

One way for me to circumvent it has been to set a default value to the current directory:

  • in ./tmva/tmva/src/MethodTMlpANN.cxx - TMVA::MethodBase::MethodBase() creator
   SetWeightFileDir("."); // lines 298 & 362

Now, with this fix, I can see the temporary file TMlp.nn.weights.temp is created under the current directory.
The weights are well loaded and the Classification Application is returning the expected classifiers (tested on ROOT 6.12.06 and 6.14.06).

To my understanding, this fix should be included together with the possibility to set this weight file directory at the Reader initialization level.

Cheers,
Yoann

1 Like

Hi,

Thank you Yoann for looking into this. This should make it more simple to land a fix. I will update the Jira ticket accordingly.

Cheers,
Kim

Dear Kim,

Thanks.
For the record, this temporary weight file location was set in older ROOT version (e.g. 6.05.02) in the MethodBase constructor with the following command:
SetWeightFileDir( gConfig().GetIONames().fWeightFileDir ); // line 190

which, as a consequence, tentatively creates the default ./weights/ directory.
In general, this is no problem except if creating a directory is not permitted by the users, hence my comment with ROOT-6.04.10

Cheers,
Yoann