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

misleading convergence message for SAMIN

Open mcreel opened this issue 4 years ago • 1 comments

The convergence message for SAMIN is misleading. An example is

using Optim
rosenbrock(x, p) =  (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2

function main()
x0 = zeros(2)
p  = [1.0, 100.0]
obj = x -> rosenbrock(x,p)
lb = fill(-100., 2)
ub = fill(100., 2)
prob = Optim.optimize(obj, lb, ub, x0, SAMIN(), Optim.Options(iterations=10^6))
end
main()

This code results in

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

     Obj. value:      0.0000000000

       parameter      search width
         1.00000           0.00000 
         1.00000           0.00000 
================================================================================

  0.315491 seconds (964.68 k allocations: 52.287 MiB, 47.06% gc time, 97.00% compilation time)
 * Status: failure

followed by additional output. The convergence criteria that Optim is checking are not directly applicable to the results that SAMIN generates. This output is for a successful run, but Optim is stating that it is a failure.

mcreel avatar Nov 07 '21 12:11 mcreel

I agree, that's poor wording. Thanks for reminding me.

pkofod avatar Feb 04 '22 10:02 pkofod