def test_group_log_then_exp(self): """ This tests that the composition of log and exp gives identity. """ base_point = gs.array([0.12]) point = gs.array([0.35]) result = helper.group_log_then_exp(group=self.group, point=point, base_point=base_point) expected = self.group.regularize(point) self.assertAllClose(result, expected)
def test_group_log_then_exp(self): """ Test that the group exponential and the group logarithm are inverse. Expect their composition to give the identity function. """ for base_point in self.elements.values(): for element_type in self.elements: point = self.elements[element_type] result = helper.group_log_then_exp(group=self.group, point=point, base_point=base_point) expected = self.group.regularize(point) self.assertAllClose(result, expected, rtol=1e-4) if geomstats.tests.tf_backend(): break