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

Before Change



        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)

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),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

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: robertmartin8/PyPortfolioOpt
Commit Name: 2cfa771a3207863a4dab8219e3ab12d42837ab35
Time: 2020-02-25
Author: martin.robertandrew@gmail.com
File Name: pypfopt/black_litterman.py
Class Name: BlackLittermanModel
Method Name: bl_returns


Project Name: fizyr/keras-retinanet
Commit Name: 985995460466aecec6adbe282c98ebff68749fa6
Time: 2018-01-30
Author: maarten@de-vri.es
File Name: keras_retinanet/utils/image.py
Class Name:
Method Name: apply_transform