NLopt returning :FAILURE, but only with :LD_LBFGS

I’m minimizing a GMM criterion function (uses a lot of data, so a MWE here would be tricky) using NLopt and I keep getting a return code of :FAILURE after a few iterations whenever I use :LD_LBFGS. I don’t think this is a problem with computing the gradient, as I can use other LD class solvers without issue (so far I’ve tested :LD_TNEWTON, :LD_MMA, :LD_SLSQP, and :LD_CCSAQ). Since this seems to be a method-specific issue, does anyone have any insight as to what could be causing this problem?

Try solving the problem with a different solution method, then use that solution as the starting point for :LD_LBFGS. Does it still fail? You could also print out the points at which it is trying to evaluate the gradient. Is it always defined? How did you compute the gradients? Try with an AD package like ForwardDiff if you haven’t already.

It’s hard to offer other advice without a MWE.

1 Like