MarkovChainModel¶
- class pycave.bayes.markov_chain.MarkovChainModel(config)[source]¶
Bases:
Configurable
[MarkovChainModelConfig
],Module
PyTorch module for a Markov chain.
The initial state probabilities as well as the transition probabilities are non-trainable parameters.
- Parameters:
config (
MarkovChainModelConfig
) -- The configuration to use for initializing the module's buffers.
Methods
Computes the log-probability of observing each of the provided sequences. |
|
Resets the parameters of the Markov model. |
|
Samples random sequences from the Markov chain. |
|
Computes the stationary distribution of the Markov chain using power iteration. |
Inherited Methods
Loads the module's configurations and parameters from files in the specified directory at first. |
|
Saves the module's configuration and parameters to files in the specified directory. |
Attributes
|
The probabilities for the initial states, buffer of shape |
|
The transition probabilities between all states, buffer of shape |