minaskar / zeus

⚡️ zeus: Lightning Fast MCMC ⚡️
https://zeus-mcmc.readthedocs.io/
GNU General Public License v3.0
225 stars 34 forks source link

Can I resume jobs with the same Zeus sampler? #14

Closed Jammy2211 closed 3 years ago

Jammy2211 commented 3 years ago

I am looking to make it so that I can cancel a Python script mid-run and then resume the job. With Emcee, I do this via the backend feature.

I want to have access to all the previous chains and samples so that I can use previously computed autocorrelation times, and whatnot. So simply passing the previous chains to a new instance of the sampler doesn't quite cut it.

Does Zeus have a specific feature that support resuming jobs? If not, no problem, I can achieve the desired effect via pickling the EnsembleSampler (I hope!). couldn't find anything in the docs, but figured I'd ask before writing code to do this.

minaskar commented 3 years ago

If you mean to cancel the script using keyboard interrupt then this feature that you described is not supported (yet).

However, there're probably ways to what you want e.g. using the sample method or pickling the sampler as you mentioned.

Jammy2211 commented 3 years ago

Got pickling working thanks, but I look forward to h5py support!