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

Function solve_ot

ot/factored.py:119–126  ·  view source on GitHub ↗
(X1, X2, w1, w2)

Source from the content-addressed store, hash-verified

117 w = nx.ones(r, type_as=Xa) / r
118
119 def solve_ot(X1, X2, w1, w2):
120 M = dist(X1, X2)
121 if reg > 0:
122 G, log = sinkhorn(w1, w2, M, reg, log=True, **kwargs)
123 log["cost"] = nx.sum(G * M)
124 return G, log
125 else:
126 return emd(w1, w2, M, log=True, **kwargs)
127
128 norm_delta = []
129

Callers 1

Calls 4

sinkhornFunction · 0.90
emdFunction · 0.85
distFunction · 0.70
sumMethod · 0.45

Tested by

no test coverage detected