File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
lib/OptimizationOptimJL/src Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ SciMLBase.requiresbounds(opt::Optim.SAMIN) = true
14
14
SciMLBase. supports_opt_cache_interface (opt:: Optim.AbstractOptimizer ) = true
15
15
SciMLBase. supports_opt_cache_interface (opt:: Union{Optim.Fminbox, Optim.SAMIN} ) = true
16
16
SciMLBase. supports_opt_cache_interface (opt:: Optim.ConstrainedOptimizer ) = true
17
+ SciMLBase. requiresderivative (Optim. AbstractOptimizer) = ! (opt isa Optim. ZerothOrderOptimizer)
17
18
18
19
function __map_optimizer_args (cache:: OptimizationCache ,
19
20
opt:: Union {Optim. AbstractOptimizer, Optim. Fminbox,
@@ -128,7 +129,8 @@ function SciMLBase.__solve(cache::OptimizationCache{
128
129
local x, cur, state
129
130
130
131
cur, state = iterate (cache. data)
131
-
132
+ (requiresderivative (Optim. AbstractOptimizer))
133
+ error (" Use OptimizationFunction to pass the derivatives or automatically generate them with one of the autodiff backends" )
132
134
! (cache. opt isa Optim. ZerothOrderOptimizer) && cache. f. grad === nothing &&
133
135
error (" Use OptimizationFunction to pass the derivatives or automatically generate them with one of the autodiff backends" )
134
136
You can’t perform that action at this time.
0 commit comments