Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_different_size(self):
d = sliced_wasserstein(
np.array([
[0.5, 1],
[0.6, 1.1]
]),
np.array([
[0.6, 1.2]
])
)
# These are very loose bounds
assert d == pytest.approx(0.314, 0.1)
def test_sliced_single():
d = sliced_wasserstein(
np.array([[0.5, 1]]),
np.array([[0.5, 1.1]])
)
# These are very loose bounds
assert d == pytest.approx(0.1, 0.01)
def test_sliced_some():
d = sliced_wasserstein(
np.array([
[0.5, 1],
[0.6, 1.1]
]),
np.array([
[0.5, 1.1],
[0.6, 1.2]
])
)
# These are very loose bounds
assert d == pytest.approx(0.19, 0.02)
def test_some(self):
d = sliced_wasserstein(
np.array([
[0.5, 1],
[0.6, 1.1]
]),
np.array([
[0.5, 1.1],
[0.6, 1.2]
])
)
# These are very loose bounds
assert d == pytest.approx(0.19, 0.02)
def test_single(self):
d = sliced_wasserstein(
np.array([[0.5, 1]]),
np.array([[0.5, 1.1]])
)
# These are very loose bounds
assert d == pytest.approx(0.1, 0.01)