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

Relative: Fix return of inner parameters on objective call #1333

Merged
merged 4 commits into from
Mar 27, 2024

Conversation

Doresic
Copy link
Contributor

@Doresic Doresic commented Mar 21, 2024

There was a bad implementation of inner parameter returning on call of objective.
Previously, the InnerCalculatorCollector would take note of self.best_fval such that it returns inner_parameters only in cases a better objective function value was found. This was ok during optimization, but then if one wanted to get inner parameters for some other outer parameter vector for which the objective function would not be better, the inner parameters would not be returned.

This is bad practice: to save current states in the calculator and objective objects. So now, after an optimization start is finished, the hierarchical_decorator instead calls the objective once more with the best outer parameters found to obtain the inner parameters for that outer vector.

There some small update in the visualize of model_fit.time_trajectory_model. Was not working with the current implementation due to recent hierarchical structure changes.

@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 84.26%. Comparing base (9cf4bf2) to head (476c2b6).

Files Patch % Lines
pypesto/visualize/model_fit.py 50.00% 2 Missing ⚠️

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

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1333   +/-   ##
========================================
  Coverage    84.25%   84.26%           
========================================
  Files          152      152           
  Lines        12452    12441   -11     
========================================
- Hits         10492    10483    -9     
+ Misses        1960     1958    -2     

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

Copy link
Member

@dweindl dweindl left a comment

Choose a reason for hiding this comment

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

Thanks. Looks good to me.

Copy link
Contributor

@FFroehlich FFroehlich left a comment

Choose a reason for hiding this comment

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

LGTM

@Doresic Doresic merged commit 8016726 into develop Mar 27, 2024
18 checks passed
@Doresic Doresic deleted the relative_fix_return_inner_pars branch March 27, 2024 13:21
@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.

AmiciObjective / RelativeAmiciCalculator doesn't always provide inner_parameters
7 participants