XNew = X + G
for i in xrange(self._k):
q, r = np.linalg.qr(Y[i])
XNew[i] = np.dot(q, np.diag(np.sign(np.sign(np.diag(r))+.5)))
def norm(self, X, G):
// Norm on the tangent space is simply the Euclidean norm.
After Change
for i in xrange(self._k):
// q, r = np.linalg.qr(Y[i])
// XNew[i] = np.dot(q, np.diag(np.sign(np.sign(np.diag(r))+.5)))
u, s, vt = svd(X[i] + G[i], full_matrices=False)
XNew[i] = u.dot(vt)
return XNew