mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Made the stopping condition for the structural svm solver a little more robust.
This commit is contained in:
parent
20dde81bd1
commit
4d5249df24
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user