probabilistic_model.learning.region_graph.region_graph#
Classes#
A region in a region graph. |
|
A partition in a region graph. |
|
A region graph is a directed acyclic bipartite graph that represents a (potentially repeated) partition of variables. |
Module Contents#
- class probabilistic_model.learning.region_graph.region_graph.Region(variables: sortedcontainers.SortedSet)#
A region in a region graph.
- variables: sortedcontainers.SortedSet#
- __hash__() int#
- random_partition(k=2) typing_extensions.List[typing_extensions.Self]#
- __repr__() str#
- class probabilistic_model.learning.region_graph.region_graph.Partition#
A partition in a region graph.
- __hash__() int#
- class probabilistic_model.learning.region_graph.region_graph.RegionGraph(variables: sortedcontainers.SortedSet, partitions: int = 2, depth: int = 2, repetitions: int = 2, classes: int = 1)#
Bases:
networkx.DiGraphA region graph is a directed acyclic bipartite graph that represents a (potentially repeated) partition of variables. Bluntly speaking, a region graph is an ensemble of random Latent-Variable trees.
- variables: sortedcontainers.SortedSet#
The variables of the region graph.
- classes: int#
The number of classes. If classes > 1, the circuit is a classifier, if 1 it is a generative model.
- partitions: int#
The number of partitions to create in each region.
- depth: int#
The depth of each repetition of the region graph.
- repetitions: int#
The number of repetitions to create in the region graph. A repetition is another partitioning on the set of variables.
- create_random_region_graph()#
Create a random region graph according to the classes parameters in-place.
- recursive_split(node: Region)#
Recursively split a region into partitions.
- Parameters:
node – The node to start inducing from.
- as_probabilistic_circuit(input_units: int = 5, sum_units: int = 5, key=jax.random.PRNGKey(69)) typing_extensions.Union[probabilistic_model.probabilistic_circuit.jax.probabilistic_circuit.ProbabilisticCircuit, probabilistic_model.probabilistic_circuit.jax.probabilistic_circuit.ClassificationCircuit]#
Convert the region graph to a jax probabilistic circuit. :param input_units: The number of input units to use in each input layer. :param sum_units: The number of sum units to use in each sum layer. :param key: The random key to use for all trainable parameters. :return: The layered circuit in jax.