Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A warning message when there is only 1 evaluation point provided would be helpful #251

Open
lcdavis13 opened this issue Jun 25, 2024 · 0 comments

Comments

@lcdavis13
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant