-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Add jacobian
, at last?
#890
Conversation
I'd prefer something that is somewhat more generic rather than using if blocks for type checking. Not a big deal, but the approach in #747 seems better suited to be extended using our existing tools. |
Can you say what differences you see in approach? I tried other things and we can discuss them, but circled back to pretty small adjustments.
Which tools are you referring to? |
looks very good, had only minor comments |
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 do we need to explicitly copy?
Julia 1.3 tests failing due to CUDA compatibility issues is annoying. Maybe we should drop < 1.5 support |
I believe that if we move tests to 1.4 they will get the new resolver, maybe that's the minimal step? Maybe not this PR though. What are the rules here, do all PRs need at least one approval? And is Bors expected to obey commands from me? |
Co-authored-by: Carlo Lucibello <[email protected]>
MWE? This docstring just matches the errors:
|
https://github.com/SciML/DiffEqSensitivity.jl/blob/e04f8a1a300ed2dbc2e0e8da520bb3ef6d9548a2/src/concrete_solve.jl#L279 outputs a vector in the forward pass. |
Sure. But I meant an example for |
I mean, I've shown you it working in the ecosystem |
Sorry, what does "it" refer to here? The file you linked to does not seem to contain the function |
Co-authored-by: Carlo Lucibello <[email protected]>
bors r+ |
Build succeeded: |
This adds a Jacobian function.
Compared to #747 this one:
back
returnsnothing
vec
a few more placesParams
, and returnsGrads
. (This was the only part I actually needed in real life.)Compared to #414 this one:
vec
, never makes higher-dimensional arraysCompared to #235 this one:
jacobian!
, nor any code for structured matrices.This does not address #564's concerns about functions which return a tuple of arrays. Only functions returning an array (or a scalar) are permitted. Similar considerations might give sensible jacobians when the argument of a function is a tuple, or some other struct, but for now these are handled by putting up a giant warning sign.
Nothing in the file
utils.jl
seems to have any tests at all. So I also added tests forhessian
.And, while I was there, made
hessian
actually accept a real number like its docstring promises. (Hence this closes #891.) And, made a version that is reverse-over-reverse, using thisjacobian
, which works less well of course but may as well exist to test things. (See for example #865.) Ideally there would be a pure-Zygote version using its own forward mode, but I didn't write that.Fixes #51, fixes #98, fixes #413. Closes #747.