Exemple #1
0
 def test_transformation_float(self, x, params):
     a, b = params
     transformed_x = (0.5 * np.square(a) * x[:, 2] + b * x[:, 2] + 1) * x[:,
                                                                          0]
     transformed_y = (0.5 * np.square(a) * x[:, 2] + b * x[:, 2] + 1) * x[:,
                                                                          1]
     transformed_z = x[:, 2]
     expected = np.stack([transformed_x, transformed_y, transformed_z],
                         axis=1)
     transformation = TaperingZ()
     actual = transformation.transform(x, params)
     self.assertAlmostEqualNumpy(expected, actual)
Exemple #2
0
 def test_transformation_interval(self, x, params):
     transformation = TaperingZ()
     actual = transformation.transform(x, params)
     self.assertSound(actual, params, partial(transformation.transform, x))