4346ff930104b0d9b6735090a1ce4c485d40b981,pymanopt/manifolds/grassmann.py,Grassmann,dist,#Grassmann#,71
Before Change
// Geodesic distance for Grassmann
def dist(self, X, Y):
if self._k == 1:
u, s, v = np.linalg.svd(np.dot(X.T, Y))
s[s > 1] = 1
s = np.arccos(s)
return np.linalg.norm(s)
else:
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
return np.sqrt(square_d)
def inner(self, X, G, H):
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)
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: pymanopt/pymanopt
Commit Name: 06f40aff5fafd3db599ae361d8d7aa33f3142038
Time: 2016-01-18
Author: jamiehntownsend@gmail.com
File Name: pymanopt/manifolds/grassmann.py
Class Name: Grassmann
Method Name: retr
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