def log_normalization(self): result = 0.0 for i in range(1, len(self.variables)): result += Gaussian.log_ratio_normalization(self.variables[i].value, self.messages[i].value) return result
def testLogRatioNormalization(self): m1s2 = Gaussian(1.0, 2.0) m3s4 = Gaussian(3.0, 4.0) lrn = Gaussian.log_ratio_normalization(m1s2, m3s4) answer = 2.6157405972171204 self.assertAlmostEqual(answer, lrn, None, "testLogRatioNormalization lrn expected %.15f, got %.15f" % (answer, lrn), GaussianDistributionTest.ERROR_TOLERANCE)
def testLogRatioNormalization(self): m1s2 = Gaussian(1.0, 2.0) m3s4 = Gaussian(3.0, 4.0) lrn = Gaussian.log_ratio_normalization(m1s2, m3s4) answer = 2.6157405972171204 self.assertAlmostEqual( answer, lrn, None, "testLogRatioNormalization lrn expected %.15f, got %.15f" % (answer, lrn), GaussianDistributionTest.ERROR_TOLERANCE)
def log_normalization(self): result = 0.0 for i in range(1, len(self.variables)): result += Gaussian.log_ratio_normalization(self.variables[i].value, self.messages[i].value) return result
def log_normalization(self): return Gaussian.log_ratio_normalization( self.variables[0].value, self.messages[0].value )
def log_normalization(self): return Gaussian.log_ratio_normalization(self.variables[0].value, self.messages[0].value)