(L-)BFGS for a user-defined function

No, it works, in principle, on any function. If it is differentiable, as mentioned above, you might want to provide the manually computed gradient or use an automatic differentiation package. If your function is not differentiable, other methods exist that will probably perform better than L-BFGS.

4 Likes