From 7aef715e1a4bda8c83abccc582efba21f83d4f19 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Wed, 27 Dec 2023 23:50:33 -0500 Subject: [PATCH 01/16] Add OptimizationStats and OptimizationState --- lib/OptimizationBBO/src/OptimizationBBO.jl | 13 ++++++++---- src/stats_state.jl | 24 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 src/stats_state.jl diff --git a/lib/OptimizationBBO/src/OptimizationBBO.jl b/lib/OptimizationBBO/src/OptimizationBBO.jl index e3c892111..c4607637d 100644 --- a/lib/OptimizationBBO/src/OptimizationBBO.jl +++ b/lib/OptimizationBBO/src/OptimizationBBO.jl @@ -115,7 +115,10 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{ if cache.callback === Optimization.DEFAULT_CALLBACK cb_call = false else - cb_call = cache.callback(decompose_trace(trace, cache.progress), x...) + n_steps = BlackBoxOptim.num_steps(trace) + curr_u = decompose_trace(trace, cache.progress) + state = Optimization.OptimizationState(iterations = n_steps, u = curr_u, objective = x[1], solver_state = trace) + cb_call = cache.callback(curr_u, x..., state) end if !(cb_call isa Bool) @@ -175,11 +178,13 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{ t1 = time() opt_ret = Symbol(opt_res.stop_reason) - + stats = Optimization.OptimizationStats(opt_res.num_steps, t1 - t0, BlackBoxOptim.num_func_evals(opt_res)) SciMLBase.build_solution(cache, cache.opt, BlackBoxOptim.best_candidate(opt_res), - BlackBoxOptim.best_fitness(opt_res); original = opt_res, - retcode = opt_ret, solve_time = t1 - t0) + BlackBoxOptim.best_fitness(opt_res); + original = opt_res, + retcode = opt_ret, + stats = stats) end end diff --git a/src/stats_state.jl b/src/stats_state.jl new file mode 100644 index 000000000..2903b4a42 --- /dev/null +++ b/src/stats_state.jl @@ -0,0 +1,24 @@ + +struct OptimizationStats + iterations::Int + time::Float64 + fevals::Int + gevals::Int + hevals::Int +end + +OptimizationStats(; iterations = 0, time = 0.0, fevals = 0, gevals = 0, hevals = 0) = + OptimizationStats(iterations, time, fevals, gevals, hevals) + +struct OptimizationState{X, O, G, H, S} + iteration::Int + u::X + objective::O + gradient::G + hessian::H + solver_state::S +end + +OptimizationState(; iterations = 0, u = nothing, objective = nothing, + gradient = nothing, hessian = nothing, solver_state = nothing) = + OptimizationState(iterations, u, objective, gradient, hessian, solver_state) From ee14dcb82074038a825964895c9a13ceb2db00c5 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Tue, 2 Jan 2024 19:59:00 -0500 Subject: [PATCH 02/16] Correct field name and two more subpackages processed --- lib/OptimizationBBO/src/OptimizationBBO.jl | 4 ++-- lib/OptimizationBBO/test/runtests.jl | 4 ++-- .../src/OptimizationCMAEvolutionStrategy.jl | 15 ++++++++++----- .../test/runtests.jl | 8 ++++++++ .../src/OptimizationEvolutionary.jl | 7 ++++++- lib/OptimizationEvolutionary/test/runtests.jl | 8 ++++++++ src/Optimization.jl | 1 + src/stats_state.jl | 4 ++-- 8 files changed, 39 insertions(+), 12 deletions(-) diff --git a/lib/OptimizationBBO/src/OptimizationBBO.jl b/lib/OptimizationBBO/src/OptimizationBBO.jl index c4607637d..4f39f445c 100644 --- a/lib/OptimizationBBO/src/OptimizationBBO.jl +++ b/lib/OptimizationBBO/src/OptimizationBBO.jl @@ -117,8 +117,8 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{ else n_steps = BlackBoxOptim.num_steps(trace) curr_u = decompose_trace(trace, cache.progress) - state = Optimization.OptimizationState(iterations = n_steps, u = curr_u, objective = x[1], solver_state = trace) - cb_call = cache.callback(curr_u, x..., state) + state = Optimization.OptimizationState(iteration = n_steps, u = curr_u, objective = x[1], solver_state = trace) + cb_call = cache.callback(state, x...) end if !(cb_call isa Bool) diff --git a/lib/OptimizationBBO/test/runtests.jl b/lib/OptimizationBBO/test/runtests.jl index 8eb03bc8c..bd703f0f5 100644 --- a/lib/OptimizationBBO/test/runtests.jl +++ b/lib/OptimizationBBO/test/runtests.jl @@ -25,8 +25,8 @@ using Test @test 10 * sol.objective < l1 fitness_progress_history = [] - function cb(best_candidate, fitness) - push!(fitness_progress_history, [best_candidate, fitness]) + function cb(state, fitness) + push!(fitness_progress_history, [state.u, fitness]) return false end sol = solve(prob, BBO_adaptive_de_rand_1_bin_radiuslimited(), callback = cb) diff --git a/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl b/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl index 3a48e70b5..af456aee7 100644 --- a/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl +++ b/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl @@ -9,7 +9,6 @@ export CMAEvolutionStrategyOpt struct CMAEvolutionStrategyOpt end SciMLBase.allowsbounds(::CMAEvolutionStrategyOpt) = true -SciMLBase.allowscallback(::CMAEvolutionStrategyOpt) = false #looks like `logger` kwarg can be used to pass it, so should be implemented SciMLBase.supports_opt_cache_interface(opt::CMAEvolutionStrategyOpt) = true function __map_optimizer_args(prob::OptimizationCache, opt::CMAEvolutionStrategyOpt; @@ -23,7 +22,7 @@ function __map_optimizer_args(prob::OptimizationCache, opt::CMAEvolutionStrategy end mapped_args = (; lower = prob.lb, - upper = prob.ub) + upper = prob.ub, logger = CMAEvolutionStrategy.BasicLogger(prob.u0; verbosity = 0, callback = callback)) if !isnothing(maxiters) mapped_args = (; mapped_args..., maxiter = maxiters) @@ -74,12 +73,18 @@ function SciMLBase.__solve(cache::OptimizationCache{ cur, state = iterate(cache.data) - function _cb(trace) - cb_call = cache.callback(decompose_trace(trace).metadata["x"], trace.value...) + function _cb(opt, y, fvals, perm) + curr_u = opt.logger.xbest[end] + opt_state = Optimization.OptimizationState(; iteration = length(opt.logger.fmedian), + u = curr_u, + objective = opt.logger.fbest[end], + solver_state = opt.logger) + + cb_call = cache.callback(opt_state, x...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process.") end - cur, state = iterate(data, state) + cur, state = iterate(cache.data, state) cb_call end diff --git a/lib/OptimizationCMAEvolutionStrategy/test/runtests.jl b/lib/OptimizationCMAEvolutionStrategy/test/runtests.jl index dafafa5d8..3515e8ab9 100644 --- a/lib/OptimizationCMAEvolutionStrategy/test/runtests.jl +++ b/lib/OptimizationCMAEvolutionStrategy/test/runtests.jl @@ -10,4 +10,12 @@ using Test prob = OptimizationProblem(f, x0, _p, lb = [-1.0, -1.0], ub = [0.8, 0.8]) sol = solve(prob, CMAEvolutionStrategyOpt()) @test 10 * sol.objective < l1 + + function cb(state, args...) + if state.iteration %10 == 0 + println(state.u) + end + return false + end + sol = solve(prob, CMAEvolutionStrategyOpt(), callback = cb, maxiters = 100) end diff --git a/lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl b/lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl index 62228bc8f..581709dcb 100644 --- a/lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl +++ b/lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl @@ -84,7 +84,12 @@ function SciMLBase.__solve(cache::OptimizationCache{ cur, state = iterate(cache.data) function _cb(trace) - cb_call = cache.callback(decompose_trace(trace).metadata["x"], trace.value...) + curr_u = decompose_trace(trace).metadata["x"][end] + opt_state = Optimization.OptimizationState(; iteration = decompose_trace(trace).iteration, + u = curr_u, + objective = x[1], + solver_state = trace) + cb_call = cache.callback(opt_state, trace.value...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process.") end diff --git a/lib/OptimizationEvolutionary/test/runtests.jl b/lib/OptimizationEvolutionary/test/runtests.jl index f56e894ed..384590e80 100644 --- a/lib/OptimizationEvolutionary/test/runtests.jl +++ b/lib/OptimizationEvolutionary/test/runtests.jl @@ -34,4 +34,12 @@ Random.seed!(1234) res = zeros(1) cons_circ(res, sol.u, nothing) @test sol.objective < l1 + + function cb(state, args...) + if state.iteration %100 == 0 + println(state.u) + end + return false + end + sol = solve(prob, CMAES(μ = 40, λ = 100), callback = cb, maxiters = 100) end diff --git a/src/Optimization.jl b/src/Optimization.jl index 5de0e3e24..210f08ed8 100644 --- a/src/Optimization.jl +++ b/src/Optimization.jl @@ -24,6 +24,7 @@ include("utils.jl") include("function.jl") include("adtypes.jl") include("cache.jl") +include("stats_state.jl") export solve, OptimizationCache diff --git a/src/stats_state.jl b/src/stats_state.jl index 2903b4a42..1706a5a2c 100644 --- a/src/stats_state.jl +++ b/src/stats_state.jl @@ -19,6 +19,6 @@ struct OptimizationState{X, O, G, H, S} solver_state::S end -OptimizationState(; iterations = 0, u = nothing, objective = nothing, +OptimizationState(; iteration = 0, u = nothing, objective = nothing, gradient = nothing, hessian = nothing, solver_state = nothing) = - OptimizationState(iterations, u, objective, gradient, hessian, solver_state) + OptimizationState(iteration, u, objective, gradient, hessian, solver_state) From a362234d9dec5f2cd565b2770b316d5b05ec6f4d Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Wed, 3 Jan 2024 13:09:30 -0500 Subject: [PATCH 03/16] flux up --- lib/OptimizationEvolutionary/test/runtests.jl | 2 +- lib/OptimizationFlux/src/OptimizationFlux.jl | 12 ++++++++++-- lib/OptimizationFlux/test/runtests.jl | 8 ++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/OptimizationEvolutionary/test/runtests.jl b/lib/OptimizationEvolutionary/test/runtests.jl index 384590e80..46f00d0a6 100644 --- a/lib/OptimizationEvolutionary/test/runtests.jl +++ b/lib/OptimizationEvolutionary/test/runtests.jl @@ -36,7 +36,7 @@ Random.seed!(1234) @test sol.objective < l1 function cb(state, args...) - if state.iteration %100 == 0 + if state.iteration %10 == 0 println(state.u) end return false diff --git a/lib/OptimizationFlux/src/OptimizationFlux.jl b/lib/OptimizationFlux/src/OptimizationFlux.jl index f3ab87a83..2066aa646 100644 --- a/lib/OptimizationFlux/src/OptimizationFlux.jl +++ b/lib/OptimizationFlux/src/OptimizationFlux.jl @@ -65,7 +65,11 @@ function SciMLBase.__solve(cache::OptimizationCache{ for (i, d) in enumerate(data) cache.f.grad(G, θ, d...) x = cache.f(θ, cache.p, d...) - cb_call = cache.callback(θ, x...) + opt_state = Optimization.OptimizationState(; iteration = i, + u = θ, + objective = x[1], + solver_state = opt) + cb_call = cache.callback(opt_state, x...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process. Please see the sciml_train documentation for information.") elseif cb_call @@ -84,7 +88,11 @@ function SciMLBase.__solve(cache::OptimizationCache{ opt = min_opt x = min_err θ = min_θ - cache.callback(θ, x...) + opt_state = Optimization.OptimizationState(; iteration = i, + u = θ, + objective = x[1], + solver_state = opt) + cache.callback(opt_state, x...) break end end diff --git a/lib/OptimizationFlux/test/runtests.jl b/lib/OptimizationFlux/test/runtests.jl index 90857c647..3ca49a562 100644 --- a/lib/OptimizationFlux/test/runtests.jl +++ b/lib/OptimizationFlux/test/runtests.jl @@ -34,4 +34,12 @@ using Test sol = Optimization.solve!(cache) @test sol.u≈[2.0] atol=1e-3 end + + function cb(state, args...) + if state.iteration % 10 == 0 + println(state.u) + end + return false + end + sol = solve(prob, Flux.Adam(0.1), callback = cb, maxiters = 100, progress = false) end From ab1f6552b96eb5d906da820bffc02042160facf1 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Wed, 3 Jan 2024 15:47:42 -0500 Subject: [PATCH 04/16] More subpkgs --- lib/OptimizationBBO/src/OptimizationBBO.jl | 4 ++-- lib/OptimizationMOI/src/OptimizationMOI.jl | 4 ---- lib/OptimizationMOI/src/nlp.jl | 6 +++++- lib/OptimizationMOI/test/runtests.jl | 5 +---- .../src/OptimizationMultistartOptimization.jl | 1 + .../src/OptimizationNLopt.jl | 3 ++- .../src/OptimizationOptimJL.jl | 18 ++++++++---------- .../src/OptimizationOptimisers.jl | 9 ++++++--- lib/OptimizationOptimisers/src/sophia.jl | 19 +++++-------------- .../src/OptimizationPRIMA.jl | 3 ++- 10 files changed, 32 insertions(+), 40 deletions(-) diff --git a/lib/OptimizationBBO/src/OptimizationBBO.jl b/lib/OptimizationBBO/src/OptimizationBBO.jl index 4f39f445c..a43dfd697 100644 --- a/lib/OptimizationBBO/src/OptimizationBBO.jl +++ b/lib/OptimizationBBO/src/OptimizationBBO.jl @@ -117,8 +117,8 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{ else n_steps = BlackBoxOptim.num_steps(trace) curr_u = decompose_trace(trace, cache.progress) - state = Optimization.OptimizationState(iteration = n_steps, u = curr_u, objective = x[1], solver_state = trace) - cb_call = cache.callback(state, x...) + opt_state = Optimization.OptimizationState(iteration = n_steps, u = curr_u, objective = x[1], solver_state = trace) + cb_call = cache.callback(opt_state, x...) end if !(cb_call isa Bool) diff --git a/lib/OptimizationMOI/src/OptimizationMOI.jl b/lib/OptimizationMOI/src/OptimizationMOI.jl index 1fa49d1c9..cefcf33e7 100644 --- a/lib/OptimizationMOI/src/OptimizationMOI.jl +++ b/lib/OptimizationMOI/src/OptimizationMOI.jl @@ -23,10 +23,6 @@ function SciMLBase.allowsconstraints(opt::Union{MOI.AbstractOptimizer, MOI.OptimizerWithAttributes}) true end -# function SciMLBase.allowscallback(opt::Union{MOI.AbstractOptimizer, -# MOI.OptimizerWithAttributes}) -# false -# end function _create_new_optimizer(opt::MOI.OptimizerWithAttributes) return _create_new_optimizer(MOI.instantiate(opt, with_bridge_type = Float64)) diff --git a/lib/OptimizationMOI/src/nlp.jl b/lib/OptimizationMOI/src/nlp.jl index 2c4d410c3..10aa338a7 100644 --- a/lib/OptimizationMOI/src/nlp.jl +++ b/lib/OptimizationMOI/src/nlp.jl @@ -15,6 +15,7 @@ mutable struct MOIOptimizationNLPEvaluator{T, F <: OptimizationFunction, RC, LB, H::HT cons_H::Vector{CHT} callback::CB + iteration::Int obj_expr::Union{Expr, Nothing} cons_expr::Union{Vector{Expr}, Nothing} end @@ -183,6 +184,7 @@ function MOIOptimizationNLPCache(prob::OptimizationProblem, H, cons_H, callback, + 0, expr, _cons_expr) return MOIOptimizationNLPCache(evaluator, opt, NamedTuple(kwargs)) @@ -215,7 +217,9 @@ function MOI.eval_objective(evaluator::MOIOptimizationNLPEvaluator, x) return evaluator.f(x, evaluator.p) else l = evaluator.f(x, evaluator.p) - evaluator.callback(x, l) + evaluator.iteration += 1 + state = Optimization.OptimizationState(iteration = evaluator.iteration, u = x, objective = l[1]) + evaluator.callback(state, l) return l end end diff --git a/lib/OptimizationMOI/test/runtests.jl b/lib/OptimizationMOI/test/runtests.jl index 75386710e..76cff1658 100644 --- a/lib/OptimizationMOI/test/runtests.jl +++ b/lib/OptimizationMOI/test/runtests.jl @@ -36,11 +36,8 @@ end optprob = OptimizationFunction((x, p) -> -rosenbrock(x, p), Optimization.AutoZygote()) prob = OptimizationProblem(optprob, x0, _p; sense = Optimization.MaxSense) - global iter = 0 - callback = function (p, l) - global iter - iter += 1 + callback = function (state, l) display(l) return false end diff --git a/lib/OptimizationMultistartOptimization/src/OptimizationMultistartOptimization.jl b/lib/OptimizationMultistartOptimization/src/OptimizationMultistartOptimization.jl index b385529ef..c0282a089 100644 --- a/lib/OptimizationMultistartOptimization/src/OptimizationMultistartOptimization.jl +++ b/lib/OptimizationMultistartOptimization/src/OptimizationMultistartOptimization.jl @@ -6,6 +6,7 @@ using Optimization.SciMLBase SciMLBase.requiresbounds(opt::MultistartOptimization.TikTak) = true SciMLBase.allowsbounds(opt::MultistartOptimization.TikTak) = true +SciMLBase.allowscallback(opt::MultistartOptimization.TikTak) = false SciMLBase.supports_opt_cache_interface(opt::MultistartOptimization.TikTak) = true function SciMLBase.__init(prob::SciMLBase.OptimizationProblem, diff --git a/lib/OptimizationNLopt/src/OptimizationNLopt.jl b/lib/OptimizationNLopt/src/OptimizationNLopt.jl index 456a08e11..ba4f893aa 100644 --- a/lib/OptimizationNLopt/src/OptimizationNLopt.jl +++ b/lib/OptimizationNLopt/src/OptimizationNLopt.jl @@ -136,7 +136,8 @@ function SciMLBase.__solve(cache::OptimizationCache{ _loss = function (θ) x = cache.f(θ, cache.p) - if cache.callback(θ, x...) + opt_state = Optimization.OptimizationState(u = θ, objective = x[1]) + if cache.callback(opt_state, x...) error("Optimization halted by callback.") end return x[1] diff --git a/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl b/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl index da0ddbb53..a3191b17d 100644 --- a/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl +++ b/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl @@ -133,10 +133,9 @@ function SciMLBase.__solve(cache::OptimizationCache{ error("Use OptimizationFunction to pass the derivatives or automatically generate them with one of the autodiff backends") function _cb(trace) - cb_call = cache.opt isa Optim.NelderMead ? - cache.callback(decompose_trace(trace).metadata["centroid"], - x...) : - cache.callback(decompose_trace(trace).metadata["x"], x...) + θ = cache.opt isa Optim.NelderMead ? decompose_trace(trace).metadata["centroid"] : decompose_trace(trace).metadata["x"] + opt_state = Optimization.OptimizationState(iteration = i, u = θ, objective = x[1], solver_state = trace) + cb_call = cache.callback(opt_state, x...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process.") end @@ -149,7 +148,6 @@ function SciMLBase.__solve(cache::OptimizationCache{ end end - println(cache.sense) _loss = function (θ) x = cache.f.f(θ, cache.p, cur...) __x = first(x) @@ -248,10 +246,9 @@ function SciMLBase.__solve(cache::OptimizationCache{ cur, state = iterate(cache.data) function _cb(trace) - cb_call = !(cache.opt isa Optim.SAMIN) && cache.opt.method == Optim.NelderMead() ? - cache.callback(decompose_trace(trace).metadata["centroid"], - x...) : - cache.callback(decompose_trace(trace).metadata["x"], x...) + θ = !(cache.opt isa Optim.SAMIN) && cache.opt.method == Optim.NelderMead() ? decompose_trace(trace).metadata["centroid"] : decompose_trace(trace).metadata["x"] + opt_state = Optimization.OptimizationState(iteration = i, u = θ, objective = x[1], solver_state = trace) + cb_call = cache.callback(opt_state, x...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process.") end @@ -332,7 +329,8 @@ function SciMLBase.__solve(cache::OptimizationCache{ cur, state = iterate(cache.data) function _cb(trace) - cb_call = cache.callback(decompose_trace(trace).metadata["x"], x...) + opt_state = Optimization.OptimizationState(iteration = trace.iteration, u = decompose_trace(trace).metadata["x"], objective = x[1], solver_state = trace) + cb_call = cache.callback(opt_state, x...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process.") end diff --git a/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl b/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl index 8086b97a5..afcd08d75 100644 --- a/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl +++ b/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl @@ -63,8 +63,9 @@ function SciMLBase.__solve(cache::OptimizationCache{ Optimization.@withprogress cache.progress name="Training" begin for (i, d) in enumerate(data) cache.f.grad(G, θ, d...) - x = (cache.f(θ, cache.p, d...), state, i) - cb_call = cache.callback(θ, x...) + x = cache.f(θ, cache.p, d...) + opt_state = Optimization.OptimizationState(iteration = i, u = θ, objective = x[1], gradient = G, solver_state = state) + cb_call = cache.callback(opt_state, x...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process. Please see the `solve` documentation for information.") elseif cb_call @@ -83,7 +84,9 @@ function SciMLBase.__solve(cache::OptimizationCache{ opt = min_opt x = min_err θ = min_θ - cache.callback(θ, x...) + cache.f.grad(G, θ, d...) + opt_state = Optimization.OptimizationState(iteration = i, u = θ, objective = x[1], gradient = G, solver_state = state) + cache.callback(opt_state, x...) break end end diff --git a/lib/OptimizationOptimisers/src/sophia.jl b/lib/OptimizationOptimisers/src/sophia.jl index 66b209d26..4625418a4 100644 --- a/lib/OptimizationOptimisers/src/sophia.jl +++ b/lib/OptimizationOptimisers/src/sophia.jl @@ -70,20 +70,6 @@ function SciMLBase.__solve(cache::OptimizationCache{ maxiters = Optimization._check_and_convert_maxiters(maxiters) - _loss = function (θ) - if cache.callback === Optimization.DEFAULT_CALLBACK && - data === Optimization.DEFAULT_DATA - return first(cache.f(θ, cache.p)) - elseif cache.callback === Optimization.DEFAULT_CALLBACK - return first(cache.f(θ, cache.p, cur...)) - elseif data === Optimization.DEFAULT_DATA - x = cache.f(θ, cache.p) - return first(x) - else - x = cache.f(θ, cache.p, cur...) - return first(x) - end - end f = cache.f θ = copy(cache.u0) gₜ = zero(θ) @@ -92,6 +78,11 @@ function SciMLBase.__solve(cache::OptimizationCache{ for (i, d) in enumerate(data) f.grad(gₜ, θ, d...) x = cache.f(θ, cache.p, d...) + opt_state = Optimization.OptimizationState(; iteration = i, + u = θ, + objective = first(x), + gradient = gₜ, + solver_state = nothing) cb_call = cache.callback(θ, x...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process. Please see the sciml_train documentation for information.") diff --git a/lib/OptimizationPRIMA/src/OptimizationPRIMA.jl b/lib/OptimizationPRIMA/src/OptimizationPRIMA.jl index af88bde92..6386a1184 100644 --- a/lib/OptimizationPRIMA/src/OptimizationPRIMA.jl +++ b/lib/OptimizationPRIMA/src/OptimizationPRIMA.jl @@ -120,7 +120,8 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{ } _loss = function (θ) x = cache.f(θ, cache.p) - if cache.callback(θ, x...) + opt_state = Optimization.OptimizationState(u = θ, objective = x[1]) + if cache.callback(opt_state, x...) error("Optimization halted by callback.") end return x[1] From d1d326a5e099747dd088157610a2a7899bb08c94 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Wed, 3 Jan 2024 21:36:34 -0500 Subject: [PATCH 05/16] optim i -> trace.iteration --- lib/OptimizationOptimJL/src/OptimizationOptimJL.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl b/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl index a3191b17d..7302d21b1 100644 --- a/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl +++ b/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl @@ -134,7 +134,7 @@ function SciMLBase.__solve(cache::OptimizationCache{ function _cb(trace) θ = cache.opt isa Optim.NelderMead ? decompose_trace(trace).metadata["centroid"] : decompose_trace(trace).metadata["x"] - opt_state = Optimization.OptimizationState(iteration = i, u = θ, objective = x[1], solver_state = trace) + opt_state = Optimization.OptimizationState(iteration = trace.iteration, u = θ, objective = x[1], solver_state = trace) cb_call = cache.callback(opt_state, x...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process.") @@ -247,7 +247,7 @@ function SciMLBase.__solve(cache::OptimizationCache{ function _cb(trace) θ = !(cache.opt isa Optim.SAMIN) && cache.opt.method == Optim.NelderMead() ? decompose_trace(trace).metadata["centroid"] : decompose_trace(trace).metadata["x"] - opt_state = Optimization.OptimizationState(iteration = i, u = θ, objective = x[1], solver_state = trace) + opt_state = Optimization.OptimizationState(iteration = trace.iteration, u = θ, objective = x[1], solver_state = trace) cb_call = cache.callback(opt_state, x...) if !(cb_call isa Bool) error("The callback should return a boolean `halt` for whether to stop the optimization process.") From 7e8bf0cf918c9484924ddd011bcd8910d846a8b3 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Wed, 3 Jan 2024 21:39:49 -0500 Subject: [PATCH 06/16] fix test optimisers --- lib/OptimizationOptimisers/test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OptimizationOptimisers/test/runtests.jl b/lib/OptimizationOptimisers/test/runtests.jl index c63e75db8..005bdc8d7 100644 --- a/lib/OptimizationOptimisers/test/runtests.jl +++ b/lib/OptimizationOptimisers/test/runtests.jl @@ -60,8 +60,8 @@ using Zygote optprob = OptimizationFunction(rosenbrock, Optimization.AutoZygote()) prob = OptimizationProblem(optprob, x0, _p) - function callback(θ, l, state, iter) - Optimisers.adjust!(state, 0.1/iter) + function callback(state, l) + Optimisers.adjust!(state.solver_state, 0.1/state.iter) return false end sol = solve(prob, Optimisers.Adam(0.1), maxiters = 1000, progress = false, callback = callback) From bf77f69c068965396af303cb635d398ea34fe1ea Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Wed, 3 Jan 2024 21:47:03 -0500 Subject: [PATCH 07/16] bbo fix --- lib/OptimizationBBO/src/OptimizationBBO.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OptimizationBBO/src/OptimizationBBO.jl b/lib/OptimizationBBO/src/OptimizationBBO.jl index a43dfd697..5590c79ad 100644 --- a/lib/OptimizationBBO/src/OptimizationBBO.jl +++ b/lib/OptimizationBBO/src/OptimizationBBO.jl @@ -178,7 +178,7 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{ t1 = time() opt_ret = Symbol(opt_res.stop_reason) - stats = Optimization.OptimizationStats(opt_res.num_steps, t1 - t0, BlackBoxOptim.num_func_evals(opt_res)) + stats = Optimization.OptimizationStats(opt_res.iterations, t1 - t0, opt_res.f_calls) SciMLBase.build_solution(cache, cache.opt, BlackBoxOptim.best_candidate(opt_res), BlackBoxOptim.best_fitness(opt_res); From 34bff4140d79959bf09532e4dd9e0a1b321e8c5f Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Wed, 3 Jan 2024 23:01:00 -0500 Subject: [PATCH 08/16] fix errs --- lib/OptimizationOptimisers/test/runtests.jl | 2 +- test/diffeqfluxtests.jl | 6 ++---- test/minibatch.jl | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/OptimizationOptimisers/test/runtests.jl b/lib/OptimizationOptimisers/test/runtests.jl index 005bdc8d7..01c5fc1d0 100644 --- a/lib/OptimizationOptimisers/test/runtests.jl +++ b/lib/OptimizationOptimisers/test/runtests.jl @@ -61,7 +61,7 @@ using Zygote prob = OptimizationProblem(optprob, x0, _p) function callback(state, l) - Optimisers.adjust!(state.solver_state, 0.1/state.iter) + Optimisers.adjust!(state.solver_state, 0.1/state.iteration) return false end sol = solve(prob, Optimisers.Adam(0.1), maxiters = 1000, progress = false, callback = callback) diff --git a/test/diffeqfluxtests.jl b/test/diffeqfluxtests.jl index 3bad4123c..ace9984e9 100644 --- a/test/diffeqfluxtests.jl +++ b/test/diffeqfluxtests.jl @@ -34,14 +34,12 @@ function loss_adjoint(p) end iter = 0 -callback = function (p, l, pred) - global iter - iter += 1 +callback = function (state, l, pred) display(l) # using `remake` to re-create our `prob` with current parameters `p` - remade_solution = solve(remake(prob_ode, p = p), Tsit5(), saveat = tsteps) + remade_solution = solve(remake(prob_ode, p = state.u), Tsit5(), saveat = tsteps) # Tell sciml_train to not halt the optimization. If return true, then # optimization stops. diff --git a/test/minibatch.jl b/test/minibatch.jl index 584b1d034..f75cf56f7 100644 --- a/test/minibatch.jl +++ b/test/minibatch.jl @@ -18,7 +18,7 @@ function dudt_(u, p, t) ann(u, p, st)[1] .* u end -callback = function (p, l, pred, args...; doplot = false) #callback function to observe training +callback = function (state, l, pred, args...; doplot = false) #callback function to observe training display(l) # plot current prediction against data if doplot From 94ed95ba4c3d333e294db8fe11ce672e5b23cadd Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Wed, 3 Jan 2024 23:34:31 -0500 Subject: [PATCH 09/16] Stats bbo --- lib/OptimizationBBO/src/OptimizationBBO.jl | 2 +- .../src/OptimizationCMAEvolutionStrategy.jl | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/OptimizationBBO/src/OptimizationBBO.jl b/lib/OptimizationBBO/src/OptimizationBBO.jl index 5590c79ad..e27b1c08f 100644 --- a/lib/OptimizationBBO/src/OptimizationBBO.jl +++ b/lib/OptimizationBBO/src/OptimizationBBO.jl @@ -178,7 +178,7 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{ t1 = time() opt_ret = Symbol(opt_res.stop_reason) - stats = Optimization.OptimizationStats(opt_res.iterations, t1 - t0, opt_res.f_calls) + stats = Optimization.OptimizationStats(; iterations = opt_res.iterations, time = t1 - t0, fevals = opt_res.f_calls) SciMLBase.build_solution(cache, cache.opt, BlackBoxOptim.best_candidate(opt_res), BlackBoxOptim.best_fitness(opt_res); diff --git a/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl b/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl index af456aee7..8fbffdfac 100644 --- a/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl +++ b/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl @@ -105,11 +105,12 @@ function SciMLBase.__solve(cache::OptimizationCache{ t1 = time() opt_ret = opt_res.stop.reason - + stats = Optimization.OptimizationStats(; iterations = length(opt.logger.fmedian), time = t1 - t0, fevals = length(opt.logger.fmedian)) SciMLBase.build_solution(cache, cache.opt, opt_res.logger.xbest[end], opt_res.logger.fbest[end]; original = opt_res, - retcode = opt_ret, solve_time = t1 - t0) + retcode = opt_ret, solve_time = t1 - t0, + stats = stats) end end From c66b15ed4ce2a7ddd94d5a9103f157019a3cc217 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Thu, 4 Jan 2024 16:33:33 -0500 Subject: [PATCH 10/16] Stats for all --- .../src/OptimizationCMAEvolutionStrategy.jl | 2 +- .../src/OptimizationEvolutionary.jl | 6 ++++-- lib/OptimizationFlux/src/OptimizationFlux.jl | 5 +++-- lib/OptimizationGCMAES/src/OptimizationGCMAES.jl | 8 +++++--- lib/OptimizationMOI/src/moi.jl | 4 +++- lib/OptimizationMOI/src/nlp.jl | 4 +++- .../src/OptimizationMetaheuristics.jl | 4 ++-- .../src/OptimizationMultistartOptimization.jl | 6 +++--- lib/OptimizationNLopt/src/OptimizationNLopt.jl | 3 ++- lib/OptimizationNOMAD/src/OptimizationNOMAD.jl | 4 ++-- .../src/OptimizationOptimJL.jl | 16 ++++++++++------ .../src/OptimizationOptimisers.jl | 5 +++-- lib/OptimizationPRIMA/src/OptimizationPRIMA.jl | 4 ++-- .../src/OptimizationQuadDIRECT.jl | 4 ++-- .../src/OptimizationSpeedMapping.jl | 4 ++-- 15 files changed, 47 insertions(+), 32 deletions(-) diff --git a/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl b/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl index 8fbffdfac..6867c39cf 100644 --- a/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl +++ b/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl @@ -109,7 +109,7 @@ function SciMLBase.__solve(cache::OptimizationCache{ SciMLBase.build_solution(cache, cache.opt, opt_res.logger.xbest[end], opt_res.logger.fbest[end]; original = opt_res, - retcode = opt_ret, solve_time = t1 - t0, + retcode = opt_ret, stats = stats) end diff --git a/lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl b/lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl index 581709dcb..070ad11a2 100644 --- a/lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl +++ b/lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl @@ -132,11 +132,13 @@ function SciMLBase.__solve(cache::OptimizationCache{ end t1 = time() opt_ret = Symbol(Evolutionary.converged(opt_res)) - + stats = Optimization.OptimizationStats(; iterations = opt_res.iterations + , time = t1 - t0, fevals = opt_res.f_calls) SciMLBase.build_solution(cache, cache.opt, Evolutionary.minimizer(opt_res), Evolutionary.minimum(opt_res); original = opt_res, - retcode = opt_ret, solve_time = t1 - t0) + retcode = opt_ret, + stats = stats) end end diff --git a/lib/OptimizationFlux/src/OptimizationFlux.jl b/lib/OptimizationFlux/src/OptimizationFlux.jl index 2066aa646..989346a38 100644 --- a/lib/OptimizationFlux/src/OptimizationFlux.jl +++ b/lib/OptimizationFlux/src/OptimizationFlux.jl @@ -101,8 +101,9 @@ function SciMLBase.__solve(cache::OptimizationCache{ end t1 = time() - - SciMLBase.build_solution(cache, opt, θ, x[1], solve_time = t1 - t0) + stats = Optimization.OptimizationStats(; iterations = i, + time = t1 - t0, fevals = i, gevals = i) + SciMLBase.build_solution(cache, opt, θ, x[1], stats = stats) # here should be build_solution to create the output message end diff --git a/lib/OptimizationGCMAES/src/OptimizationGCMAES.jl b/lib/OptimizationGCMAES/src/OptimizationGCMAES.jl index 0e4d1e0f0..11be7b9f2 100644 --- a/lib/OptimizationGCMAES/src/OptimizationGCMAES.jl +++ b/lib/OptimizationGCMAES/src/OptimizationGCMAES.jl @@ -29,7 +29,7 @@ function __map_optimizer_args(cache::OptimizationCache, opt::GCMAESOpt; end if !(isnothing(maxtime)) - @warn "common maxtime is currently not used by $(opt)" + mapped_args = (; mapped_args..., maxtime = maxtime) end if !isnothing(abstol) @@ -114,10 +114,12 @@ function SciMLBase.__solve(cache::OptimizationCache{ cache.ub; opt_args...) end t1 = time() - + stats = Optimization.OptimizationStats(; iterations = maxiters === nothing ? 0 : maxiters, + time = t1 - t0) SciMLBase.build_solution(cache, cache.opt, opt_xmin, opt_fmin; retcode = Symbol(Bool(opt_ret)), - solve_time = t1 - t0) + stats = stats + ) end end diff --git a/lib/OptimizationMOI/src/moi.jl b/lib/OptimizationMOI/src/moi.jl index a480814d6..a884e03b7 100644 --- a/lib/OptimizationMOI/src/moi.jl +++ b/lib/OptimizationMOI/src/moi.jl @@ -161,12 +161,14 @@ function SciMLBase.__solve(cache::MOIOptimizationCache) minimum = NaN opt_ret = SciMLBase.ReturnCode.Default end + stats = Optimization.OptimizationStats() return SciMLBase.build_solution(cache, cache.opt, minimizer, minimum; original = opt_setup, - retcode = opt_ret) + retcode = opt_ret, + stats = stats) end function get_moi_function(expr) diff --git a/lib/OptimizationMOI/src/nlp.jl b/lib/OptimizationMOI/src/nlp.jl index 10aa338a7..504799f39 100644 --- a/lib/OptimizationMOI/src/nlp.jl +++ b/lib/OptimizationMOI/src/nlp.jl @@ -473,10 +473,12 @@ function SciMLBase.__solve(cache::MOIOptimizationNLPCache) minimum = NaN opt_ret = SciMLBase.ReturnCode.Default end + stats = Optimization.OptimizationStats() return SciMLBase.build_solution(cache, cache.opt, minimizer, minimum; original = opt_setup, - retcode = opt_ret) + retcode = opt_ret, + stats = stats) end diff --git a/lib/OptimizationMetaheuristics/src/OptimizationMetaheuristics.jl b/lib/OptimizationMetaheuristics/src/OptimizationMetaheuristics.jl index 6b2f77304..cc3a4676e 100644 --- a/lib/OptimizationMetaheuristics/src/OptimizationMetaheuristics.jl +++ b/lib/OptimizationMetaheuristics/src/OptimizationMetaheuristics.jl @@ -139,11 +139,11 @@ function SciMLBase.__solve(cache::OptimizationCache{ t0 = time() opt_res = Metaheuristics.optimize(_loss, opt_bounds, cache.opt) t1 = time() - + stats = Optimization.OptimizationStats(; time = t1 - t0) SciMLBase.build_solution(cache, cache.opt, Metaheuristics.minimizer(opt_res), Metaheuristics.minimum(opt_res); original = opt_res, - solve_time = t1 - t0) + stats = stats) end end diff --git a/lib/OptimizationMultistartOptimization/src/OptimizationMultistartOptimization.jl b/lib/OptimizationMultistartOptimization/src/OptimizationMultistartOptimization.jl index c0282a089..6dd606fe7 100644 --- a/lib/OptimizationMultistartOptimization/src/OptimizationMultistartOptimization.jl +++ b/lib/OptimizationMultistartOptimization/src/OptimizationMultistartOptimization.jl @@ -69,13 +69,13 @@ function SciMLBase.__solve(cache::OptimizationCache{ use_threads = cache.solver_args.use_threads) t1 = time() opt_ret = hasproperty(opt_res, :ret) ? opt_res.ret : nothing - + stats = Optimization.OptimizationStats(; time = t1 - t0) SciMLBase.build_solution(cache, (cache.opt, cache.solver_args.local_opt), opt_res.location, opt_res.value; + stats = stats, (isnothing(opt_ret) ? (; original = opt_res) : - (; original = opt_res, retcode = opt_ret, - solve_time = t1 - t0))...) + (; original = opt_res, retcode = opt_ret,))...) end end diff --git a/lib/OptimizationNLopt/src/OptimizationNLopt.jl b/lib/OptimizationNLopt/src/OptimizationNLopt.jl index ba4f893aa..a7324e2c7 100644 --- a/lib/OptimizationNLopt/src/OptimizationNLopt.jl +++ b/lib/OptimizationNLopt/src/OptimizationNLopt.jl @@ -181,9 +181,10 @@ function SciMLBase.__solve(cache::OptimizationCache{ if retcode == ReturnCode.Failure @warn "NLopt failed to converge: $(ret)" end + stats = Optimization.OptimizationStats(; time = t1 - t0) SciMLBase.build_solution(cache, cache.opt, minx, minf; original = opt_setup, retcode = retcode, - solve_time = t1 - t0) + stats = stats) end end diff --git a/lib/OptimizationNOMAD/src/OptimizationNOMAD.jl b/lib/OptimizationNOMAD/src/OptimizationNOMAD.jl index 07d2eba93..aec326cd9 100644 --- a/lib/OptimizationNOMAD/src/OptimizationNOMAD.jl +++ b/lib/OptimizationNOMAD/src/OptimizationNOMAD.jl @@ -85,10 +85,10 @@ function SciMLBase.__solve(prob::OptimizationProblem, opt::NOMADOpt; t0 = time() opt_res = NOMAD.solve(opt_setup, prob.u0) t1 = time() - + stats = Optimization.OptimizationStats(; time = t1 - t0) SciMLBase.build_solution(SciMLBase.DefaultOptimizationCache(prob.f, prob.p), opt, opt_res.x_best_feas, first(opt_res.bbo_best_feas); - original = opt_res, solve_time = t1 - t0) + original = opt_res, stats = stats) end end diff --git a/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl b/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl index 7302d21b1..cbbe05af1 100644 --- a/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl +++ b/lib/OptimizationOptimJL/src/OptimizationOptimJL.jl @@ -208,12 +208,13 @@ function SciMLBase.__solve(cache::OptimizationCache{ opt_res = Optim.optimize(optim_f, cache.u0, cache.opt, opt_args) t1 = time() opt_ret = Symbol(Optim.converged(opt_res)) - + stats = Optimization.OptimizationStats(; iterations = opt_res.iterations, + time = t1 - t0, fevals = opt_res.f_calls, gevals = opt_res.g_calls, hevals = opt_res.h_calls) SciMLBase.build_solution(cache, cache.opt, opt_res.minimizer, cache.sense === Optimization.MaxSense ? -opt_res.minimum : opt_res.minimum; original = opt_res, retcode = opt_ret, - solve_time = t1 - t0) + stats = stats) end function SciMLBase.__solve(cache::OptimizationCache{ @@ -296,10 +297,11 @@ function SciMLBase.__solve(cache::OptimizationCache{ opt_res = Optim.optimize(optim_f, cache.lb, cache.ub, cache.u0, cache.opt, opt_args) t1 = time() opt_ret = Symbol(Optim.converged(opt_res)) - + stats = Optimization.OptimizationStats(; iterations = opt_res.iterations, + time = t1 - t0, fevals = opt_res.f_calls, gevals = opt_res.g_calls, hevals = opt_res.h_calls) SciMLBase.build_solution(cache, cache.opt, opt_res.minimizer, opt_res.minimum; - original = opt_res, retcode = opt_ret, solve_time = t1 - t0) + original = opt_res, retcode = opt_ret, stats = stats) end function SciMLBase.__solve(cache::OptimizationCache{ @@ -410,10 +412,12 @@ function SciMLBase.__solve(cache::OptimizationCache{ opt_res = Optim.optimize(optim_f, optim_fc, cache.u0, cache.opt, opt_args) t1 = time() opt_ret = Symbol(Optim.converged(opt_res)) - + stats = Optimization.OptimizationStats(; iterations = opt_res.iterations, + time = t1 - t0, fevals = opt_res.f_calls, gevals = opt_res.g_calls, hevals = opt_res.h_calls) SciMLBase.build_solution(cache, cache.opt, opt_res.minimizer, opt_res.minimum; - original = opt_res, retcode = opt_ret) + original = opt_res, retcode = opt_ret, + stats = stats) end end diff --git a/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl b/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl index afcd08d75..5a41997af 100644 --- a/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl +++ b/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl @@ -95,8 +95,9 @@ function SciMLBase.__solve(cache::OptimizationCache{ end t1 = time() - - SciMLBase.build_solution(cache, cache.opt, θ, first(x)[1], solve_time = t1 - t0) + stats = Optimization.OptimizationStats(; iterations = i, + time = t1 - t0, fevals = i, gevals = i) + SciMLBase.build_solution(cache, cache.opt, θ, first(x)[1], stats = stats) # here should be build_solution to create the output message end diff --git a/lib/OptimizationPRIMA/src/OptimizationPRIMA.jl b/lib/OptimizationPRIMA/src/OptimizationPRIMA.jl index 6386a1184..dc73e4569 100644 --- a/lib/OptimizationPRIMA/src/OptimizationPRIMA.jl +++ b/lib/OptimizationPRIMA/src/OptimizationPRIMA.jl @@ -180,10 +180,10 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{ t1 = time() retcode = sciml_prima_retcode(PRIMA.reason(rc)) - + stats = Optimization.OptimizationStats(; time = t1 - t0, fevals = nf) SciMLBase.build_solution(cache, cache.opt, minx, minf; retcode = retcode, - solve_time = t1 - t0) + stats = stats) end export UOBYQA, NEWUOA, BOBYQA, LINCOA, COBYLA diff --git a/lib/OptimizationQuadDIRECT/src/OptimizationQuadDIRECT.jl b/lib/OptimizationQuadDIRECT/src/OptimizationQuadDIRECT.jl index 83ae36f4f..4ef8b1e1a 100644 --- a/lib/OptimizationQuadDIRECT/src/OptimizationQuadDIRECT.jl +++ b/lib/OptimizationQuadDIRECT/src/OptimizationQuadDIRECT.jl @@ -66,10 +66,10 @@ function SciMLBase.__solve(prob::OptimizationProblem, opt::QuadDirect; root, x0 = QuadDIRECT.analyze(_loss, splits, prob.lb, prob.ub; opt_arg...) box = minimum(root) t1 = time() - + stats = Optimization.OptimizationStats(; time = t1 - t0) SciMLBase.build_solution(SciMLBase.DefaultOptimizationCache(prob.f, prob.p), opt, QuadDIRECT.position(box, x0), QuadDIRECT.value(box); - original = root, solve_time = t1 - t0) + original = root, stats = stats) end end diff --git a/lib/OptimizationSpeedMapping/src/OptimizationSpeedMapping.jl b/lib/OptimizationSpeedMapping/src/OptimizationSpeedMapping.jl index 2dd8f829d..e9e120683 100644 --- a/lib/OptimizationSpeedMapping/src/OptimizationSpeedMapping.jl +++ b/lib/OptimizationSpeedMapping/src/OptimizationSpeedMapping.jl @@ -92,10 +92,10 @@ function SciMLBase.__solve(cache::OptimizationCache{ upper = cache.ub, opt_args...) t1 = time() opt_ret = Symbol(opt_res.converged) - + stats = Optimization.OptimizationStats(; time = t1 - t0) SciMLBase.build_solution(cache, cache.opt, opt_res.minimizer, _loss(opt_res.minimizer); - original = opt_res, retcode = opt_ret, solve_time = t1 - t0) + original = opt_res, retcode = opt_ret, stats = stats) end end From 7340dac75230006917cf226fb4d64cdf86e01bd6 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Thu, 4 Jan 2024 16:33:58 -0500 Subject: [PATCH 11/16] CMAEvolution fix --- .../src/OptimizationCMAEvolutionStrategy.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl b/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl index 6867c39cf..c2c5651c0 100644 --- a/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl +++ b/lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl @@ -105,7 +105,7 @@ function SciMLBase.__solve(cache::OptimizationCache{ t1 = time() opt_ret = opt_res.stop.reason - stats = Optimization.OptimizationStats(; iterations = length(opt.logger.fmedian), time = t1 - t0, fevals = length(opt.logger.fmedian)) + stats = Optimization.OptimizationStats(; iterations = length(opt_res.logger.fmedian), time = t1 - t0, fevals = length(opt_res.logger.fmedian)) SciMLBase.build_solution(cache, cache.opt, opt_res.logger.xbest[end], opt_res.logger.fbest[end]; original = opt_res, From 5ef68fd8bb55bfced8e419929833ca5c3acc2c58 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Thu, 4 Jan 2024 19:14:18 -0500 Subject: [PATCH 12/16] Bump compat SciMLBase --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index b021ce120..da15f7210 100644 --- a/Project.toml +++ b/Project.toml @@ -57,7 +57,7 @@ Printf = "1.9" ProgressLogging = "0.1" Reexport = "1.2" ReverseDiff = "1.14" -SciMLBase = "2.11" +SciMLBase = "2.16.2" SparseArrays = "1.9" SparseDiffTools = "2.14" SymbolicIndexingInterface = "0.3" From 9e207806b6f495f2dacca0c42f352ec2e1e9cbb7 Mon Sep 17 00:00:00 2001 From: Vaibhav Kumar Dixit Date: Thu, 4 Jan 2024 19:29:24 -0500 Subject: [PATCH 13/16] Update Project.toml --- Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Project.toml b/Project.toml index 59f3d52fe..6d169015e 100644 --- a/Project.toml +++ b/Project.toml @@ -58,7 +58,6 @@ ProgressLogging = "0.1" Reexport = "1.2" ReverseDiff = "1.14" SciMLBase = "2.16.2" -SparseArrays = "1.9" SparseArrays = "1.9, 1.10" SparseDiffTools = "2.14" SymbolicIndexingInterface = "0.3" From 08b130e2d92cfe2f377e2e4cb8a825969a7039e5 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Fri, 5 Jan 2024 01:07:09 -0500 Subject: [PATCH 14/16] local i in optimisers --- lib/OptimizationFlux/src/OptimizationFlux.jl | 1 + lib/OptimizationOptimisers/src/OptimizationOptimisers.jl | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/OptimizationFlux/src/OptimizationFlux.jl b/lib/OptimizationFlux/src/OptimizationFlux.jl index 989346a38..1d5e18608 100644 --- a/lib/OptimizationFlux/src/OptimizationFlux.jl +++ b/lib/OptimizationFlux/src/OptimizationFlux.jl @@ -41,6 +41,7 @@ function SciMLBase.__solve(cache::OptimizationCache{ P, C, } + local i if cache.data != Optimization.DEFAULT_DATA maxiters = length(cache.data) data = cache.data diff --git a/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl b/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl index 5a41997af..fcaffecef 100644 --- a/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl +++ b/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl @@ -41,6 +41,7 @@ function SciMLBase.__solve(cache::OptimizationCache{ P, C, } + local i if cache.data != Optimization.DEFAULT_DATA maxiters = length(cache.data) data = cache.data From c0e59f6c822dc451b29119f6d0e403226ed68269 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Fri, 5 Jan 2024 02:05:35 -0500 Subject: [PATCH 15/16] bump scimlbase and fix Optimisers err --- Project.toml | 2 +- lib/OptimizationFlux/src/OptimizationFlux.jl | 4 ++-- lib/OptimizationOptimisers/src/OptimizationOptimisers.jl | 8 +++++--- lib/OptimizationOptimisers/test/runtests.jl | 2 ++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 6d169015e..d7d84f0e9 100644 --- a/Project.toml +++ b/Project.toml @@ -57,7 +57,7 @@ Printf = "1.9" ProgressLogging = "0.1" Reexport = "1.2" ReverseDiff = "1.14" -SciMLBase = "2.16.2" +SciMLBase = "2.16.3" SparseArrays = "1.9, 1.10" SparseDiffTools = "2.14" SymbolicIndexingInterface = "0.3" diff --git a/lib/OptimizationFlux/src/OptimizationFlux.jl b/lib/OptimizationFlux/src/OptimizationFlux.jl index 1d5e18608..c9410567d 100644 --- a/lib/OptimizationFlux/src/OptimizationFlux.jl +++ b/lib/OptimizationFlux/src/OptimizationFlux.jl @@ -102,8 +102,8 @@ function SciMLBase.__solve(cache::OptimizationCache{ end t1 = time() - stats = Optimization.OptimizationStats(; iterations = i, - time = t1 - t0, fevals = i, gevals = i) + stats = Optimization.OptimizationStats(; iterations = maxiters, + time = t1 - t0, fevals = maxiters, gevals = maxiters) SciMLBase.build_solution(cache, opt, θ, x[1], stats = stats) # here should be build_solution to create the output message end diff --git a/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl b/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl index fcaffecef..aff5ff625 100644 --- a/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl +++ b/lib/OptimizationOptimisers/src/OptimizationOptimisers.jl @@ -41,12 +41,14 @@ function SciMLBase.__solve(cache::OptimizationCache{ P, C, } - local i if cache.data != Optimization.DEFAULT_DATA maxiters = length(cache.data) data = cache.data else maxiters = Optimization._check_and_convert_maxiters(cache.solver_args.maxiters) + if maxiters === nothing + throw(ArgumentError("The number of iterations must be specified as the maxiters kwarg.")) + end data = Optimization.take(cache.data, maxiters) end opt = cache.opt @@ -96,8 +98,8 @@ function SciMLBase.__solve(cache::OptimizationCache{ end t1 = time() - stats = Optimization.OptimizationStats(; iterations = i, - time = t1 - t0, fevals = i, gevals = i) + stats = Optimization.OptimizationStats(; iterations = maxiters, + time = t1 - t0, fevals = maxiters, gevals = maxiters) SciMLBase.build_solution(cache, cache.opt, θ, first(x)[1], stats = stats) # here should be build_solution to create the output message end diff --git a/lib/OptimizationOptimisers/test/runtests.jl b/lib/OptimizationOptimisers/test/runtests.jl index 01c5fc1d0..295c15f8f 100644 --- a/lib/OptimizationOptimisers/test/runtests.jl +++ b/lib/OptimizationOptimisers/test/runtests.jl @@ -66,4 +66,6 @@ using Zygote end sol = solve(prob, Optimisers.Adam(0.1), maxiters = 1000, progress = false, callback = callback) end + + @test_throws ArgumentError sol = solve(prob, Optimisers.Adam()) end From abfa5486f69cbffc0411ac68f2494086edb351bd Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Fri, 5 Jan 2024 02:35:16 -0500 Subject: [PATCH 16/16] Bump versions --- Project.toml | 2 +- lib/OptimizationBBO/Project.toml | 4 ++-- lib/OptimizationCMAEvolutionStrategy/Project.toml | 4 ++-- lib/OptimizationEvolutionary/Project.toml | 4 ++-- lib/OptimizationFlux/Project.toml | 4 ++-- lib/OptimizationGCMAES/Project.toml | 4 ++-- lib/OptimizationMOI/Project.toml | 4 ++-- lib/OptimizationMetaheuristics/Project.toml | 4 ++-- lib/OptimizationMultistartOptimization/Project.toml | 4 ++-- lib/OptimizationNLopt/Project.toml | 4 ++-- lib/OptimizationNOMAD/Project.toml | 4 ++-- lib/OptimizationOptimJL/Project.toml | 4 ++-- lib/OptimizationOptimisers/Project.toml | 4 ++-- lib/OptimizationPRIMA/Project.toml | 4 ++-- lib/OptimizationPolyalgorithms/Project.toml | 4 ++-- lib/OptimizationQuadDIRECT/Project.toml | 4 ++-- lib/OptimizationSpeedMapping/Project.toml | 4 ++-- 17 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Project.toml b/Project.toml index d7d84f0e9..047c8da94 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Optimization" uuid = "7f7a1694-90dd-40f0-9382-eb1efda571ba" -version = "3.20.2" +version = "3.21.0" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/lib/OptimizationBBO/Project.toml b/lib/OptimizationBBO/Project.toml index 1d31d6925..5d3479631 100644 --- a/lib/OptimizationBBO/Project.toml +++ b/lib/OptimizationBBO/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationBBO" uuid = "3e6eede4-6085-4f62-9a71-46d9bc1eb92b" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.5" +version = "0.2.0" [deps] BlackBoxOptim = "a134a8b2-14d6-55f6-9291-3336d3ab0209" @@ -10,7 +10,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] BlackBoxOptim = "0.6" -Optimization = "3.15" +Optimization = "3.21" Reexport = "1.2" julia = "1" diff --git a/lib/OptimizationCMAEvolutionStrategy/Project.toml b/lib/OptimizationCMAEvolutionStrategy/Project.toml index 60aba2093..181ae2a36 100644 --- a/lib/OptimizationCMAEvolutionStrategy/Project.toml +++ b/lib/OptimizationCMAEvolutionStrategy/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationCMAEvolutionStrategy" uuid = "bd407f91-200f-4536-9381-e4ba712f53f8" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.4" +version = "0.2.0" [deps] CMAEvolutionStrategy = "8d3b24bd-414e-49e0-94fb-163cc3a3e411" @@ -11,7 +11,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] julia = "1" CMAEvolutionStrategy = "0.2" -Optimization = "3.15" +Optimization = "3.21" Reexport = "1.2" [extras] diff --git a/lib/OptimizationEvolutionary/Project.toml b/lib/OptimizationEvolutionary/Project.toml index 8b38e4b05..d54c82169 100644 --- a/lib/OptimizationEvolutionary/Project.toml +++ b/lib/OptimizationEvolutionary/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationEvolutionary" uuid = "cb963754-43f6-435e-8d4b-99009ff27753" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.3" +version = "0.2.0" [deps] Evolutionary = "86b6b26d-c046-49b6-aa0b-5f0f74682bd6" @@ -11,7 +11,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] julia = "1" Evolutionary = "0.11" -Optimization = "3.15" +Optimization = "3.21" Reexport = "1.2" [extras] diff --git a/lib/OptimizationFlux/Project.toml b/lib/OptimizationFlux/Project.toml index c1a8ac7dc..6d023ce1e 100644 --- a/lib/OptimizationFlux/Project.toml +++ b/lib/OptimizationFlux/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationFlux" uuid = "253f991c-a7b2-45f8-8852-8b9a9df78a86" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.5" +version = "0.2.0" [deps] Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c" @@ -15,7 +15,7 @@ julia = "1" Flux = "0.13, 0.14" ProgressLogging = "0.1" Reexport = "1.2" -Optimization = "3.15" +Optimization = "3.21" [extras] ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" diff --git a/lib/OptimizationGCMAES/Project.toml b/lib/OptimizationGCMAES/Project.toml index 86a01d10a..e79457f62 100644 --- a/lib/OptimizationGCMAES/Project.toml +++ b/lib/OptimizationGCMAES/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationGCMAES" uuid = "6f0a0517-dbc2-4a7a-8a20-99ae7f27e911" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.6" +version = "0.2.0" [deps] GCMAES = "4aa9d100-eb0f-11e8-15f1-25748831eb3b" @@ -10,7 +10,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] julia = "1" -Optimization = "3.15" +Optimization = "3.21" GCMAES = "0.1" Reexport = "1.2" diff --git a/lib/OptimizationMOI/Project.toml b/lib/OptimizationMOI/Project.toml index c488ad450..c65fe62a9 100644 --- a/lib/OptimizationMOI/Project.toml +++ b/lib/OptimizationMOI/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationMOI" uuid = "fd9f6733-72f4-499f-8506-86b2bdd0dea1" authors = ["Vaibhav Dixit and contributors"] -version = "0.2.0" +version = "0.3.0" [deps] Ipopt_jll = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" @@ -18,7 +18,7 @@ Ipopt_jll = "=300.1400.400" Juniper = "0.9" MathOptInterface = "1" ModelingToolkit = "8.74" -Optimization = "3.15" +Optimization = "3.21" Reexport = "1.2" SymbolicIndexingInterface = "0.3" Symbolics = "5" diff --git a/lib/OptimizationMetaheuristics/Project.toml b/lib/OptimizationMetaheuristics/Project.toml index a4728f77e..5b70dabae 100644 --- a/lib/OptimizationMetaheuristics/Project.toml +++ b/lib/OptimizationMetaheuristics/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationMetaheuristics" uuid = "3aafef2f-86ae-4776-b337-85a36adf0b55" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.3" +version = "0.2.0" [deps] Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" @@ -12,7 +12,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" julia = "1" Metaheuristics = "3" Reexport = "1.2" -Optimization = "3.15" +Optimization = "3.21" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/lib/OptimizationMultistartOptimization/Project.toml b/lib/OptimizationMultistartOptimization/Project.toml index 4d8667004..575932eaf 100644 --- a/lib/OptimizationMultistartOptimization/Project.toml +++ b/lib/OptimizationMultistartOptimization/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationMultistartOptimization" uuid = "e4316d97-8bbb-4fd3-a7d8-3851d2a72823" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.4" +version = "0.2.0" [deps] Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" @@ -11,7 +11,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] julia = "1" MultistartOptimization = "0.2" -Optimization = "3.15" +Optimization = "3.21" Reexport = "1.2" [extras] diff --git a/lib/OptimizationNLopt/Project.toml b/lib/OptimizationNLopt/Project.toml index 39e131785..387b2a4b2 100644 --- a/lib/OptimizationNLopt/Project.toml +++ b/lib/OptimizationNLopt/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationNLopt" uuid = "4e6fcdb7-1186-4e1f-a706-475e75c168bb" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.8" +version = "0.2.0" [deps] NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd" @@ -10,7 +10,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] NLopt = "0.6, 1" -Optimization = "3.15" +Optimization = "3.21" Reexport = "1.2" julia = "1" diff --git a/lib/OptimizationNOMAD/Project.toml b/lib/OptimizationNOMAD/Project.toml index 867b65538..cce3016f7 100644 --- a/lib/OptimizationNOMAD/Project.toml +++ b/lib/OptimizationNOMAD/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationNOMAD" uuid = "2cab0595-8222-4775-b714-9828e6a9e01b" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.3" +version = "0.2.0" [deps] Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" @@ -11,7 +11,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] julia = "1" NOMAD = "2" -Optimization = "3.15" +Optimization = "3.21" Reexport = "1.2" [extras] diff --git a/lib/OptimizationOptimJL/Project.toml b/lib/OptimizationOptimJL/Project.toml index 27ba3195f..de883c37d 100644 --- a/lib/OptimizationOptimJL/Project.toml +++ b/lib/OptimizationOptimJL/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationOptimJL" uuid = "36348300-93cb-4f02-beb5-3c3902f8871e" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.14" +version = "0.2.0" [deps] Optim = "429524aa-4258-5aef-a3af-852621145aeb" @@ -11,7 +11,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] Optim = "1" -Optimization = "3.15" +Optimization = "3.21" Reexport = "1.2" SparseArrays = "1.6" julia = "1.6" diff --git a/lib/OptimizationOptimisers/Project.toml b/lib/OptimizationOptimisers/Project.toml index 573c51dea..8a9417f15 100644 --- a/lib/OptimizationOptimisers/Project.toml +++ b/lib/OptimizationOptimisers/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationOptimisers" uuid = "42dfb2eb-d2b4-4451-abcd-913932933ac1" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.6" +version = "0.2.0" [deps] Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2" @@ -12,7 +12,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] Optimisers = "0.2, 0.3" -Optimization = "3.15" +Optimization = "3.21" ProgressLogging = "0.1" Reexport = "1.2" julia = "1" diff --git a/lib/OptimizationPRIMA/Project.toml b/lib/OptimizationPRIMA/Project.toml index 6cdf50693..945d0f29c 100644 --- a/lib/OptimizationPRIMA/Project.toml +++ b/lib/OptimizationPRIMA/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationPRIMA" uuid = "72f8369c-a2ea-4298-9126-56167ce9cbc2" authors = ["Vaibhav Dixit and contributors"] -version = "0.0.1" +version = "0.0.2" [deps] Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" @@ -11,7 +11,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] julia = "1" -Optimization = "3.19" +Optimization = "3.21" PRIMA = "0.1.1" Reexport = "1" diff --git a/lib/OptimizationPolyalgorithms/Project.toml b/lib/OptimizationPolyalgorithms/Project.toml index b57692296..02beb058a 100644 --- a/lib/OptimizationPolyalgorithms/Project.toml +++ b/lib/OptimizationPolyalgorithms/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationPolyalgorithms" uuid = "500b13db-7e66-49ce-bda4-eed966be6282" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.2" +version = "0.2.0" [deps] Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" @@ -10,7 +10,7 @@ OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] -Optimization = "3.15" +Optimization = "3.21" OptimizationOptimJL = "0.1" OptimizationOptimisers = "0.1" Reexport = "1.2" diff --git a/lib/OptimizationQuadDIRECT/Project.toml b/lib/OptimizationQuadDIRECT/Project.toml index a855a8ed3..dcb666cd2 100644 --- a/lib/OptimizationQuadDIRECT/Project.toml +++ b/lib/OptimizationQuadDIRECT/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationQuadDIRECT" uuid = "842ac81e-713d-465f-80f7-84eddaced298" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.2" +version = "0.2.0" [deps] Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" @@ -9,7 +9,7 @@ QuadDIRECT = "dae52e8d-d666-5120-a592-9e15c33b8d7a" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" [compat] -Optimization = "3.9" +Optimization = "3.21" Reexport = "1.2" julia = "1" diff --git a/lib/OptimizationSpeedMapping/Project.toml b/lib/OptimizationSpeedMapping/Project.toml index afbce046c..231245d79 100644 --- a/lib/OptimizationSpeedMapping/Project.toml +++ b/lib/OptimizationSpeedMapping/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationSpeedMapping" uuid = "3d669222-0d7d-4eb9-8a9f-d8528b0d9b91" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.5" +version = "0.2.0" [deps] Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" @@ -10,7 +10,7 @@ SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412" [compat] julia = "1" -Optimization = "3.15" +Optimization = "3.21" Reexport = "1.2" SpeedMapping = "0.3"