pyjuice.structures.GeneralizedHMM
- pyjuice.structures.GeneralizedHMM(seq_length: int, num_latents: int, homogeneous: bool = True, block_size: Optional[int] = None, alpha: Optional[torch.Tensor] = None, beta: Optional[torch.Tensor] = None, gamma: Optional[torch.Tensor] = None, input_dist: Optional[Distribution] = None, input_node_type: Type[Distribution] = <class 'pyjuice.nodes.distributions.categorical.Categorical'>, input_node_params: dict = {}, sum_edge_ids_constructor: Optional[Callable] = None)
Constructs Hidden Markov Models.
- Parameters:
seq_length (int) – sequence length
num_latents (int) – size of the latent space
num_emits (int) – size of the emission space
homogeneous (bool) – whether to define a homogeneous (or inhomogeneous) HMM
block_size (Optional[int]) – block size of the PC
alpha (Optional[torch.Tensor]) – optional transition parameters of size [num_latents, num_latents]
beta (Optional[torch.Tensor]) – optional emission parameters of size [num_latents, num_emits]
gamma (Optional[torch.Tensor]) – optional init parameters of size [num_latents]
sum_edge_ids_constructor (Callable) – optional helper functions to create special edge patterns (e.g., block-sparse)