pyPESTO icon indicating copy to clipboard operation
pyPESTO copied to clipboard

Relative: Fix return of inner parameters on objective call

Open Doresic opened this issue 1 year ago • 1 comments

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.

Doresic avatar Mar 21 '24 10:03 Doresic

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 :warning:

:exclamation: 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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Mar 21 '24 10:03 codecov-commenter