072e5680310c1cefef7e520c16bb20e92da3016d,geomstats/geometry/hypersphere.py,HypersphereMetric,exp,#HypersphereMetric#Any#Any#,342

Before Change


        norm_tangent_vec = self.embedding_metric.norm(proj_tangent_vec)

        n_tiles_vec = gs.cast(gs.divide(n_exps, n_tangent_vecs), gs.int32)
        norm_tangent_vec = gs.tile(norm_tangent_vec, [n_tiles_vec, 1])
        n_tiles_base_point = gs.cast(
            gs.divide(n_exps, n_base_points), gs.int32)
        base_point = gs.tile(base_point, [n_tiles_base_point, 1])

After Change



        n_coef_1 = n_tangent_vecs
        if n_coef_1 != n_base_points:
            if n_coef_1 == 1:
                coef_1 = gs.squeeze(coef_1, axis=0)
                einsum_str = "i,nj->nj"
            elif n_base_points == 1:
                base_point = gs.squeeze(base_point, axis=0)
                einsum_str = "ni,j->nj"
            else:
                raise ValueError("Shape mismatch in einsum.")

        exp = (gs.einsum(einsum_str, coef_1, base_point)
               + gs.einsum("ni,nj->nj", coef_2, proj_tangent_vec))

        return exp
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: geomstats/geomstats
Commit Name: 072e5680310c1cefef7e520c16bb20e92da3016d
Time: 2020-01-17
Author: ninamio78@gmail.com
File Name: geomstats/geometry/hypersphere.py
Class Name: HypersphereMetric
Method Name: exp


Project Name: geomstats/geomstats
Commit Name: c86fbbe0c0bca22391d46177c8850d71c33b2e1d
Time: 2020-01-17
Author: ninamio78@gmail.com
File Name: geomstats/geometry/riemannian_metric.py
Class Name: RiemannianMetric
Method Name: inner_product


Project Name: geomstats/geomstats
Commit Name: 34ffb83ed85bb24d0cb0fcc7ffbda27489f14a58
Time: 2020-10-02
Author: alice.le-brigant@enac.fr
File Name: geomstats/geometry/beta_distributions.py
Class Name: BetaMetric
Method Name: exp