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

Convergence of SAMIN is converted to non-convergence.

Open sgaure opened this issue 1 year ago • 0 comments

using Optim

f(x) = cos(prod(x)) + (sum(x)-0.5)^2

opt = Optim.optimize(f, [-pi,-pi], [pi,pi], [0.3,0.4], SAMIN(verbosity=1),
               Optim.Options(iterations=1000000))

yields "normal convergence" from SAMIN, but convergence failure from optimize:

================================================================================
SAMIN results
==> Normal convergence <==
total number of objective function evaluations: 15001

     Obj. value:     -1.0000000000

       parameter      search width
        -1.54000           0.00000 
         2.04000           0.00000 
================================================================================

 * Status: failure

 * Candidate solution
    Final objective value:     -1.000000e+00

 * Found with
    Algorithm:     SAMIN

 * Convergence measures
    |x - x'|               = 8.88e-07 ≤ 1.0e-06
    |x - x'|/|x'|          = NaN ≰ 0.0e+00
    |f(x) - f(x')|         = 5.83e-13 ≤ 1.0e-12
    |f(x) - f(x')|/|f(x')| = NaN ≰ 0.0e+00
    |g(x)|                 = NaN ≰ 0.0e+00

 * Work counters
    Seconds run:   0  (vs limit Inf)
    Iterations:    15001
    f(x) calls:    15001
    ∇f(x) calls:   0
[429524aa] Optim v1.9.4
v"1.11.0-beta2"

sgaure avatar Jul 22 '24 09:07 sgaure