4346ff930104b0d9b6735090a1ce4c485d40b981,pymanopt/manifolds/grassmann.py,Grassmann,dist,#Grassmann#Any#Any#,71

Before Change


            XtY = multiprod(multitransp(X), Y)
            square_d = 0
            for i in xrange(self._k):
                s = np.linalg.svd(XtY[i], compute_uv=False)
                // Ensure that -1 <= s <= 1
                s = np.fmin(s, [1])
                s = np.fmax(s, [-1])
                square_d = square_d + np.linalg.norm(np.arccos(s))**2

After Change



    // Geodesic distance for Grassmann
    def dist(self, X, Y):
        u, s, v = svd(multiprod(multitransp(X), Y))
        s[s > 1] = 1
        s = np.arccos(s)
        return np.linalg.norm(s)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pymanopt/pymanopt
Commit Name: 4346ff930104b0d9b6735090a1ce4c485d40b981
Time: 2016-02-25
Author: jamiehntownsend@gmail.com
File Name: pymanopt/manifolds/grassmann.py
Class Name: Grassmann
Method Name: dist


Project Name: keras-team/keras-preprocessing
Commit Name: 75c9e8cbcd9da21591cd5f8aaaa99205f48fa606
Time: 2021-01-19
Author: eli.osherovich@gmail.com
File Name: keras_preprocessing/image/image_data_generator.py
Class Name: ImageDataGenerator
Method Name: fit


Project Name: utiasSTARS/liegroups
Commit Name: 49f25abcf8799a400fe0d5cd638c4c9358511234
Time: 2017-10-16
Author: clement.leopold@gmail.com
File Name: liegroups/torch/base.py
Class Name: SpecialOrthogonalBaseTorch
Method Name: _normalize_one