def P(self): """ Compute the probability of each edge. """ P = logistic(self.Mu) # Clip P so that it is never exactly 1 or 0 P = np.clip(P, 1e-16, 1-1e-16) return P
def mf_expected_log_notp(self): """ Compute the expected log probability of a connection under Z :return: """ Ps = logistic(self.mf_sample_mus()) Ps = np.clip(Ps, 1e-16, 1-1e-16) return np.log(1-Ps).mean(0)