Skip to content

Commit

Permalink
Merge pull request #136 from rcurtin/lbfgs-scaling-factor
Browse files Browse the repository at this point in the history
Check L-BFGS scaling factor for convergence
  • Loading branch information
favre49 committed Sep 18, 2019
2 parents 649010c + 053c79c commit 0f9dc82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
@@ -1,3 +1,8 @@
### ensmallen ?.??.?
###### ????-??-??
* Add additional L-BFGS convergence check
([#136](https://github.com/mlpack/ensmallen/pull/136)).

### ensmallen 2.10.2: "Fried Chicken"
###### 2019-09-11
* Add release script to rel/ for maintainers
Expand Down
6 changes: 6 additions & 0 deletions include/ensmallen_bits/lbfgs/lbfgs_impl.hpp
Expand Up @@ -409,6 +409,12 @@ L_BFGS::Optimize(FunctionType& function,

// Choose the scaling factor.
double scalingFactor = ChooseScalingFactor(itNum, gradient, s, y);
if (scalingFactor == 0.0)
{
Info << "L-BFGS scaling factor computed as 0 (terminating successfully)."
<< std::endl;
break;
}

// Build an approximation to the Hessian and choose the search
// direction for the current iteration.
Expand Down

0 comments on commit 0f9dc82

Please sign in to comment.