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

Function f2

test/test_da.py:1001–1003  ·  view source on GitHub ↗
(G)

Source from the content-addressed store, hash-verified

999 unroll_labels_idx = nx.eye(n_labels, type_as=labels_u)[None, labels_idx]
1000
1001 def f2(G):
1002 G_split = nx.repeat(G.T[:, :, None], n_labels, axis=2)
1003 return nx.sum(nx.norm(G_split * unroll_labels_idx, axis=1))
1004
1005 def df2(G):
1006 G_split = nx.repeat(G.T[:, :, None], n_labels, axis=2) * unroll_labels_idx

Callers 1

Calls 3

repeatMethod · 0.45
sumMethod · 0.45
normMethod · 0.45

Tested by

no test coverage detected