SciML / SciML/Optimization.jl

"The algorithm NOMADOpt does not support callbacks"

Open
#492 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
839
Forks
100
Avg merge
20h 43m
Merged PRs (30d)
38

Description

I try to run an optimization (using a callback to save the evaluations) with the NOMAD package. However, it does not seem to support callbacks:

solve(optprob, NOMADOpt(); maxtime=10, callback=cb)

produces error:

ERROR: The algorithm NOMADOpt does not support callbacks, remove the `callback` keyword argument from the `solve` call.
Stacktrace:
 [1] #_check_opt_alg#553
   @ ~/.julia/packages/SciMLBase/zXEYU/src/solve.jl:98 [inlined]
 [2] solve(::SciMLBase.OptimizationProblem{true, OptimizationFunction{true,Optimization.AutoForwardDiff{nothing},…}, Vector{Float64}, SciMLBase.NullParameters, Vector{Float64}, Vector{Float64}, Nothing, Nothing, Nothing, Nothing, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::NOMADOpt; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:maxtime, :callback), Tuple{Int64, typeof(cb)}}})
   @ SciMLBase ~/.julia/packages/SciMLBase/zXEYU/src/solve.jl:84
 [3] top-level scope
   @ ~/Activate-CRN-Learning/playground.jl:89

Not sure if this is something that could be implemented? Alternatively, maybe the "Overview of the Optimizers" table could note which optimizers supports callbacks and which do not?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SciMLBase solve.jl _check_opt_alg path shown in the stack trace and inspect how NOMADOpt is represented in the Optimization.jl interface. Determine whether callback support can be implemented or whether the Overview of the Optimizers table should document this limitation. Done means callback behavior is supported or the optimizer's callback capability is clearly recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.