rtqichen / torchdiffeq

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

No shebang in ode_demo.py, graphics don't generate and a question about the cubic on ODEFunc #171

Open 2themaxx opened 3 years ago

2themaxx commented 3 years ago

This is really a nit-picky detail, but there's no shebang ("#!/usr/bin/env python3") at the beginning of the ode_demo.py. Also, for some reason the graphics are not generating. I removed the savefig and just executed visualize in a notebook and that required some tweaking, but I got it to work.

One big question I had was about generalizing this example. In ODEFunc under the forward you have

return self.net(y**3)

Should the designer know the true model is cubic, or is this just for convenience to demonstrate the concept for a lower-memory model and faster convergence? More specifically, would you use a more complex model with more hidden layers and/or more nodes to determine that the function is cubic?

2themaxx commented 3 years ago

Just to be clear I get blank graphics (empty .png files) when using with no command line parameters after adding the shebang for ODE_demo.py.

Aniq55 commented 6 months ago

On a similar note, I tried running python examples/learn_physics.py --no_events and get really poor results for 1000 steps. I do not get the orange curve Neural ODE anywhere close to decaying sinusoids and get a somewhat linear curve. Reproducing results for Neural Event ODE however, is possible if --no_events argument is not passed.

The paper says they ran it for 1e6 steps.

Using a neural network with more layers (more complex) will only exacerbate this problem of needing lots of iterations.

You need to add --viz to the end to generate the images under the /png/ folder