GibbsKernel#

class liesel.goose.gibbs.GibbsKernel(position_keys, transition_fn)[source]#

Bases: liesel.goose.kernel.ModelMixin, liesel.goose.types.Kernel[Any, liesel.goose.kernel.DefaultTransitionInfo, liesel.goose.kernel.DefaultTuningInfo]

A Gibbs kernel implementing the Kernel protocol.

Methods

end_epoch(prng_key, kernel_state, ...)

Currently does nothing.

end_warmup(prng_key, kernel_state, ...)

Currently does nothing.

has_model()

Whether the model interface is set.

init_state(prng_key, model_state)

Initializes an (empty) kernel state.

log_prob_fn(model_state)

Returns the log-probability function with the position as the only argument.

position(model_state)

Extracts the position from a model state.

set_model(model)

Sets the model interface.

start_epoch(prng_key, kernel_state, ...)

Currently does nothing.

transition(prng_key, kernel_state, ...)

Performs an MCMC transition.

tune(prng_key, kernel_state, model_state, epoch)

Currently does nothing.

Attributes

error_book

Maps error codes to error messages.

identifier

An identifier for the kernel object that is set by the EngineBuilder if it is an empty string.

model

Returns the model interface if it is set.

needs_history

Is set to true if the kernel expects the history for tuning.

position_keys

Keys for which the kernel handles the transition.