pytensor
pytensor copied to clipboard
Fixed point iterator
Description
This builds on @aseyboldt's work in #944. It is part of the INLA hackathon (https://github.com/pymc-devs/pymc-experimental/issues/340, specific related issues https://github.com/pymc-devs/pymc-experimental/issues/342 and https://github.com/pymc-devs/pymc-experimental/issues/343) and will later involve rewrites for the gradient using the adjoint method where we define the backward pass only at the solution point rather than backpropagating through each step of the iterator and storing all the intermediate values (implicit function theorem, see here, here, and here).
There's a crappy test that checks it matches the jax output from an example from the Deep Implicit Layers tutorial. Note, it's essential to run this with jax float64 precision
Related Issue
- [ ] Closes https://github.com/pymc-devs/pymc-experimental/issues/343
- [ ] Related to https://github.com/pymc-devs/pymc-experimental/issues/342, https://github.com/pymc-devs/pymc/issues/7308
Checklist
- [x] Checked that the pre-commit linting/style checks pass
- [x] Included tests that prove the fix is effective or that the new feature works
- [ ] Added necessary documentation (docstrings and/or example notebooks)
- [ ] If you are a pro: each commit corresponds to a relevant logical change
Type of change
- [x] New feature / enhancement
- [ ] Bug fix
- [ ] Documentation
- [ ] Maintenance
- [ ] Other (please specify):