AbstractMCMC.jl icon indicating copy to clipboard operation
AbstractMCMC.jl copied to clipboard

`sample` which takes in an initial state

Open torfjelde opened this issue 3 years ago • 4 comments

It would be nice to move have something similar to resume_from that we have in DPPL (https://github.com/TuringLang/DynamicPPL.jl/blob/217b8cc3a0fbee96049b90a53f5db9f2a586ba96/src/sampler.jl#L84-L95) in AbstractMCMC.

In particular, by default, it shouldn't be an issue to just make

loadstate(state) = state

assuming that the resume_from corresponds to the sampler state.

Thoughts @devmotion @cpfiffer @yebai ?

CC: @HarrisonWilde

torfjelde avatar Nov 17 '22 15:11 torfjelde

I think it is a useful feature for all samplers, which would fit nicely here.

yebai avatar Nov 17 '22 16:11 yebai

To slightly widen the scope of this issue, we can also consider saving/restoring sampler states (e.g. step-size and preconditioning matrix of HMC).

yebai avatar Nov 17 '22 16:11 yebai

To slightly widen the scope of this issue, we can also consider saving/restoring sampler states (e.g. step-size and preconditioning matrix of HMC).

Saving in what sense? This would all be included in the state, no?

torfjelde avatar Nov 17 '22 17:11 torfjelde

Yes, I think that's one of the things that could/should be moved from DynamicPPL/Turing to AbstractMCMC (maybe I misremember but it feels like there was also some discussion in some issue or PR a while ago?).

devmotion avatar Nov 17 '22 18:11 devmotion