Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outer_x_abstol option ignored #1023

Open
soldasim opened this issue Dec 3, 2022 · 1 comment
Open

outer_x_abstol option ignored #1023

soldasim opened this issue Dec 3, 2022 · 1 comment

Comments

@soldasim
Copy link

soldasim commented Dec 3, 2022

Hello,

It seems that the outer_x_abstol option is ingored by Optim.

Consider the mwe below.

using Optim

function test()
    f(x) = exp(x[1]) * sin(x[2]) * cos(x[3])
    domain = ([0.,0.,0.], [20.,20.,20.])

    show_trace=false
    # Optim.optimize(f, domain..., [15.,15.,15.], Fminbox(LBFGS()), Optim.Options(; outer_iterations=20, show_trace))
    Optim.optimize(f, domain..., [15.,15.,15.], Fminbox(LBFGS()), Optim.Options(; outer_x_abstol=1., outer_iterations=20, show_trace))
    # Optim.optimize(f, domain..., [15.,15.,15.], Fminbox(LBFGS()), Optim.Options(; outer_x_tol=1., outer_iterations=20, show_trace))
end

Both the version without any convergence measure and with the outer_x_abstol option give the following result:

julia> test()
 * Status: success

 * Candidate solution
    Final objective value:     -4.851652e+08

 * Found with
    Algorithm:     Fminbox with L-BFGS

 * Convergence measures
    |x - x'|               = 5.63e-11 ≰ 0.0e+00
    |x - x'|/|x'|          = 1.90e-12 ≰ 0.0e+00
    |f(x) - f(x')|         = 0.00e+00 ≤ 0.0e+00
    |f(x) - f(x')|/|f(x')| = 0.00e+00 ≤ 0.0e+00
    |g(x)|                 = 3.39e-03 ≰ 1.0e-08

 * Work counters
    Seconds run:   0  (vs limit Inf)
    Iterations:    7
    f(x) calls:    703
    ∇f(x) calls:   703

While the option with the outer_x_tol option gives:

julia> test()
 * Status: success

 * Candidate solution
    Final objective value:     -4.851652e+08

 * Found with
    Algorithm:     Fminbox with L-BFGS

 * Convergence measures
    |x - x'|               = 1.62e-05 ≰ 0.0e+00
    |x - x'|/|x'|          = 5.48e-07 ≰ 0.0e+00
    |f(x) - f(x')|         = 0.00e+00 ≤ 0.0e+00
    |f(x) - f(x')|/|f(x')| = 0.00e+00 ≤ 0.0e+00
    |g(x)|                 = 1.15e+00 ≰ 1.0e-08

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


I was under the impression that the outer_x_abstol and outer_x_tol options should be equivalent.

@pkofod
Copy link
Member

pkofod commented Dec 13, 2022

That looks suspicious, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants