Example #1
0
 def test_normalize_frequency_locations_3D(self):
     """Test the output of the normalize frequency methods and check that it
     is indeed within [-0.5; 0.5[
     """
     for _ in range(10):
         samples = np.random.randn(128 * 128, 3)
         normalized_samples = normalize_frequency_locations(samples)
         self.assertTrue((normalized_samples < 0.5).all()
                         and (normalized_samples >= -0.5).all())
     print(" Test normalization function for 3D input passes")
Example #2
0
 def test_normalize_frequency_locations_2D(self):
     """Test the output of the normalize frequency methods and check that it
     is indeed between [-0.5; 0.5[
     """
     for _ in range(10):
         samples = np.random.randn(128 * 128, 2)
         normalized_samples = normalize_frequency_locations(samples)
         self.assertFalse((normalized_samples.all() < 0.5
                           and normalized_samples.all() >= -0.5))
     print(" Test normalization function for 2D input passes")