JuliaNLSolvers / Optim.jl

Optimization functions for Julia
Other
1.12k stars 217 forks source link

What is Optim's mechanism for calculating the gradient? #1065

Open Li-shiyue opened 8 months ago

Li-shiyue commented 8 months ago

When using the LBFGS algorithm within Fminbox, what is Optim's mechanism for calculating the gradient if there is no gradient vector for a given objective function? Can you give a detailed description?

pkofod commented 8 months ago

It depends on whether you choose an ad algorithm or not. If you do not, it's finite differencing. See some more information here https://julianlsolvers.github.io/Optim.jl/dev/user/gradientsandhessians/ . Does that answer your question?