Пример #1
0
 def vertical_projection_tangent_submersion_test_data(self):
     random_data = []
     for n in self.n_list:
         bundle = CorrelationMatricesBundle(n)
         mat = bundle.random_point(2)
         vec = SymmetricMatrices(n).random_point(2)
         random_data.append(dict(n=n, vec=vec, mat=mat))
     return self.generate_tests([], random_data)
Пример #2
0
 def horizontal_projection_test_data(self):
     random_data = []
     for n in self.n_list:
         bundle = CorrelationMatricesBundle(n)
         mat = bundle.random_point()
         vec = bundle.random_point()
         random_data.append(dict(n=n, vec=vec, mat=mat))
     return self.generate_tests([], random_data)
Пример #3
0
 def log_after_align_is_horizontal_test_data(self):
     n_list = [2, 3]
     random_data = []
     for n in n_list:
         bundle = CorrelationMatricesBundle(n)
         point = bundle.random_point(2)
         random_data.append(dict(n=n, point_a=point[0], point_b=point[1]))
     return self.generate_tests([], random_data)
Пример #4
0
 def tangent_riemannian_submersion_test_data(self):
     random_data = []
     for n, n_samples in zip(self.n_list, self.n_samples_list):
         bundle = CorrelationMatricesBundle(n)
         mat = bundle.random_point()
         point = bundle.riemannian_submersion(mat)
         vec = bundle.random_point(n_samples)
         random_data.append(dict(n=n, vec=vec, point=point))
     return self.generate_tests([], random_data)
Пример #5
0
    def exp_belongs_test_data(self):

        bundle = CorrelationMatricesBundle(3)
        base_point = bundle.base.random_point()
        tangent_vec = bundle.base.to_tangent(bundle.random_point(), base_point)
        smoke_data = [
            dict(dim=3, tangent_vec=tangent_vec, base_point=base_point)
        ]
        return self.generate_tests(smoke_data)
Пример #6
0
 def vertical_projection_is_vertical_test_data(self):
     random_data = []
     for n, n_samples in zip(self.n_list, self.n_samples_list):
         bundle = CorrelationMatricesBundle(n)
         mat = bundle.random_point()
         vec = bundle.random_point(n_samples)
         tangent_vec = bundle.base.to_tangent(vec, mat)
         random_data.append(dict(n=n, tangent_vec=tangent_vec, mat=mat))
     return self.generate_tests([], random_data)
Пример #7
0
 def lift_riemannian_submersion_composition_test_data(self):
     random_data = []
     for n, n_samples in zip(self.n_list, self.n_samples_list):
         bundle = CorrelationMatricesBundle(n)
         point = bundle.base.random_point(n_samples)
         random_data.append(dict(n=n, point=point))
     return self.generate_tests([], random_data)
Пример #8
0
 def setup_method(self):
     gs.random.seed(12)
     n = 3
     self.n = n
     bundle = CorrelationMatricesBundle(n)
     self.bundle = bundle
     self.base = bundle.base
     self.quotient_metric = FullRankCorrelationAffineQuotientMetric(n)
Пример #9
0
    def horizontal_lift_and_tangent_riemannian_submersion_test_data(self):
        random_data = []
        for n, n_samples in zip(self.n_list, self.n_samples_list):
            bundle = CorrelationMatricesBundle(n)
            mat = bundle.base.random_point()
            vec = bundle.base.random_point(n_samples)
            tangent_vec = bundle.base.to_tangent(vec, mat)
            random_data.append(dict(n=n, tangent_vec=tangent_vec, mat=mat))

        return self.generate_tests([], random_data)
Пример #10
0
 def exp_log_composition_test_data(self):
     bundle = CorrelationMatricesBundle(3)
     point = bundle.riemannian_submersion(bundle.random_point(2))
     random_data = [dict(dim=3, point=point)]
     return self.generate_tests([], random_data)
 def test_exp_belongs(self, dim, tangent_vec, base_point):
     metric = self.metric(dim)
     exp = metric.exp(tangent_vec, base_point)
     self.assertAllClose(CorrelationMatricesBundle(dim).belongs(exp), True)