53753337fc53532e2c35ed70c49fef23aa0510f4,tests/test_special_orthogonal_group.py,TestSpecialOrthogonalGroupMethods,test_group_log_then_exp,#TestSpecialOrthogonalGroupMethods#,559

Before Change


        

        for angle_type in self.points.keys():
            if angle_type == "with_angle_pi":
                continue
            for angle_type_base in self.points.keys():
                if angle_type_base == "with_angle_pi":
                    continue
                point = self.points[angle_type]
                base_point = self.points[angle_type_base]

                result = helper.group_log_then_exp(
                                             group=self.group,
                                             point=point,
                                             base_point=base_point)
                expected = self.group.regularize(point)
                inv_expected = - expected

                self.assertTrue((np.allclose(result, expected)
                                 or np.allclose(result, inv_expected)),
                                "\n- on point {}: {} -> {}\n"
                                "- base_point {}: {} -> {}\n"
                                "result = {} -> {}\n"
                                "expected = {} -> {}".format(
                                 angle_type,
                                 point, self.group.regularize(point),
                                 angle_type_base,
                                 base_point, self.group.regularize(base_point),
                                 result, self.group.regularize(result),
                                 expected, self.group.regularize(expected)))

                if np.allclose(result, inv_expected):
                    if np.linalg.norm(inv_expected - expected) > 1e-5:
                        logging.warning("Test group_log_then_exp passed only "
                                        " w. the assumption:\n"
                                        " rotvec = -rotvec "
                                        "for a point {} "
                                        "and base_point {}.".format(
                                                        angle_type,
                                                        angle_type_base))

    //def test_group_exponential_barycenter(self):
    //    rot_vec_1 = self.group.random_uniform()
    //    result_1 = self.group.group_exponential_barycenter(
    //                            points=[rot_vec_1, rot_vec_1])
    //    expected_1 = rot_vec_1
    //    self.assertTrue(np.allclose(result_1, expected_1))

    //    rot_vec_2 = self.group.random_uniform()
    //    result_2 = self.group.group_exponential_barycenter(
    //                            points=[rot_vec_2, rot_vec_2],
    //                            weights=[1., 2.])
    //    expected_2 = rot_vec_2
    //    self.assertTrue(np.allclose(result_2, expected_2))

    //    result_3 = self.group.group_exponential_barycenter(
    //                            points=[rot_vec_1, rot_vec_2],
    //                            weights=[1., .1])

    //    self.assertTrue(self.group.belongs(result_3))

    def test_squared_dist_is_symmetric(self):
        metric = self.metrics["canonical"]
        for angle_type_1 in self.points.keys():
            if angle_type_1 is "with_angle_pi":

After Change


        

        for angle_type in self.elements.keys():
            if angle_type in self.angles_close_to_pi:
                continue
            for angle_type_base in self.elements.keys():
                point = self.elements[angle_type]
                base_point = self.elements[angle_type_base]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 17

Instances


Project Name: geomstats/geomstats
Commit Name: 53753337fc53532e2c35ed70c49fef23aa0510f4
Time: 2018-01-28
Author: ninamio78@gmail.com
File Name: tests/test_special_orthogonal_group.py
Class Name: TestSpecialOrthogonalGroupMethods
Method Name: test_group_log_then_exp


Project Name: geomstats/geomstats
Commit Name: 53753337fc53532e2c35ed70c49fef23aa0510f4
Time: 2018-01-28
Author: ninamio78@gmail.com
File Name: tests/test_special_orthogonal_group.py
Class Name: TestSpecialOrthogonalGroupMethods
Method Name: test_exp_then_log


Project Name: geomstats/geomstats
Commit Name: 53753337fc53532e2c35ed70c49fef23aa0510f4
Time: 2018-01-28
Author: ninamio78@gmail.com
File Name: tests/test_special_orthogonal_group.py
Class Name: TestSpecialOrthogonalGroupMethods
Method Name: test_group_exp_then_log


Project Name: geomstats/geomstats
Commit Name: 53753337fc53532e2c35ed70c49fef23aa0510f4
Time: 2018-01-28
Author: ninamio78@gmail.com
File Name: tests/test_special_orthogonal_group.py
Class Name: TestSpecialOrthogonalGroupMethods
Method Name: test_group_log_then_exp