Hello People,
I was going through the gsoc project list of pymc, and found the ode solver project quite interesting. Could the mentors elaborate on the scope of the project, and what are the topics they are planning to cover under the span of this project for gsoc 2019?
Link - [https://github.com/pymc-devs/pymc3/wiki/GSoC-2018-projects#ode-solvers](ODE Solver)
I think it is a bit too early to plan about GSoC 2019… As for the project scope, I am not sure who is currently working on this (@aseyboldt is doing some work linking julia ODE solver to pymc3, @michaelosthege also implemented some version of ODE solver). Overall, the plan is to implement a ODE solver with gradient for parameters (which is the reason we cannot just use the ODE solver in scipy).
Are there any updates regarding the scope of the project?
Also, I am confused regarding the ode solver; can you please elaborate on what is meant by implement a ODE solver with gradient for parameters ?
Ping @aseyboldt@michaelosthege @junpenglao
For inference, it is preferable to be able to compute gradients with respect to the parameters. Most ODE solvers such as scipy.odeint don’t give gradients, which means one can’t use Hamiltonian Monte Carlo (NUTS) right away. There are multiple workarounds:
using a less sophisticated sampling algorithm (e.g. DEMetropolis), which works as long as there aren’t too many dimensions
doing the ODE-solving in theano, to make it differentiable (see this example) - works, but the performance is awkward
a Theano Op that uses scipy.odeint for the forward-pass and an analytical (manually derived) gradient (works if you’re good with maths)
a Theano Op that uses scipy.odeint in the forward-pass and adjoints for the gradients
a Theano Op that wraps the famous JuliaDiffEq package (which can do gradients)
I’ve done the first two and would love to see a comparison, or even a generalizable implementation of the last two.
The adjoint method was recently used in a very popular deep learning paper called “Neural Ordinary Differential Equations”. There are explanations of the method here and here.
In the original paper, they added the Python implementation to appendix D,
to get the gradients with respect to u0 and the parameters. Then work that into whatever backpass code you need. The DiffEqFlux code shows how to work it into a code which is expecting an array as output. If you just add the DE. in front of everything it should work in DiffEqPy.