Closed Schaechtle closed 4 years ago
No memo argument is currently accepted for spn.mutual_information. This can be fixed by changing spn.mutual_information to:
spn.mutual_information
def mutual_information(self, A, B, memo=None): # p11 = self.logprob(A & B) # p10 = self.logprob(A & ~B) # p01 = self.logprob(~A & B) # p00 = self.logprob(~A & ~B) lpA1 = self.logprob(A, memo=memo) lpB1 = self.logprob(B, memo=memo) lpA0 = logdiffexp(0, lpA1) lpB0 = logdiffexp(0, lpB1) lp00 = self.logprob(~A & ~B, memo=memo) lp01 = self.logprob(~A & B, memo=memo) lp10 = self.logprob(A & ~B, memo=memo) lp11 = self.logprob(A & B, memo=memo) m00 = exp(lp00) * (lp00 - (lpA0 + lpB0)) if not isinf_neg(lp00) else 0 m01 = exp(lp01) * (lp01 - (lpA0 + lpB1)) if not isinf_neg(lp01) else 0 m10 = exp(lp10) * (lp10 - (lpA1 + lpB0)) if not isinf_neg(lp10) else 0 m11 = exp(lp11) * (lp11 - (lpA1 + lpB1)) if not isinf_neg(lp11) else 0 return m00 + m01 + m10 + m11
No memo argument is currently accepted for
spn.mutual_information
. This can be fixed by changingspn.mutual_information
to: