![]() |
Quantum Fog
0.9.3
|
Public Member Functions | |
def | __init__ (self, nodes, table=[], default=1) |
def | marginalize (self, other) |
def | normalize (self) |
def | generate_index_node (self, index, nodes) |
def | generate_index (self, index, axis) |
def | transpose (self, nodes) |
def | transpose_copy (self, nodes) |
def | __eq__ (self, other) |
def | __getitem__ (self, index) |
def | __setitem__ (self, index, value) |
def | __add__ (self, right) |
def | __iadd__ (self, right) |
def | __mul__ (self, right) |
def | __imul__ (self, right) |
def | __rmul__ (self, other) |
def | __truediv__ (self, other) |
def | __idiv__ (self, other) |
def | __deepcopy__ (self, memo) |
Public Attributes | |
nodes | |
dims | |
table | |
nDims | |
Private Attributes | |
__nodeSet_ | |
Potentials are very similar to a conditional distribution in that they specify the probability over a set of nodes. The difference is that potentials are not thought of as being centered on the value a one node given other nodes. Therefore, a conditional distribution could be thought of as a special case of a potential.
def PBNT.Distribution.Potential.__add__ | ( | self, | |
right | |||
) |
Pointwise addition of elements in self and right. Assumes that self and right are defined over the same nodes.
def PBNT.Distribution.Potential.__iadd__ | ( | self, | |
right | |||
) |
Pointwise addition of elements in self and right. Assumes that self and right are defined over the same nodes. This operator is called for in place addition +=.
def PBNT.Distribution.Potential.__idiv__ | ( | self, | |
other | |||
) |
Same as div, but operates on self in place.
def PBNT.Distribution.Potential.__imul__ | ( | self, | |
right | |||
) |
This is the same operation as __mul__ except that if right.nodes is a subset of self.nodes, we do the multiplication in place, because there is no reason to make a copy, which wastes time and space.
def PBNT.Distribution.Potential.__mul__ | ( | self, | |
right | |||
) |
A true multiplication of two potentials would be defined as X * Y = Z where the sets of variables z = x U y. We would then identify the instantiations of x and y that are consistent with z and Z(z) = X(x)Y(y). We are generally going to be multiplying sepset potentials by clique potentials where the variables of a setpset potential are a subset of the variables of the clique. Therefore we are going to assume in this operation that right's variables are a subset of self's.
def PBNT.Distribution.Potential.__truediv__ | ( | self, | |
other | |||
) |
ASSUMPTION: This is only defined for potentials over the same set of nodes. It is a pointwise division of each element within the potential.
def PBNT.Distribution.Potential.generate_index | ( | self, | |
index, | |||
axis | |||
) |
This function works hand in hand with __getitem__. It takes in a list of indices and a list of axes and generates an index in a format appropriate for __getitem__, which is currently generating strings which are then executed using eval.
def PBNT.Distribution.Potential.generate_index_node | ( | self, | |
index, | |||
nodes | |||
) |
Generates a list of axes that correspond to nodes, then calls generate_index with the newly generated list of axes.
def PBNT.Distribution.Potential.marginalize | ( | self, | |
other | |||
) |
Return a new potential that is the marginalization of this potential given other. This identifies the instantiations of self (s1,s2,...,sn) that are consistent with other and sum self(s1) + self(s2) + ... + self(sn).