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

Function test_projections_sphere_to_circle

test/test_sliced.py:305–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

303
304
305def test_projections_sphere_to_circle():
306 rng = np.random.RandomState(0)
307
308 n_projs = 500
309 x = rng.randn(100, 3)
310 x = x / np.sqrt(np.sum(x**2, -1, keepdims=True))
311
312 x_projs, _ = ot.sliced.projection_sphere_to_circle(x, n_projs)
313 assert x_projs.shape == (n_projs, 100)
314 assert np.all(x_projs >= 0) and np.all(x_projs < 1)
315
316
317def test_sliced_sphere_same_dist():

Callers

nothing calls this directly

Calls 3

randnMethod · 0.45
sqrtMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected