def test_normalize_1D(): A = np.random.rand(2) + 1.0 for axis in range(1): Anorm = mixture.normalize(A, axis) assert np.all(np.allclose(Anorm.sum(axis), 1.0))
def test_normalize_3D(): A = rng.rand(2, 2, 2) + 1.0 for axis in range(3): Anorm = mixture.normalize(A, axis) assert np.all(np.allclose(Anorm.sum(axis), 1.0))
def test_normalize_3D(): A = np.random.rand(2, 2, 2) + 1.0 for axis in range(3): Anorm = mixture.normalize(A, axis) assert np.all(np.allclose(Anorm.sum(axis), 1.0))