DataClassModel
DataClassModel#
- class liesel.goose.models.DataClassModel(log_prob_fn)[source]#
Bases:
object
A model interface for a model state represented by a
dataclass
and a corresponding log-probability function.Methods
extract_position
(position_keys, model_state)Extracts the position from the model state given a sequence of position keys.
log_prob
(model_state)Computes the unnormalized log-probability given the model state.
update_state
(position, model_state)Updates the model state with the values in the position.