ICB-DCM / pyPESTO

python Parameter EStimation TOolbox
https://pypesto.readthedocs.io
BSD 3-Clause "New" or "Revised" License
206 stars 44 forks source link

Calling prior in sampling with fixed parameters does not work #1378

Closed arrjon closed 1 month ago

arrjon commented 2 months ago

The NegLogParameterPriors objective does not properly account for fixed parameters when invoked during sampling. When it's integrated into the AggregatedObjective, optimization functions correctly; however, issues arise during sampling because call_unprocessed is triggered with the reduced parameter vector, causing a failure.

Maybe there is a better way to fix this, as I just updated the call of neglogprior, but I feel this might break stuff during optimzation.

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.52%. Comparing base (049493c) to head (e555ef2).

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1378 +/- ## =========================================== + Coverage 84.48% 84.52% +0.03% =========================================== Files 157 157 Lines 12958 12956 -2 =========================================== + Hits 10948 10951 +3 + Misses 2010 2005 -5 ```

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

arrjon commented 2 months ago

I reverted the inital fix since I found a better solution. If you now call problem.x_priors it behaves exactly as problem.objective, which is the behaviour I would expect (wrt fixed parameters etc.).

arrjon commented 2 months ago

After discussion, @PaulJonasJost and I removed the deepcopy of the NegLogParameterPriors class. Otherwise, copying the prior does not work. This happens in the parallel tempering sampler, when the prior is copied to the different chains.