-
Notifications
You must be signed in to change notification settings - Fork 230
Open
Description
Issue
Optimizing a function which returns Inf at one of the vertices causes the Nelder-Mead solver to stop prematurely without giving a proper reason for its termination. I did not encounter this issue in previous versions of Optim, where Inf was a valid function output.
Example
using Optim, LinearAlgebra
function test(x)
if norm(x) > 1
return Inf
else
return sum(x)
end
end
res = optimize(x -> begin; y = test(x); println(y); y; end, [0.7, 0.3], NelderMead(), Optim.Options(show_trace=true))
foreach((key, value) -> println("$key: $value"), keys(res.stopped_by), values(res.stopped_by))
println("Termination code: $(res.termination_code)")
Versions
Julia v1.12.4
Optim v2.0.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels