You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least 2 time values (evaluation points) need to be provided in order for any gradients to be computed for odeint.
E.g., this works:
t = torch.tensor([0.0, 1.0])
y_pred = odeint(func, x0, t)
but this does NOT work:
t = torch.tensor([1.0])
y_pred = odeint(func, x0, t)
I thought I read that extra evaluation points are not necessary for computation because the solver will use its own timesteps as necessary to solve, and it simply interpolates between them for to evaluate the requested points. So I incorrectly thought a single value would work when I only need the final evaluation to be returned. This was probably documented somewhere I overlooked/misunderstood/forgot.
In any case a runtime warning might help some future dummies like me. It was nasty to track down the cause of the missing gradients, because it just continues silently.
The text was updated successfully, but these errors were encountered:
At least 2 time values (evaluation points) need to be provided in order for any gradients to be computed for odeint.
E.g., this works:
but this does NOT work:
I thought I read that extra evaluation points are not necessary for computation because the solver will use its own timesteps as necessary to solve, and it simply interpolates between them for to evaluate the requested points. So I incorrectly thought a single value would work when I only need the final evaluation to be returned. This was probably documented somewhere I overlooked/misunderstood/forgot.
In any case a runtime warning might help some future dummies like me. It was nasty to track down the cause of the missing gradients, because it just continues silently.
The text was updated successfully, but these errors were encountered: