-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update #711 checking if OptimizationFunction is used for derivative based optimizers #711 #715
Changes from 8 commits
01f4479
404f4f3
b2c044d
ef4e4a5
ed73535
134d7fc
702e095
6e2afe3
d1c0111
1ba53fb
1767142
da5955b
64e16ec
3ae278f
4887714
a1348e3
0b6f600
6ea74cf
5132aea
785c218
8f3e381
a5652d7
6379379
6fb808b
ea6d522
73cd120
bae6741
b9854f5
15a5fa0
0857a62
bb82850
2d6b7c4
e0610cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
SciMLBase.supports_opt_cache_interface(opt::Optim.AbstractOptimizer) = true | ||
SciMLBase.supports_opt_cache_interface(opt::Union{Optim.Fminbox, Optim.SAMIN}) = true | ||
SciMLBase.supports_opt_cache_interface(opt::Optim.ConstrainedOptimizer) = true | ||
SciMLBase.requiresgradient(Optim.AbstractOptimizer) = !(opt isa Optim.ZerothOrderOptimizer) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good, but this wrapper will need more of the traits set to true (Newton, NewtonTrustRegion and IPNewton) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And not all of them follow the abstract type, especially check the SAMIN and FminBox algorithms
Vaibhavdixit02 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
function __map_optimizer_args(cache::OptimizationCache, | ||
opt::Union{Optim.AbstractOptimizer, Optim.Fminbox, | ||
|
@@ -128,7 +129,8 @@ | |
local x, cur, state | ||
|
||
cur, state = iterate(cache.data) | ||
|
||
(requiresgradient(Optim.AbstractOptimizer)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be done in the |
||
error("Use OptimizationFunction to pass the derivatives or automatically generate them with one of the autodiff backends") | ||
!(cache.opt isa Optim.ZerothOrderOptimizer) && cache.f.grad === nothing && | ||
error("Use OptimizationFunction to pass the derivatives or automatically generate them with one of the autodiff backends") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the default value is false, you can only declare the ones you need to set to true here, so for example you'd not need to define anything here in OptimzationBBO since its all false