TuringLang / AdvancedHMC.jl

Robust, modular and efficient implementation of advanced Hamiltonian Monte Carlo algorithms
https://turinglang.org/AdvancedHMC.jl/
MIT License
228 stars 39 forks source link

Initial `AbstractMCMC.step` should not sample #366

Open torfjelde opened 4 months ago

torfjelde commented 4 months ago

Generally speaking, the first AbstractMCMC.step should just construct the initial transition and state, not actually perform any sampling. If it performs sampling in the initial step, it becomes increasingly difficult to test that arguments such as initial_params and initial_state are properly respected (since we can't just compare the resulting initial_params with the ones produced by the first step). Moreover, it can hide certain behaviors from the user since a traceplot will show the "starting value" as something different than what they set.

This PR just makes the initial AbstractMCMC.step do exactly this.

Should be a quick merge. @devmotion @yebai @xukai92