LineSearches.jl icon indicating copy to clipboard operation
LineSearches.jl copied to clipboard

Not all line search methods work with Fminbox

Open timholy opened this issue 7 months ago • 0 comments

This is implicit in #81, but just to document it:

julia> using LineSearches, Optim

julia> f(x) = sum(abs2, x)
f (generic function with 1 method)

julia> optimize(f, [0.5], [1.5], [1.0], Fminbox(LBFGS(linesearch=LineSearches.MoreThuente())); autodiff=:forward)
┌ Warning: Terminated early due to NaN in gradient.
└ @ Optim ~/.julia/packages/Optim/ZhuZN/src/multivariate/optimize/optimize.jl:98
 * Status: failure

 * Candidate solution
    Final objective value:     NaN

 * Found with
    Algorithm:     Fminbox with L-BFGS

 * Convergence measures
    |x - x'|               = NaN ≰ 0.0e+00
    |x - x'|/|x'|          = NaN ≰ 0.0e+00
    |f(x) - f(x')|         = 0.00e+00 ≤ 0.0e+00
    |f(x) - f(x')|/|f(x')| = NaN ≰ 0.0e+00
    |g(x)|                 = NaN ≰ 1.0e-08

 * Work counters
    Seconds run:   1  (vs limit Inf)
    Iterations:    2
    f(x) calls:    28
    ∇f(x) calls:   28

timholy avatar Jul 30 '24 17:07 timholy