Stopping and restarting sample_smc

I have such functionality in my package beat here: GitHub - hvasbath/beat: Bayesian Earthquake Analysis Tool
As I have the same problem with long forward model runtimes. It relies on an early version of pymc3 3.4.1

beat.sampler.smc.smc_sample would be the function of your choice …
that takes a step object (beat.sampler.SMC) which also has a backend attribute either ‘csv’ or ‘bin’
You should be able to use and import the sampler as you are used to from common pymc3 models.

in beat.backend there is also a Trace class that supports then restarting diagnostics and storing samples to the trace every n samples. You can easily read the source code to see how to use it… Let me know if you would like to dive into it.

See also here: Example 3: Rectangular source — beat 1.1 documentation
The sampling backends:
Sampling Backends — beat 1.1 documentation

You could try to port/use some of that functionality.

Cheers!

2 Likes