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

Function df

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

Source from the content-addressed store, hash-verified

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
304 W = nx.norm(G_split * unroll_labels_idx, axis=1, keepdims=True)
305 G_norm = G_split / nx.clip(W, eps, None)
306 return nx.sum(G_norm, axis=2).T
307
308 return gcg(
309 a,

Callers 1

Calls 5

dotsFunction · 0.85
repeatMethod · 0.45
normMethod · 0.45
clipMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected