Skip to content

Stats from component samplers are lost with Gibbs #2766

@penelopeysm

Description

@penelopeysm

Turing.jl/src/mcmc/gibbs.jl

Lines 323 to 335 in 37af7fd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions