Beispiel #1
0
def distribution_of(model):
    """Returns a normalised factor representing the joint instantiation
    of the model.
    """

    dist = Factor(data=[1], domain=model)
    for f in model.factors():
        dist *= f
    dist.broadcast(frozenset(model.variables()))
    dist /= dist.z()
    return dist
Beispiel #2
0
def distribution_of(model):
    """Returns a normalised factor representing the joint instantiation
    of the model.
    """

    dist = Factor(data=[1],domain=model)
    for f in model.factors():
        dist *= f
    dist.broadcast(frozenset(model.variables()))
    dist /= dist.z()
    return dist