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

Function test_sliced_sphere_same_dist

test/test_sliced.py:317–326  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

315
316
317def test_sliced_sphere_same_dist():
318 n = 100
319 rng = np.random.RandomState(0)
320
321 x = rng.randn(n, 3)
322 x = x / np.sqrt(np.sum(x**2, -1, keepdims=True))
323 u = ot.utils.unif(n)
324
325 res = ot.sliced_wasserstein_sphere(x, x, u, u, 10, seed=rng)
326 np.testing.assert_almost_equal(res, 0.0)
327
328
329def test_sliced_sphere_same_proj():

Callers

nothing calls this directly

Calls 3

randnMethod · 0.45
sqrtMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected