Ejemplo n.º 1
0
    def test_inverse_transform_spd(self):
        point = spd.SPDMatrices(3).random_uniform(10)
        transformer = ToTangentSpace(geometry=spd.SPDMetricLogEuclidean(3))
        X = transformer.fit_transform(X=point)
        result = transformer.inverse_transform(X)
        expected = point
        self.assertAllClose(expected, result, atol=1e-4)

        transformer = ToTangentSpace(geometry=spd.SPDMetricAffine(3))
        X = transformer.fit_transform(X=point)
        result = transformer.inverse_transform(X)
        expected = point
        self.assertAllClose(expected, result, atol=1e-4)
Ejemplo n.º 2
0
 def test_inverse_transform_hyperbolic(self):
     points = self.hyperbolic.random_uniform(10)
     transformer = ToTangentSpace(geometry=self.hyperbolic.metric)
     X = transformer.fit_transform(X=points)
     result = transformer.inverse_transform(X)
     expected = points
     self.assertAllClose(expected, result)
Ejemplo n.º 3
0
 def test_fit_transform_hyperbolic(self):
     point = gs.array([2., 1., 1., 1.])
     points = gs.array([point, point])
     transformer = ToTangentSpace(geometry=self.hyperbolic.metric)
     result = transformer.fit_transform(X=points)
     expected = gs.zeros_like(points)
     self.assertAllClose(expected, result)