3ef34a25874548e97d9a6e0aeeb2f4e71fb6c1fa,tests/test_special_euclidean_group.py,TestSpecialEuclideanGroupMethods,test_exp_vectorization,#TestSpecialEuclideanGroupMethods#,300

Before Change



    def test_exp_vectorization(self):
        n_samples = self.n_random_samples
        for metric in self.metrics.values():
            // Test with the 1 base_point, and several different tangent_vecs
            tangent_vecs = self.group.random_uniform(n_samples=n_samples)
            base_point = self.group.random_uniform(n_samples=1)

After Change


        // TODO(nina): this test fails
        n_samples = self.n_samples
        for metric_type in self.metrics:
            metric = self.metrics[metric_type]

            one_tangent_vec = self.group.random_uniform(n_samples=1)
            one_base_point = self.group.random_uniform(n_samples=1)
            n_tangent_vec = self.group.random_uniform(n_samples=n_samples)
            n_base_point = self.group.random_uniform(n_samples=n_samples)

            // Test with the 1 base point, and n tangent vecs
            result = metric.exp(n_tangent_vec, one_base_point)
            self.assertTrue(np.allclose(result.shape,
                                        (n_samples, self.group.dimension)))
            expected = np.vstack([metric.exp(tangent_vec, one_base_point)
                                  for tangent_vec in n_tangent_vec])
            self.assertTrue(np.allclose(expected.shape,
                                        (n_samples, self.group.dimension)))

            // Test with the several base point, and one tangent vec
            result = metric.exp(one_tangent_vec, n_base_point)
            self.assertTrue(np.allclose(result.shape,
                                        (n_samples, self.group.dimension)))
            expected = np.vstack([metric.exp(one_tangent_vec, base_point)
                                  for base_point in n_base_point])
            self.assertTrue(np.allclose(expected.shape,
                                        (n_samples, self.group.dimension)))

            // Test with the same number n of base point and n tangent vec
            result = metric.exp(n_tangent_vec, n_base_point)
            self.assertTrue(np.allclose(result.shape,
                                        (n_samples, self.group.dimension)))
            expected = np.vstack([metric.exp(tangent_vec, base_point)
                                  for tangent_vec, base_point in zip(
                                                               n_tangent_vec,
                                                               n_base_point)])
            self.assertTrue(np.allclose(expected.shape,
                                        (n_samples, self.group.dimension)))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: geomstats/geomstats
Commit Name: 3ef34a25874548e97d9a6e0aeeb2f4e71fb6c1fa
Time: 2018-02-23
Author: ninamio78@gmail.com
File Name: tests/test_special_euclidean_group.py
Class Name: TestSpecialEuclideanGroupMethods
Method Name: test_exp_vectorization


Project Name: geomstats/geomstats
Commit Name: 3ef34a25874548e97d9a6e0aeeb2f4e71fb6c1fa
Time: 2018-02-23
Author: ninamio78@gmail.com
File Name: tests/test_special_euclidean_group.py
Class Name: TestSpecialEuclideanGroupMethods
Method Name: test_log_vectorization


Project Name: WZBSocialScienceCenter/tmtoolkit
Commit Name: 8c8417497aff9741449d9bd3681cad6aea06283a
Time: 2019-06-19
Author: markus.konrad@wzb.eu
File Name: tmtoolkit/preprocess/_tmpreproc.py
Class Name: TMPreproc
Method Name: get_dtm


Project Name: geomstats/geomstats
Commit Name: 3ef34a25874548e97d9a6e0aeeb2f4e71fb6c1fa
Time: 2018-02-23
Author: ninamio78@gmail.com
File Name: tests/test_special_euclidean_group.py
Class Name: TestSpecialEuclideanGroupMethods
Method Name: test_exp_vectorization