Bayesian extend/resume#257
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #257 +/- ##
===========================================
+ Coverage 82.92% 83.30% +0.37%
===========================================
Files 62 63 +1
Lines 5084 5253 +169
===========================================
+ Hits 4216 4376 +160
- Misses 868 877 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
compatibility for resampling API
damskii9992
left a comment
There was a problem hiding this comment.
Just gonna stop my review here as there is already plenty to work on.
As we discussed in-person, I also think we should refactor the bayesian sampling to a seperate "samplers" module. This should help us when we add other Bayesian samplers in the future as well as provide a cleaner user API (the user doesn't create a "Fitter" when doing sampling).
It also more cleanly separates responsibility in the code. A Minimizer minimizes a function to the data, a Sampler samples the parameters to create distributions.
To avoid duplicating code, it might be smart to move shared functionality to new base-classes.
Support for resuming and extending Bayesian MCMC chains using the BUMPS DREAM sampler.
Added ability to save and reload sampler state and continue chains across sessions.
Resume and extend MCMC chains:
resume_stateparameter tomcmc_sampleandsamplemethods in bothfitter.pyandminimizer_bumps.py, allowing users to continue sampling from a saved chain state. This includes documentation of the "ring-buffer contract" for extending chains without losing samples.Population/chains argument resolution:
_resolve_population_aliasmethod to handle bothchainsandpopulationarguments, raising an error if both are set with different values, improving API clarity and preventing silent bugs.