Add a forward-mode adjoint #536
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Patrick,
do you remember the forward-mode adjoint you wrote for me all those many months ago?
I've been wanting to make this useful to others for a long time, here it is! I have some questions:
jax.grad(..., allow_int=True).jacfwdandjax.linearizedo not support integer inputs, writing some custom thing that computes a JVP with respect to "unit pytrees" with mixed types and non-arrays is... a pain.This seems like an exceedingly rare use case given the difficulties, but maybe we should document somewhere that this option is not, in fact, available. (Or leave it be, since diffrax does not differ from jax in this respect.)
To serve documentation, I needed to make the version of mkdocs-autorefs explicit (to the second-to-last release or so), so I added that too. This also came up for optimistix a while ago.
Lastly, this is rebased on dev as of now - but I can imagine that your weekend was quite busy following Friday's release, so if you'd like to postpone this, I'm not in a rush! I will mark this as a draft, due to the questions above.