def test_true_kldiv(self): f = eKLdiv(self.x, self.y, 3000000) g = true_kldiv(self.mux, self.muy, self.sigx, self.sigy) self.assertAlmostEqual( f, g, 2, 'failed to generate similar answers, f:%f, g:%f' % (f, g))
def test_random_true_kldiv(self): y = self.y + np.random.uniform(-1, 1, 3) f = eKLdiv(self.x, y, 3000000) g = true_kldiv(self.mux, y.mus[0], self.sigx, y.sigmas[0]) self.assertAlmostEqual( f, g, 2, 'failed to generate similar answers, f:%f, g:%f' % (f, g))
def testRandomTrueKLdiv(self): y = self.y + np.random.uniform(-1, 1, 3) f = eKLdiv(self.x, y, 3000000) g = true_kldiv(self.mux, y.mus[0], self.sigx, y.sigmas[0]) self.assertAlmostEqual( f, g, 2, 'fialed to generate simialr ansers, f:%f, g:%f' % (f, g))
def testTrueKLdiv(self): f = eKLdiv(self.x, self.y, 3000000) g = true_kldiv(self.mux, self.muy, self.sigx, self.sigy) self.assertAlmostEqual( f, g, 2, 'fialed to generate simialr ansers, f:%f, g:%f' % (f, g))