pyjuice.structures.RAT_SPN
- pyjuice.structures.RAT_SPN(num_vars: int, num_latents: int, depth: int, num_repetitions: int, num_pieces: int = 2, input_dist: Optional[Distribution] = None, input_node_type: Type[Distribution] = <class 'pyjuice.nodes.distributions.categorical.Categorical'>, input_node_params: dict = {'num_cats': 256}, block_size: Optional[int] = None, sum_edge_ids_constructor: Optional[Callable] = None)
Generate Random and Tensorized SPNs (https://proceedings.mlr.press/v115/peharz20a/peharz20a.pdf)
- Parameters:
num_vars (int) – number of variables
num_latents (int) – size of the latent space
depth (int) – splitting depth of variable scopes
num_repetitions (int) – number of random splits
num_pieces (int) – the number of sub-scopes splitted from any scope
input_dist (Distribution) – input distribution
block_size (int) – block size
sum_edge_ids_constructor (Callable) – optional helper functions to create special edge patterns (e.g., block-sparse)