-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix ReturnData::{preeq_wrms,posteq_wrms} with FSA and check_sensi_steadystate_conv_=True #2071
Conversation
…adystate_conv_=True Documentation says, that ReturnData::{preeq_wrms,posteq_wrms} refers to the `weighted root-mean-square of the rhs when steadystate was reached`, independent of `Solver::check_sensi_steadystate_conv_`, but this wasn't what happened. Now it is.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2071 +/- ##
========================================
Coverage 54.90% 54.90%
========================================
Files 30 30
Lines 4617 4617
========================================
Hits 2535 2535
Misses 2082 2082
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Any idea why this change would affect state sensitivities? 🤔 Details```python __________________________________________________________________________________________ test_manual_preequilibration ___________________________________________________________________________________________ preeq_fixture = (<amici.amici.ModelPtr; proxy of <Swig Object of type 'std::unique_ptr< amici::Model > *' at 0x7f58c37fb750> >, <Swig ... (2/2 measurements & 2/2 sigmas set)
python/tests/test_preequilibration.py:118: args = (<function assert_allclose..compare at 0x7f58fd350b80>, array([[[-1.23878552, 0.9791515 , -0.65434205, -1.235...3906, 0.20831407],
E AssertionError: /usr/lib/python3.11/contextlib.py:81: AssertionError
|
Looking at the code, I am wondering how this was even working before. |
l 668/9
also appears to be defunct. And with the current implementation, we still need some way of exiting the loop in case of adjoint sensitivies or no FSA convergence check. And it might be worthwhile investigating how this even worked in the first place? Were we always just using up all integration steps and then converging via the convergence check for newton updates? |
Not sure I can follow. We still have AMICI/src/steadystateproblem.cpp Line 704 in 2ea8281
AMICI/src/steadystateproblem.cpp Lines 715 to 716 in 2ea8281
to not exhaust the number of steps, not? |
Okay, the failing tests were just because the getWrmsFSA check would be ignored in subsequent iterations. That should be fixed now. Not sure what to do about
Simply remove? Should we even end up here if Newton's method already converged? Move the convergence check to the beginning of the loop, so the |
No we shouldn't, but we might start at steady state and not have run Newton's method.
Yes. |
Not sure I follow, but I do think this fixes the issue that I mentioned above about not having a break statement in case there is no getWrmsFSA check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Documentation says, that ReturnData::{preeq_wrms,posteq_wrms} refers to the
weighted root-mean-square of the rhs when steadystate was reached
, independent ofSolver::check_sensi_steadystate_conv_
, but this wasn't what happened. Now it is.Closes #2066