()
| 315 | |
| 316 | |
| 317 | def 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 | |
| 329 | def test_sliced_sphere_same_proj(): |