JuliaNLSolvers / Optim.jl

Optimization functions for Julia
Other
1.12k stars 217 forks source link

add time-limit for univariate optimizers #949

Open davidschlegel opened 3 years ago

davidschlegel commented 3 years ago

Currently, Brent's method and GoldenSection only support a maximum number of iteration as a finite stopping criterium. Currently, the signature of both these methods are:

function optimize(
        f, x_lower::T, x_upper::T,
        mo::Function;
        rel_tol::T = sqrt(eps(T)),
        abs_tol::T = eps(T),
        iterations::Integer = 1_000,
        store_trace::Bool = false,
        show_trace::Bool = false,
        callback = nothing,
        show_every = 1,
        extended_trace::Bool = false) where T <: AbstractFloat

It would be very important to add also a time limit.

pkofod commented 2 years ago

That would be consistent with multivariate optimizaiton, yes.

christianhauschel commented 6 months ago

I'd love to have this too

pkofod commented 6 months ago

Would you be up to try to implement it? I don't think it should be that hard. You can just mimic it for multivariate.