Open jlbosse opened 1 year ago
Hm, I see... Yes we could consider considering NaN as a signal of "unset" for zero order methods, but the only problem is: what if the convergence measure for nelder mead is actually NaN because of a problematic calculation? I suppose a problem here is that NelderMead should have used something else than "g" from the beginning.
I am implementing my own
ZerothOrderOptimizer
and have the suspicion thathttps://github.com/JuliaNLSolvers/Optim.jl/blob/38cfbe895dc8126ae029c5d3165d92b6232f3bd4/src/api.jl#L87
should be
instead. Note that for non-differentiable functions
g_residual(d)
is defined ashttps://github.com/JuliaNLSolvers/Optim.jl/blob/38cfbe895dc8126ae029c5d3165d92b6232f3bd4/src/utilities/assess_convergence.jl#L14
so that for such functions
res.g_residual
will always beNan
(see https://github.com/JuliaNLSolvers/Optim.jl/blob/38cfbe895dc8126ae029c5d3165d92b6232f3bd4/src/multivariate/optimize/optimize.jl#L110)and thus the success message printed by
https://github.com/JuliaNLSolvers/Optim.jl/blob/38cfbe895dc8126ae029c5d3165d92b6232f3bd4/src/types.jl#L238
will always be "failure", even if
x_converged
orf_converged
aretrue