Exemplo n.º 1
0
 def test_normalize_with_axis_3D(self):
     A = np.random.rand(10, 4, 5) + 1.0
     for axis in range(3):
         Anorm = gmm.normalize(A, axis)
         self.assertTrue(np.all(np.allclose(Anorm.sum(axis), 1.0)))
Exemplo n.º 2
0
def test_normalize_3D():
    A = np.random.rand(2, 2, 2) + 1.0
    for axis in range(3):
        Anorm = gmm.normalize(A, axis)
        assert np.all(np.allclose(Anorm.sum(axis), 1.0))
Exemplo n.º 3
0
 def test_normalize_2D(self):
     A = np.random.rand(10, 4) + 1.0
     Anorm = gmm.normalize(A)
     self.assertAlmostEqual(Anorm.sum(), 1.0)