pyjuice.structures.PDHCLT

pyjuice.structures.PDHCLT(data: ~torch.Tensor, data_shape: ~typing.Tuple, num_latents: int, split_intervals: int | ~typing.Tuple[int] | None = None, split_points: ~typing.Sequence[~typing.Sequence[int]] | None = None, max_split_depth: int | None = None, max_prod_block_conns: int = 4, structure_type: str = 'sum_dominated', input_dist: ~pyjuice.nodes.distributions.distributions.Distribution | None = None, input_node_type: ~typing.Type[~pyjuice.nodes.distributions.distributions.Distribution] = <class 'pyjuice.nodes.distributions.categorical.Categorical'>, input_node_params: ~typing.Dict = {'num_cats': 256}, hclt_kwargs: ~typing.Dict = {'chunk_size': 32, 'num_bins': 32, 'sigma': 0.015625}, block_size: int | None = None)

Generate a PD-structured PC (see PD()) whose leaf regions are modeled by data-dependent HCLTs (see HCLT()) instead of plain input distributions. This combines the PD region structure over (e.g., image) dimensions with the expressive, data-informed leaves of HCLT.

Parameters:
  • data (torch.Tensor) – training data of size [N, num_vars] used to build the per-region HCLTs; num_vars must equal the product of data_shape

  • data_shape (Tuple) – shape of the data (e.g., [H, W, 3] for images and [S] for sequences)

  • num_latents (int) – size of the latent space

  • split_intervals (Optional[Union[int, Tuple[int]]]) – the interval between split points in every dimension; either this or split_points needs to be specified

  • split_points (Optional[Sequence[Sequence[int]]]) – a sequence of split points in each dimension; either this or split_intervals needs to be specified

  • hclt_kwargs (Dict) – keyword arguments forwarded to the per-region HCLT() construction

  • block_size (Optional[int]) – block size of the PC