-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Infinity check on arguments to ODEs #2406
Comments
Not 100% sure but I agree with you that a manual check_finite may not be necessary as the ODE functor evaluation should be able capture it somewhere downstream. Personally I don't see any risk here. |
Maybe we try what happens if Inf is thrown at the ODE system? |
Checking every time the functor is called might slow stuff down. If infs go into the ODE solver and the parameter is actually used, the ODE solver will presumably explode (or the right hand side evaluation will). I guess it is very slightly more informative to say "input to ODE solver contained an inf" and try to pre-empt that. But then again maybe letting the right hand side explode produces a more informative error message (instead of saying "you passed an inf to the ODE" maybe there will be an error "you passed an inf to X" and it is clearer what was inf). |
But yeah I'm just rambling -- if nobody has any great attachment to this check, then I would like to try removing it. So since neither of you said "that is super useful for debugging -- please don't remove it", I am even more eager to remove it now. |
I woud not like to gain another check which we execute every time we call the ODE functor! I don't mind passing Inf into that functor and let it explode immediately. So let's try and let it explode is what I am saying. |
Oh oh, I misread. Excellent! Then let's give this a go and at worse someone can add it back in in 6 months lol. |
If no one is going to bite the bullet to profile the effect of these checks, I doubt it's worth to remove them and wait for blowbacks. Note that for explicit solvers putting inf & nan won't terminate the solution, the solver will just crunch on, which is arguably more expensive in computing and less intuitive in error message. I'm closing it for now. Feel free to reopen and start with profiling. |
Description
Can we remove the infinity checks on the pass-through-arguments for the ODE solvers (these)?
This came up in closures implementation: #2384
We would need to add extra functions to the closures to extract the values of all the variables they capture to check if any were infinite.
Anyway I'm not super convinced of the value of these checks in general, so if we can get rid of them that is another way to solve the coding problem.
@wds15 @yizhang-yiz
Current Version:
v4.0.1
The text was updated successfully, but these errors were encountered: