|
vi, states = gibbs_initialstep_recursive( |
|
rng, |
|
model, |
|
AbstractMCMC.step, |
|
varnames, |
|
samplers, |
|
vi; |
|
initial_params=initial_params, |
|
kwargs..., |
|
) |
|
transition = discard_sample ? nothing : DynamicPPL.ParamsWithStats(vi, model) |
|
return transition, GibbsState(vi, states) |
|
end |
Here Gibbs returns a ParamsWithStats that only has parameters but no stats. In principle, it should aggregate stats from all component samplers, combine them into a single NamedTuple and return them.
This is incredibly annoying though because stats are provided via component samplers' transitions, not states, and #2759 makes sure that we don't actually use the parameters in component samplers' transitions, because that often requires reevaluating the model. Very, very annoying. The solution to this is to unify transitions and states, see TuringLang/AbstractMCMC.jl#149, but, mehhhhhh.
Turing.jl/src/mcmc/gibbs.jl
Lines 323 to 335 in 37af7fd
Here Gibbs returns a ParamsWithStats that only has parameters but no stats. In principle, it should aggregate stats from all component samplers, combine them into a single NamedTuple and return them.
This is incredibly annoying though because stats are provided via component samplers' transitions, not states, and #2759 makes sure that we don't actually use the parameters in component samplers' transitions, because that often requires reevaluating the model. Very, very annoying. The solution to this is to unify transitions and states, see TuringLang/AbstractMCMC.jl#149, but, mehhhhhh.