rtqichen / torchdiffeq

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

Question about the gradient of `odeint` #250

Open Hank0626 opened 5 months ago

Hank0626 commented 5 months ago

Hello,

I've been working with odeint where the input is a neural network and a vector t. The output is a tensor with an additional dimension for t in front of the dimensions of the neural network's output.

My goal is to focus on the output at the final time step and compute the loss against the true value. In this context, do the outputs at the previous time steps have any significance? Specifically, how is the gradient propagated through these intermediate outputs?

Thank you for your help!