MCPcopy Create free account
hub / github.com/PythonOT/POT / grassmann_distance

Function grassmann_distance

ot/dr.py:519–524  ·  view source on GitHub ↗
(U1, U2)

Source from the content-addressed store, hash-verified

517 return np.sum(M * pi) + reg * np.sum(pi * (np.log(pi) - 1))
518
519 def grassmann_distance(U1, U2):
520 proj = U1.T @ U2
521 _, s, _ = np.linalg.svd(proj)
522 s[s > 1] = 1
523 s = np.arccos(s)
524 return np.linalg.norm(s)
525
526 # loop
527 it = 0

Callers 1

ewcaFunction · 0.85

Calls 1

normMethod · 0.45

Tested by

no test coverage detected