Optim.jl
Optim.jl copied to clipboard
misleading convergence message for SAMIN
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.
I agree, that's poor wording. Thanks for reminding me.