![]() |
Quantum Fog
0.9.3
|
Public Member Functions | |
def | __init__ (self, bnet, do_print=False, is_quantum=False) |
def | get_unipot_list (self, node_list) |
def | global_propagation (self) |
def | pass_message (self, from_clique, to_clique, sepset) |
def | collect_evidence (self, from_clique, to_clique, sepset, clique_counter=1) |
def | distribute_evidence (self, cur_clique, clique_counter=1) |
![]() | |
def | __init__ (self, bnet, do_print=False, is_quantum=False) |
Public Attributes | |
jtree | |
![]() | |
bnet | |
do_print | |
is_quantum | |
Additional Inherited Members | |
![]() | |
def | print_annotated_story (annotated_story) |
Our implementation of the Join Tree (or Junction Tree) inference algorithm follows very closely the very detailed and clear reference: "Belief Networks: A Procedural Guide" By Cecil Huang an Adnan Darwiche ( 1996). As far as I know, the Join Tree algorithm has only been used in the past for CBnets, but this computer program applies it to both CBnets and QBnets with only a few modifications and no hitches. Most of the steps of the algorithm are topological (or graph theoretic) in nature and those steps apply to both the CBnet and QBnet cases. The main difference between CBnets and QBnets arises whenever taking the norm of a potential is required and there one simply uses the 1-norm for classical and the 2-norm for quantum. This algorithm first creates a MoralGraph, then a TriangulatedGraph, then a JoinTree. A list of UniPots is then computed after performing a global propagation on the JoinTree. Attributes ---------- jtree : JoinTree bnet : BayesNet do_print : bool is_quantum : bool
def inference.JoinTreeEngine.JoinTreeEngine.__init__ | ( | self, | |
bnet, | |||
do_print = False , |
|||
is_quantum = False |
|||
) |
Constructor Parameters ---------- bnet : BayesNet do_print : bool is_quantum : bool Returns -------
def inference.JoinTreeEngine.JoinTreeEngine.collect_evidence | ( | self, | |
from_clique, | |||
to_clique, | |||
sepset, | |||
clique_counter = 1 |
|||
) |
Pass messages from outern cliques towards the start clique. Parameters ---------- from_clique : Clique | None to_clique : Clique sepset : Sepset | None clique_counter : int Returns ------- None
def inference.JoinTreeEngine.JoinTreeEngine.distribute_evidence | ( | self, | |
cur_clique, | |||
clique_counter = 1 |
|||
) |
Pass messages away from the start clique. Parameters ---------- cur_clique : Clique clique_counter : int Returns ------- None
def inference.JoinTreeEngine.JoinTreeEngine.get_unipot_list | ( | self, | |
node_list | |||
) |
For each node in node_list, this method returns a uni-potential that gives the probabilities for the states of that node. Obviously, such a PD has the active states of the node as support. Parameters ---------- node_list : list[BayesNode] Returns ------- list[DiscreteUniPot]
def inference.JoinTreeEngine.JoinTreeEngine.global_propagation | ( | self | ) |
Given the JoinTree, this method does all the calculations necessary to give the cliques amd sepsets a potential suitable for marginalization. Returns ------- None
def inference.JoinTreeEngine.JoinTreeEngine.pass_message | ( | self, | |
from_clique, | |||
to_clique, | |||
sepset | |||
) |
Pass a message from 'from_clique' to 'to_clique' connected by 'sepset' Parameters ---------- from_clique : Clique to_clique : Clique sepset : Sepset Returns ------- None