ml(ANN_MLP): ensure that train() call is always successful

pull/10398/head
Alexander Alekhin 7 years ago
parent 289a8da39e
commit 00e43a9022
  1. 2
      modules/ml/src/ann_mlp.cpp

@ -948,7 +948,7 @@ public:
trained = true; // Enable call to CalcError
int iter = simulatedAnnealingSolver(s, params.initialT, params.finalT, params.coolingRatio, params.itePerStep, NULL, params.rEnergy);
trained =false;
return iter;
return iter + 1; // ensure that 'train()' call is always successful
}
int train_backprop( const Mat& inputs, const Mat& outputs, const Mat& _sw, TermCriteria termCrit )

Loading…
Cancel
Save