Hi all,
I use TMultiLayerPerceptrons for a while and never had any problems. I train over several epochs with a small eta, save the networks (with DumpWeights()) and continue training. In the past everything worked fine. When I now run the training (using root v5-22-00) I got sometimes this error message:
“Error in TMultiLayerPerceptron::TMultiLayerPerceptron::Train(): Stop.
Epoch: 100 learn=nan test=nan
Training done.”
And then it continues with:
“Info in TMultiLayerPerceptron::Train: Using 17866 train and 8932 test entries.
Training the Neural Network
Warning in TCanvas::Constructor: Deleting canvas with same name: NNtraining
Error in TMultiLayerPerceptron::TMultiLayerPerceptron::Train(): Line search fail
Epoch: 100 learn=0.832555 test=0.832555
Training done.”
As far as I followed the code the first error message is printed if TMultiLayerPerceptron::GetError() is nan. How can this happen? Can somebody help me to understand this? I am using the kStochastic learning method.
Best regards and thank you for your help,
Alex
PS:
Here is the piece of code I am using:
TMultiLayerPerceptron *mNet;
mNet = new TMultiLayerPerceptron(“fdEdxBin[0],fdEdxBin[1],fdEdxBin[2],fdEdxBin[3],fdEdxBin[4],fdEdxBin[5],fdEdxBin[6],fdEdxBin[7],fdEdxBin[8],fdEdxBin[9]:15:7:pid[0], pid[1]!”, tIn, fTrain, fTest);
Bool_t bFirstLoop = 0;
for(Int_t iEpoch = 0; iEpoch < nEpochs; iEpoch++){
if(bFirstLoop == 1){
mNet -> SetLearningMethod(TMultiLayerPerceptron::kStochastic);
mNet -> TMultiLayerPerceptron::SetEta(0.001);
mNet -> Train(100,"text update=10, graph");
bFirstLoop = 0;
}
else{
mNet -> Train(100,"text update=10, graph +");
}
mNet -> DumpWeights(Form("%s/Net_%d", $PWD, Epoch));
}