From 6c14bbef1e70452b3ff8c9970d125c3de8369672 Mon Sep 17 00:00:00 2001 From: Vaibhav Kumar Dixit Date: Fri, 17 Nov 2023 12:24:30 -0500 Subject: [PATCH] Update OptimizationPolyalgorithms.jl --- .../src/OptimizationPolyalgorithms.jl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/OptimizationPolyalgorithms/src/OptimizationPolyalgorithms.jl b/lib/OptimizationPolyalgorithms/src/OptimizationPolyalgorithms.jl index 481a128ef..18c6f4108 100644 --- a/lib/OptimizationPolyalgorithms/src/OptimizationPolyalgorithms.jl +++ b/lib/OptimizationPolyalgorithms/src/OptimizationPolyalgorithms.jl @@ -21,21 +21,24 @@ function SciMLBase.__solve(prob::OptimizationProblem, if isempty(args) && deterministic && prob.lb === nothing && prob.ub === nothing # If deterministic then ADAM -> finish with BFGS if maxiters === nothing - res1 = Optimization.solve(prob, Optimisers.ADAM(0.01), args...; maxiters = 300, + res1 = Optimization.solve(prob, Optimisers.ADAM(0.1), args...; maxiters = 300, kwargs...) else - res1 = Optimization.solve(prob, Optimisers.ADAM(0.01), args...; maxiters, + res1 = Optimization.solve(prob, Optimisers.ADAM(0.1), args...; maxiters, kwargs...) end optprob2 = remake(prob, u0 = res1.u) - res1 = Optimization.solve(optprob2, BFGS(initial_stepnorm = 0.01), args...; + res1 = Optimization.solve(optprob2, LBFGS(initial_stepnorm = 0.01), args...; maxiters, kwargs...) elseif isempty(args) && deterministic - res1 = Optimization.solve(prob, BFGS(initial_stepnorm = 0.01), args...; maxiters, + res1 = Optimization.solve(prob, LBFGS(), args...; maxiters, kwargs...) else res1 = Optimization.solve(prob, Optimisers.ADAM(0.1), args...; maxiters, kwargs...) + optprob2 = remake(prob, u0 = res1.u) + res1 = Optimization.solve(optprob2, Optimisers.ADAM(0.1), args...; + maxiters÷10, kwargs...) end end