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

Function test_nearest_brenier_potential

test/test_da.py:912–922  ·  view source on GitHub ↗
(nx)

Source from the content-addressed store, hash-verified

910
911@pytest.mark.skipif(nocvxpy, reason="No CVXPY available")
912def test_nearest_brenier_potential(nx):
913 X = nx.ones((2, 2))
914 for ssnb in [
915 ot.da.NearestBrenierPotential(log=True, its=5),
916 ot.da.NearestBrenierPotential(log=False, its=5),
917 ]:
918 ssnb.fit(Xs=X, Xt=X)
919 G_lu = ssnb.transform(Xs=X)
920 # 'new' input isn't new, so should be equal to target
921 np.testing.assert_almost_equal(nx.to_numpy(G_lu[0]), nx.to_numpy(X))
922 np.testing.assert_almost_equal(nx.to_numpy(G_lu[1]), nx.to_numpy(X))
923
924
925@pytest.mark.skipif(nosklearn, reason="No sklearn available")

Callers

nothing calls this directly

Calls 4

to_numpyMethod · 0.80
onesMethod · 0.45
fitMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected