Comments (1)
Hi :-)
You are right, we could really use some documentation on that. If you can share a notebook that we can add to the docs, that would be great!
If you use solve_ivp
from the as_pytensor
(the old as_aesara
) module, the adjoint solver will be used by default controlled by the derivatives: str = 'adjoint'
argument).
About your questions:
The adjoint solver corresponds to the backward step in reverse mode autodiff, or the pullback from differential geometry.
We assume that we want to compute the gradient of some large function solve_backward
. The gradients of grads
in the code. The final gradients of grads_out
, for the gradients with respect to the parameters, and lambda_out
for the gradients with respect to the initial conditions (-lambda_out
actually, that's how this was defined by sundials for some reason...).
This is essentially also how sundials does things internally, only that it generalizes it a bit more. The idea is that the way we think about "the function that solves the ODE
currently, like computing the gradient of an integral over the solution. So for instance you could have a loss function that compares the solution function to a target solution.
In what context are you using sunode? If you don't use the pytensor wrappers, you'll have to apply the chain rule yourself to get gradients of the composite function.
I hope this explanation is helping at least a bit, feel free to ask for clarification if something is not clear, this isn't the easiest subject to write about. :-)
from sunode.
Related Issues (18)
- solver.as_xarray fails with multidimensional states HOT 2
- ValueError: empty body on FunctionDef when params to solve_ivp are all numeric
- Import fails with sympy 1.8
- Non-constant parameters HOT 2
- Infinite loops on CVODE HOT 2
- NotImplementedError: Cannot convert hares_start ~ HalfNormal to a tensor variable. HOT 1
- SympyProblem slow while using large coords
- Only works with conda HOT 1
- License mismatch HOT 2
- Getting test script to run HOT 7
- Implement aesara backend for right hand side function
- Correction for Adjoint Gradient Calculations HOT 4
- not support for m1 mac HOT 3
- Errors in tutorial
- Can't install sunode HOT 2
- Installing sunode on Apple Silicon via Conda? HOT 13
- Define ODE with external input HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sunode.