Skip to content

Expose all DynamicHMC configuration options in DynamicNUTS #1938

Open
@sethaxen

Description

@sethaxen

Currently DynamicNUTS in https://github.com/TuringLang/Turing.jl/blob/master/src/contrib/inference/dynamichmc.jl doesn't expose most of the configuration options for DynamicHMC. The complete set of options (with defaults) is:

Of these, currently Turing sets the q field of initialization to some initial point; the rest of the options are left at the defaults:

results = DynamicHMC.mcmc_keep_warmup(
rng,
ℓ,
0;
initialization = (q = vi[spl],),
reporter = DynamicHMC.NoProgressReport(),
)
. It probably makes sense for reporter to be left at the default to not interfere with AbstractMCMC's own logging.

A good start might be to redefine:

struct DynamicNUTS{AD,space,I,W,A} <: Hamiltonian{AD}
    initialization::I
    warmup_stages::W
    algorithm::A
end

and add constructors for DynamicNUTS that populate the new fields with their defaults if not provided by the user. Then the above call to mcmc_keep_warmup needs to be updated to provide these keywords.

For reference, the SampleChainsDynamicHMC implementation at https://github.com/cscherrer/SampleChainsDynamicHMC.jl/blob/master/src/SampleChainsDynamicHMC.jl allows each of these configuration options to be specified.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions