-
-
Notifications
You must be signed in to change notification settings - Fork 46
Implement Adjoints for solution of IntervalNonlinearProblems #623
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
Implement Adjoints for solution of IntervalNonlinearProblems #623
Conversation
!is_extension_loaded(Val(:DiffEqBase)) && | ||
error("Adjoint sensitivity analysis requires `DiffEqBase.jl` to be explicitly loaded.") |
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.
why is this needed? This seems very unncessary
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.
So without DiffEqBase being loaded Zygote tries to differentiate through the IntervalNonlinearProblem constructor.
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.
Just make it an extension in SciMLBase
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.
As in an actual SciMLBaseBracketingNonlinearSolveExt
in SciMLBase, yes?
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.
No just chainrules for the constructor rules
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.
Oh I see what you're saying now. I'll add the constructor rrules to the SciMLBase chain rules extension.
prob::IntervalNonlinearProblem, | ||
sensealg, p, alg, args...; kwargs... | ||
) | ||
# DiffEqBase is needed for problem/function constructor adjoint |
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.
These should just be SciMLBase extensions.
|
||
[extensions] | ||
BracketingNonlinearSolveForwardDiffExt = "ForwardDiff" | ||
BracketingNonlinearSolveChainRulesCoreExt = "ChainRulesCore" | ||
BracketingNonlinearSolveChainRulesCoreExt = ["ChainRulesCore", "Zygote"] |
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.
not necessary
ad0ba38
to
789e04b
Compare
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
@ChrisRackauckas this should work in a similar way to the SimpleNonlinearSolve adjoints. It works and gives the correct answer if I define the rrule in the REPL, but the extension with the rrule doesn't seem to actually load. I haven't dealt with extensions much so I think I'm missing something.