aba65f959fb114e67103a061e92ab5596c557d3d,geomstats/lie_group.py,LieGroup,group_exp,#LieGroup#Any#Any#Any#,90

Before Change


            return self.group_exp_from_identity(
                tangent_vec, point_type=point_type)

        jacobian = self.jacobian_translation(point=base_point,
                                             left_or_right="left",
                                             point_type=point_type)

        if point_type == "vector":
            tangent_vec = gs.to_ndarray(tangent_vec, to_ndim=2)
            inv_jacobian = gs.linalg.inv(jacobian)

            tangent_vec_at_id = gs.einsum("ij,ijk->ik",
                                          tangent_vec,
                                          gs.transpose(inv_jacobian,
                                                       axes=(0, 2, 1)))
            group_exp_from_identity = self.group_exp_from_identity(
                                           tangent_vec=tangent_vec_at_id,
                                           point_type=point_type)
            group_exp = self.compose(base_point,
                                     group_exp_from_identity,
                                     point_type=point_type)
            group_exp = self.regularize(group_exp, point_type=point_type)
            return group_exp

        elif point_type == "matrix":
            tangent_vec = gs.to_ndarray(tangent_vec, to_ndim=3)
            raise NotImplementedError()

After Change


            base_point = identity
        base_point = self.regularize(base_point, point_type=point_type)

        n_tangent_vecs = tangent_vec.shape[0]
        n_base_points = base_point.shape[0]

        assert (tangent_vec.shape == base_point.shape
                or n_tangent_vecs == 1
                or n_base_points == 1)

        if n_tangent_vecs == 1:
            tangent_vec = gs.array([tangent_vec[0]] * n_base_points)

        if n_base_points == 1:
            base_point = gs.array([base_point[0]] * n_tangent_vecs)

        result = gs.cond(
            pred=gs.allclose(base_point, identity),
            true_fn=lambda: self.group_exp_from_identity(
                tangent_vec, point_type=point_type),
            false_fn=lambda: self.group_exp_not_from_identity(
                tangent_vec, base_point, point_type))
        return result

    def group_log_from_identity(self, point, point_type=None):
        
        Compute the group logarithm
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: geomstats/geomstats
Commit Name: aba65f959fb114e67103a061e92ab5596c557d3d
Time: 2018-12-27
Author: ninamio78@gmail.com
File Name: geomstats/lie_group.py
Class Name: LieGroup
Method Name: group_exp


Project Name: pymanopt/pymanopt
Commit Name: a1be7bf2f0926707e25b02570c17ba373878f768
Time: 2016-03-14
Author: jamiehntownsend@gmail.com
File Name: pymanopt/manifolds/psd.py
Class Name: PositiveDefinite
Method Name: exp


Project Name: mne-tools/mne-python
Commit Name: 26a0d938a4a532615493718a3fbb689958ce2893
Time: 2019-10-06
Author: larson.eric.d@gmail.com
File Name: mne/source_space.py
Class Name:
Method Name: head_to_mri