Quantum Fog  0.9.3
Public Member Functions | Static Public Member Functions | List of all members
graphs.JoinTree.JoinTree Class Reference
Inheritance diagram for graphs.JoinTree.JoinTree:
Inheritance graph
[legend]
Collaboration diagram for graphs.JoinTree.JoinTree:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, tri_gra, bnet)
 
def set_clique_and_sepset_pots_to_one (self, is_quantum)
 
def init_clique_potentials_with_bnet_info (self)
 
def mask_clique_potentials (self)
 
def describe_yourself (self)
 
- Public Member Functions inherited from graphs.Graph.Graph
def __init__ (self, nodes)
 
def add_nodes (self, nodes)
 
def has_node (self, node)
 
def contains (self, nodes)
 
def unmark_all_nodes (self)
 
def get_node_named (self, name)
 
def get_node_with_id_num (self, id_num)
 
def get_node_with_topo_index (self, topo_index)
 
def get_nx_graph (self)
 
def draw (self, algo_num, kwargs)
 
def write_dot (self, path)
 
def read_dot (cls, path)
 

Static Public Member Functions

def get_bnet_cliques (tri_graph, bnet)
 
def get_clique_owner (subgraphs, clique)
 
def merge_subgraphs (sepset, strong_g, weak_g)
 
- Static Public Member Functions inherited from graphs.Graph.Graph
def new_from_nx_graph (nx_graph)
 

Additional Inherited Members

- Public Attributes inherited from graphs.Graph.Graph
 nodes
 

Detailed Description

JoinTree is the final undirected graph that is constructed for
JoinTreeEngine. The nodes of a JoinTree are cliques. Cliques are
themselves sets of subnodes. The cliques are determined in a previous
step which involves building a TriangulatedGraph. The Sepset's (
separation sets) are not nodes of the JoinTree graph. A clique stores a
sepset for each clique adjacent to it.

Attributes
----------
nodes : set[Node]

Constructor & Destructor Documentation

def graphs.JoinTree.JoinTree.__init__ (   self,
  tri_gra,
  bnet 
)
Constructor


Parameters
----------
tri_gra : TriangulatedGraph
bnet : BayesNet

Returns
-------

Member Function Documentation

def graphs.JoinTree.JoinTree.describe_yourself (   self)
Prints a pretty summary of the attributes of self.

Returns
-------
def graphs.JoinTree.JoinTree.get_bnet_cliques (   tri_graph,
  bnet 
)
static
The TriangulatedGraph returns cliques whose subnodes are COPIES of
the nodes in the original Bnet. This method swaps the subnodes of
each clique by the original bnet nodes, the real McCoy. This method
modifies tri_graph (stomps on it) now that it has already served its
purpose of finding the cliques.

Parameters
----------
tri_graph : TriangulatedGraph
bnet : BayesNet

Returns
-------
list[Clique]
def graphs.JoinTree.JoinTree.get_clique_owner (   subgraphs,
  clique 
)
static
From a list of subgraphs called 'subgraphs', find a subgraph that
contains the nodes of clique.

Parameters
----------
subgraphs : list[Graph]
clique : Clique

Returns
-------
Graph
def graphs.JoinTree.JoinTree.init_clique_potentials_with_bnet_info (   self)
Once the Clique potentials have been set to one, multiply them times
the conditional PDs or conditional PADs of the nodes of the CBnet or
QBnet. A clique accepts only the PD or PAD of those nodes that
contain all their family inside that clique. abbreviations in
MyConstants.py.

Returns
-------
None
def graphs.JoinTree.JoinTree.mask_clique_potentials (   self)
Masks clique potentials assuming they have been constructed already.

Returns
-------
None
def graphs.JoinTree.JoinTree.merge_subgraphs (   sepset,
  strong_g,
  weak_g 
)
static
This merges two JoinTree subgraphs called strong_g and weak_g and
labels the merged result strong_g. (That is why it is called
strong_g; because it is the one of the 2 that survives). To link the
2 subgraphs, the two cliques in 'sepset' are made neighbors and
'sepset' is put into their sepset lists.

Parameters
----------
sepset : Sepset
strong_g : Graph
weak_g : Graph

Returns
-------
None
def graphs.JoinTree.JoinTree.set_clique_and_sepset_pots_to_one (   self,
  is_quantum 
)
This sets clique and sepset pots to 1 over all states of their
subnodes, not just over the active ones. If 1 over the active states
and 0 over the inactive ones is desired, next apply mask_self() to
the potential. is_quantum is needed because pot_arr will be type
float64 in the CBnet case and type complex128 in the QBnet case.

Parameters
----------
is_quantum : bool

Returns
-------
None

The documentation for this class was generated from the following file: