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

Add example using preconditioning. #8

Open
patrick-kidger opened this issue May 28, 2023 · 6 comments
Open

Add example using preconditioning. #8

patrick-kidger opened this issue May 28, 2023 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@patrick-kidger
Copy link
Owner

No description provided.

@patrick-kidger patrick-kidger added the documentation Improvements or additions to documentation label May 28, 2023
@frederic-bender
Copy link

frederic-bender commented Jul 8, 2024

Hey, I'm using a Newton-GMRES-algorithm for implicitly solving large ODEs, based on Diffrax/Optimistix/Lineax – a pretty awesome set of libraries!

Right now I'm trying to figure out, how to create a Jacobi-preconditioner (or a more advanced one) for matrix-free computations. Using lx.diagonal(...) materializes the Jacobian and therefore is not possible for a vector of length ~500,000. Do you have any idea how to solve this problem?

@patrick-kidger
Copy link
Owner Author

patrick-kidger commented Jul 9, 2024

This depends on the kind of operator you have. A tridiagonal linear operator, for example, can get the diagonal without further materialization!

However it's a classic (sad) fact in autodifferentiation that accessing the diagonal of a Jacobian requires computing the whole Jacobian.

You'll probably need to find a different approach for your problem.

Sorry I couldn't be more help!

@vboussange
Copy link

Hey @patrick-kidger, awesome package! It would be indeed very nice to have an example using preconditioning.

Is there any project such as AlgebraicMultigrid.jl or pyamg running in JAX?

Otherwise, I could suggest an example using pyamg.multigrid for solving a Poisson 2D system, see e.g. here.

@patrick-kidger
Copy link
Owner Author

I don't thnk so! I'd be very happy to take a PR adding an example of this nature :)

@vboussange
Copy link

Ok. Should this go into docs/examples/preconditioning.ipynb or similar? Are we happy to have a dependency on pyamg?

@patrick-kidger
Copy link
Owner Author

Yup, exactly there.

I think it'd be best to avoid a dependency on pyamg if at all possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants