TuringLang / AbstractMCMC.jl

Abstract types and interfaces for Markov chain Monte Carlo methods
https://turinglang.org/AbstractMCMC.jl
MIT License
78 stars 18 forks source link

`sample` which takes in an initial state #109

Open torfjelde opened 1 year ago

torfjelde commented 1 year ago

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

yebai commented 1 year ago

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

yebai commented 1 year ago

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).

torfjelde commented 1 year ago

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?

devmotion commented 1 year ago

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?).