コード例 #1
0
 def test_projection_and_belongs(self):
     gs.random.seed(4)
     shape = (self.n_samples, self.n, self.n)
     result = helper.test_projection_and_belongs(
         self.group, shape, gs.atol * 100)
     for res in result:
         self.assertTrue(res)
コード例 #2
0
 def test_projection_and_belongs(self):
     """Test of projection method."""
     shape = (2, self.m, self.n)
     result = helper.test_projection_and_belongs(self.space,
                                                 shape,
                                                 atol=gs.atol)
     for res in result:
         self.assertTrue(res)
コード例 #3
0
 def test_projection_and_belongs_matrix(self):
     space = self.space_matrix
     shape = (2, len(space.manifolds), space.manifolds[0].dim + 1)
     result = helper.test_projection_and_belongs(space,
                                                 shape,
                                                 atol=gs.atol * 100)
     for res in result:
         self.assertTrue(res)
コード例 #4
0
 def test_projection_and_belongs_vector(self):
     space = self.space_vector
     shape = (2, space.dim + 2)
     result = helper.test_projection_and_belongs(space,
                                                 shape,
                                                 atol=gs.atol * 100)
     for res in result:
         self.assertTrue(res)
コード例 #5
0
    def test_projection_and_belongs(self):
        """Test projection and belongs.

        Check that result of projection belongs to the space of
        Dirichlet distributions."""
        shape = (self.n_samples, self.dim)
        result = helper.test_projection_and_belongs(self.dirichlet, shape)
        for res in result:
            self.assertTrue(res)
コード例 #6
0
ファイル: test_hyperbolic.py プロジェクト: xpennec/geomstats
    def test_projection_and_belongs(self):
        shape = (self.n_samples, self.dimension + 1)
        result = helper.test_projection_and_belongs(
            self.space, shape, atol=gs.atol * 100
        )
        for res in result:
            self.assertTrue(res)

        point = gs.array([0.0, 1.0, 0.0, 0.0])
        projected = self.space.projection(point)
        result = self.space.belongs(projected)
        self.assertTrue(result)
コード例 #7
0
 def test_projection_and_belongs(self):
     result = helper.test_projection_and_belongs(
         self.product, shape=(3, 2, 3, 3), atol=1e-4
     )
     for res in result:
         self.assertTrue(res)
コード例 #8
0
 def test_projection_and_belongs(self):
     shape = (self.n_samples, self.n + 1, self.n + 1)
     result = helper.test_projection_and_belongs(self.group, shape)
     for res in result:
         self.assertTrue(res)
コード例 #9
0
 def test_projection_and_belongs(self):
     shape = (self.n_samples, self.n, self.p)
     result = helper.test_projection_and_belongs(self.space, shape)
     for res in result:
         self.assertTrue(res)
コード例 #10
0
 def test_projection_and_belongs(self):
     shape = (2, self.n, self.n)
     space = self.space
     result = helper.test_projection_and_belongs(space, shape)
     for res in result:
         self.assertTrue(res)