-
Notifications
You must be signed in to change notification settings - Fork 16
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
Provide an option to exclude some AD backends #327
Conversation
The current way to achieve this is to set the mentioned backend to |
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.
Looks overall good, thanks @amontoison !
Could you also update the section https://jso.dev/ADNLPModels.jl/dev/performance/ for the doc and maybe add a very short unit test?
Co-authored-by: Tangi Migot <[email protected]>
I forgot that we can do that! I don't think this PR will bring any advantage. I will just update the documentation to specify the backends needed for Ipopt / Knitro / MadNLP. using ADNLPModels, NLPModels
f(x) = (x[1] - 1)^2
T = Float64
x0 = T[-1.2; 1.0]
lvar, uvar = zeros(T, 2), ones(T, 2)
lcon, ucon = -T[0.5], T[0.5]
c!(cx, x) = begin
cx[1] = x[2]
return cx
end
nlp = ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon, backend = :optimized,
jprod_backend = ADNLPModels.EmptyADbackend,
jtprod_backend = ADNLPModels.EmptyADbackend,
hprod_backend = ADNLPModels.EmptyADbackend,
ghjvprod_backend = ADNLPModels.EmptyADbackend) |
I updated the documentation in #328. |
close #324
cc @jbcaillau @PierreMartinon
It will be easier for you to exclude some
ADbackend
with the optionexclude_backend
.ADNLPModel - Model with automatic differentiation backend ADModelBackend{ ReverseDiffADGradient, EmptyADbackend, EmptyADbackend, EmptyADbackend, SparseADJacobian, SparseReverseADHessian, EmptyADbackend, }