rtqichen / torchdiffeq

Differentiable ODE solvers with full GPU support and O(1)-memory backpropagation.
MIT License
5.6k stars 928 forks source link

Using arbitrary time steps for the ODE solvers #105

Closed saihv closed 4 years ago

saihv commented 4 years ago

I would like to apply the neural ODE to capture the dynamics of a system where the training data has very discrete time steps: say each data point is spaced apart by an hour or so.

Now, if I try to train a neural ODE by attempting to evaluate the integrator at an arbitrary number like 1.0, the resulting dynamics during training seem to be "limited" to a certain speed, so the neural ODE does not seem to be able to capture the 'fast' dynamics (because of the long evaluation period) unless I specifically give it a large dt. Is this expected behavior? And is it possible to change this behavior somehow, by playing with the solver's timestep?

rtqichen commented 4 years ago

Note that the t variable is just a dummy one. You can use it in units of hours or days or whatever is convenient. I've often found that changing the units of the ODE a bit can make tuning tolerances easier and often helps with numerical issues.