()
| 303 | |
| 304 | |
| 305 | def 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 | |
| 317 | def test_sliced_sphere_same_dist(): |