MHKernel#
- class liesel.goose.MHKernel(position_keys, proposal_fn, initial_step_size=1.0, da_tune_step_size=False, da_target_accept=0.234, da_gamma=0.05, da_kappa=0.75, da_t0=10, identifier='')[source]#
Bases:
ModelMixin,TransitionMixin[RWKernelState,DefaultTransitionInfo],ReprMixinA Metropolis-Hastings kernel implementing the
Kernelprotocol.The user needs to provide a proposal function that proposes a new state and the log_correction.
If
da_tune_step_sizeisTruethe stepsize passed as an argument to the proposal function is tuned using the dual averging algorithm. Step size is tuned on the fly during all adaptive epochs.Methods
end_epoch(prng_key, kernel_state, ...)Sets the step size as found by the dual averaging algorithm.
end_warmup(prng_key, kernel_state, ...)Currently does nothing.
init_state(prng_key, model_state)Initializes the kernel state.
start_epoch(prng_key, kernel_state, ...)Resets the state of the dual averaging algorithm.
tune(prng_key, kernel_state, model_state, epoch)Currently does nothing.
Attributes
Dict of error codes and their meaning.
Kernel identifier, set by
EngineBuilderWhether this kernel needs its history for tuning.
Tuple of position keys handled by this kernel.