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

Hierarchical optimization: fix unnecessary simulation #1327

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Mar 18, 2024

Currently model simulation is run twice, even when no sensitivities are requested and the optimal inner parameters could be applied directly.

…ensitivities are requested

Currently model simulation is run twice, even when no sensitivities are requested and the optimal inner parameters could be applied directly.
@dweindl dweindl requested a review from Doresic as a code owner March 18, 2024 12:14
@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.46%. Comparing base (2558763) to head (e2501a9).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1327      +/-   ##
===========================================
+ Coverage    84.42%   84.46%   +0.03%     
===========================================
  Files          153      153              
  Lines        12529    12529              
===========================================
+ Hits         10577    10582       +5     
+ Misses        1952     1947       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Doresic Doresic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, nice change. Didn't think of this case in the implementation.
To confirm we're thinking the same: the only thing this changes is that if the sensitivity method is adjoint, then the sensi_orders = (0,) calls of the objective will be called through self.calculate_directly(...) instead of self.call_amici_twice(...), right?

@dweindl
Copy link
Member Author

dweindl commented Mar 18, 2024

To confirm we're thinking the same: the only thing this changes is that if the sensitivity method is adjoint, then the sensi_orders = (0,) calls of the objective will be called through self.calculate_directly(...) instead of self.call_amici_twice(...), right?

Correct.

It was necessary because checking for sensitivity method alone is insufficient. sensitivity method and sensitivity order jointly decide whether sensitivities are to be computed.

@dweindl dweindl merged commit 446e123 into ICB-DCM:develop Mar 18, 2024
18 checks passed
@dweindl dweindl deleted the fix_hierarchical_double_sim branch March 18, 2024 12:50
@PaulJonasJost PaulJonasJost mentioned this pull request Mar 27, 2024
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

Successfully merging this pull request may close these issues.

3 participants