yixuan / LBFGSpp

A header-only C++ library for L-BFGS and L-BFGS-B algorithms
https://lbfgspp.statr.me/
MIT License
532 stars 101 forks source link

Line Search throws increasing search direction exception #15

Closed JonasZehn closed 2 years ago

JonasZehn commented 3 years ago

Hi,

I was testing the LBFGSB code with the default LineSearchMoreThuente and it throws with throw std::logic_error("the moving direction does not decrease the objective function value") (on line 198 in LineSearchMoreThuente.h). I think it is because dg_init is computed using the gradient instead of the projected gradient? I attached the test case.

main.txt

JonasZehn commented 3 years ago

Ok, the reason might be a different one than I suggested, the search direction after subspace_minimize just seems to be ascending and it doesn't have to do anything with the gradient being projected or not.