Skip to content
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

lax.custom_linear_solve primitive #1402

Merged
merged 29 commits into from
Oct 21, 2019
Merged

lax.custom_linear_solve primitive #1402

merged 29 commits into from
Oct 21, 2019

Conversation

shoyer
Copy link
Collaborator

@shoyer shoyer commented Sep 26, 2019

A follow-on to lax.root from #1339. See the tests for a simple example of defining gradients for an iterative linear solver.

Eventually, I expect to use this for implementing iterative solvers (e.g., GMRES, CG) from scipy.sparse.linalg, which in turn we will use for the linear solves needed for gradients in scipy.optimize.root.

@dougalm dougalm self-requested a review October 3, 2019 19:24
@shoyer
Copy link
Collaborator Author

shoyer commented Oct 10, 2019

Please take another look. I rewrote everything so solve/transpose_solve are now evaluated to JAXprs before calling the primitive, so they work on closures. Also added a bunch more tests/docs/validation.

@shoyer shoyer changed the title lax.linear_solve primitive lax.custom_linear_solve primitive Oct 10, 2019
@shoyer
Copy link
Collaborator Author

shoyer commented Oct 14, 2019

This is ready for a final (?) review.

"""Transpose a linear function."""
# TODO(shoyer): can we use something more direct than the vjp machinery?
# It's particularly awkward that we need the second argument to give
# particular values of the primals, which are entirely arbitrary.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. It might be a new transformation, but one that shares a lot of machinery with the existing jvp/transpose.

@shoyer shoyer merged commit 0289536 into jax-ml:master Oct 21, 2019
@shoyer shoyer deleted the linear-solvers branch November 8, 2019 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants