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

Function f

ot/da.py:298–300  ·  view source on GitHub ↗
(G)

Source from the content-addressed store, hash-verified

296 unroll_labels_idx = nx.eye(n_labels, type_as=labels_u)[None, labels_idx]
297
298 def f(G):
299 G_split = nx.repeat(G.T[:, :, None], n_labels, axis=2)
300 return nx.sum(nx.norm(G_split * unroll_labels_idx, axis=1))
301
302 def df(G):
303 G_split = nx.repeat(G.T[:, :, None], n_labels, axis=2) * unroll_labels_idx

Callers 2

phiFunction · 0.70
costFunction · 0.70

Calls 5

dotsFunction · 0.85
repeatMethod · 0.45
sumMethod · 0.45
normMethod · 0.45
traceMethod · 0.45

Tested by

no test coverage detected