quimb.experimental.belief_propagation.regions

Classes

Module Contents

class quimb.experimental.belief_propagation.regions.RegionGraph(regions=(), autocomplete=True)
lookup
parents
children
counts
property regions
neighbor_regions(region)

Get all regions that intersect with the given region.

add_region(region)

Add a new region and update parent-child relationships.

Parameters:

region (Sequence[Hashable]) – The new region to add.

autocomplete()

Add all missing intersecting sub-regions.

autoextend(regions=None)

Extend this region graph upwards by adding in all pairwise unions of regions. If regions is specified, take this as one set of pairs.

get_parents(region)

Get all ancestors that contain the given region, but do not contain any other regions that themselves contain the given region.

get_children(region)

Get all regions that are contained by the given region, but are not contained by any other descendents of the given region.

get_ancestors(region)

Get all regions that contain the given region, not just direct parents.

get_descendents(region)

Get all regions that are contained by the given region, not just direct children.

get_count(region)

Get the count of the given region, i.e. the correct weighting to apply when summing over all regions to avoid overcounting.

get_total_count()
get_level(region)

Get the level of the given region, i.e. the distance to an ancestor with no parents.

draw(pos=None, a=20, scale=1.0, radius=0.1, **drawing_opts)
__repr__()