LoadError when using interpolations as input for a neural ode

Caveat emptor:

I do note that there is also Zygote.dropgrad. I’m not completely certain of the difference between dropgrad and ignore, but I found that dropgrad gave some other obscure error. Possibly dropgrad is the appropriate tool here, but the documentation is pretty sparse. I haven’t tried training the above model more than a few steps to see if it converges.


As an alternative, you can try implementing the interpolation yourself. (Such that the autodiff works with it.) Linear interpolation is pretty straightforward, after all.

Also have a think about using the tstops argument. If you’re using linear interpolation then your vector field has kinks (derivative discontinuities) wrt time, and the solver will have a slightly easier time of it if it doesn’t have to discover these for itelf.

3 Likes