Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PythonOT/POT
/ compute_loss
Function
compute_loss
ot/dr.py:516–517 ·
view source on GitHub ↗
(M, pi, reg)
Source
from the content-addressed store, hash-verified
514
)
515
516
def
compute_loss(M, pi, reg):
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
Callers
1
ewca
Function · 0.85
Calls
2
sum
Method · 0.45
log
Method · 0.45
Tested by
no test coverage detected