Skip to content

Commit 00e43a9

Browse files
committed
ml(ANN_MLP): ensure that train() call is always successful
1 parent 289a8da commit 00e43a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/ml/src/ann_mlp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ class ANN_MLPImpl : public ANN_MLP_ANNEAL
948948
trained = true; // Enable call to CalcError
949949
int iter = simulatedAnnealingSolver(s, params.initialT, params.finalT, params.coolingRatio, params.itePerStep, NULL, params.rEnergy);
950950
trained =false;
951-
return iter;
951+
return iter + 1; // ensure that 'train()' call is always successful
952952
}
953953

954954
int train_backprop( const Mat& inputs, const Mat& outputs, const Mat& _sw, TermCriteria termCrit )

0 commit comments

Comments
 (0)