OK, I will keep this one short and sweet, no math. We have a sampling notebook.
This isn’t completely new. The notebook I wrote is based, almost entirely, on this notebook by Sanmitra Ghosh. Sanmitra computes the requisite gradient and Jacobian analytically. If you remember, my last blog post showed how to construct a Theano computation graph to compute those quantities automatically. This + That = Sampling Notebook (did I say no math? Wow, how long did I last? Not even a paragraph? I’m awful).
Here is my notebook. But don’t snoop around the rest of the repo! You’re going to ruin all the fun surprises I have in store (and you will definitely see my buggy code).
It really was a matter of plug and play, and if you are really in need of ODE capabilities on Pymc3 (like…you need them yesterday), I’m fairly certain you can fork this notebook and run with it.
I’m currently working on putting this all in an API. I’m thinking you would do something like
ode_model = ODEModel(odefunc) ode_op = ODEop(ode_model) with pm.Model() as model: #Write priors here solution = ode_op(parameters) #Write likelihood
There are still some bugs to work out in my API (most notably working with asynchronous data), but I will save that for a later date. For now, feel free to fork and play with the notebook.