def test_logsum_with_axis_3D(self): A = np.random.rand(10, 4, 5) + 1.0 for axis in range(3): Asum = gmm.logsum(A, axis) assert_array_almost_equal(np.exp(Asum), np.sum(np.exp(A), axis))
def test_logsum_2D(self): A = np.random.rand(10, 4) + 1.0 Asum = gmm.logsum(A) self.assertAlmostEqual(np.exp(Asum), np.sum(np.exp(A)))