Made the stopping condition for the structural svm solver a little more robust.

This commit is contained in:
Davis King 2014-01-05 17:11:56 -05:00
parent 20dde81bd1
commit 4d5249df24

View File

@ -438,7 +438,8 @@ namespace dlib
if (converged)
{
return current_risk_gap < std::max(cache_based_eps,cache_based_eps*current_risk_value);
return (current_risk_gap < std::max(cache_based_eps,cache_based_eps*current_risk_value)) ||
(current_risk_gap == 0);
}
if (current_risk_gap < eps)
@ -452,7 +453,8 @@ namespace dlib
{
converged = true;
skip_cache = false;
return current_risk_gap < std::max(cache_based_eps,cache_based_eps*current_risk_value);
return (current_risk_gap < std::max(cache_based_eps,cache_based_eps*current_risk_value));
(current_risk_gap == 0);
}
++count_below_eps;