astro-informatics / harmonic

Machine learning assisted marginal likelihood (Bayesian evidence) estimation for Bayesian model selection
https://astro-informatics.github.io/harmonic/
GNU General Public License v3.0
57 stars 7 forks source link

Add functionality within the Evidence class to add chains from Chain class instance sequentially #283

Closed alicjapolanska closed 9 months ago

alicjapolanska commented 9 months ago

Large Chain objects may cause memory issues when computing evidence. Would be nice to have a functionality within the Evidence class to add chains sequentially or in batches to avoid this without needing to create a new Chains instance.

jasonmcewen commented 9 months ago

Don't we have that already @alicjapolanska with the add_chains method (here)?

alicjapolanska commented 9 months ago

@jasonmcewen You're right, we can add more samples per chain in add_chains. I got confused as I was expecting it to allow to add individual chains sequentially as I had in mind, which it doesn't. But it still allows to reduce the memory usage as you pointed out by adding more samples to added chains sequentially.