

def loglikelihood(self, net):
    'Returns the log likelihood of the given network.\n        \n        Similar to the loglikelihood method of a Conditional Probability\n        Distribution.  \n        \n        '
    adjmat = net.edges.adjacency_matrix
    if ((not (adjmat | self.mustexist).all()) or (adjmat & self.mustnotexist).any()):
        return NEGINF
    if (self.constraints and (not all((c(adjmat) for c in self.constraints)))):
        return NEGINF
    loglike = 0.0
    if (self.energy_matrix != None):
        energy = N.sum((adjmat * self.energy_matrix))
        loglike = ((- self.weight) * energy)
    return loglike

dataset/ETHPy150Open abhik/pebl/src/pebl/prior.py Prior.loglikelihood/original