Commit 4d5249df authored by Davis King's avatar Davis King

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

parent 20dde81b
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment