diff --git a/modules/ml/src/ann_mlp.cpp b/modules/ml/src/ann_mlp.cpp index 1e4691e69d..ce6fdd877d 100644 --- a/modules/ml/src/ann_mlp.cpp +++ b/modules/ml/src/ann_mlp.cpp @@ -971,7 +971,7 @@ public: int count = inputs.rows; int iter = -1, max_iter = termCrit.maxCount*count; - double epsilon = termCrit.epsilon*count; + double epsilon = (termCrit.type & CV_TERMCRIT_EPS) ? termCrit.epsilon*count : 0; int l_count = layer_count(); int ivcount = layer_sizes[0];