Decreasing threshold at which L-BFGS Hessian is updated.
- Decreasing threshold at which L-BFGS Hessian is updated from 1e-10
to 1e-14 results in a very significant improvement in NIST scores
(43 -> 53 for CUBIC).
- Adding comment in FindPolynomialRoots() explaining why behaviour
is correct.
Change-Id: If668e087e7a86d29659aa74e8528b192b604c841
diff --git a/internal/ceres/low_rank_inverse_hessian.cc b/internal/ceres/low_rank_inverse_hessian.cc
index 372165f..0bb71dc 100644
--- a/internal/ceres/low_rank_inverse_hessian.cc
+++ b/internal/ceres/low_rank_inverse_hessian.cc
@@ -52,7 +52,9 @@
bool LowRankInverseHessian::Update(const Vector& delta_x,
const Vector& delta_gradient) {
const double delta_x_dot_delta_gradient = delta_x.dot(delta_gradient);
- if (delta_x_dot_delta_gradient <= 1e-10) {
+ // Note that 1e-14 is very small, but larger values (1e-10/12) substantially
+ // weaken the performance on the NIST benchmark suite.
+ if (delta_x_dot_delta_gradient <= 1e-14) {
VLOG(2) << "Skipping LBFGS Update, delta_x_dot_delta_gradient too small: "
<< delta_x_dot_delta_gradient;
return false;
diff --git a/internal/ceres/polynomial.cc b/internal/ceres/polynomial.cc
index feec884..e548da0 100644
--- a/internal/ceres/polynomial.cc
+++ b/internal/ceres/polynomial.cc
@@ -137,6 +137,9 @@
if (degree == 0) {
LOG(WARNING) << "Trying to extract roots from a constant "
<< "polynomial in FindPolynomialRoots";
+ // We return true with no roots, not false, as if the polynomial is constant
+ // it is correct that there are no roots. It is not the case that they were
+ // there, but that we have failed to extract them.
return true;
}