| 41 | |
| 42 | @pytest.mark.skipif(nocvxpy, reason="No CVXPY available") |
| 43 | def test_brenier_potential_predict_bounds(nx): |
| 44 | X = nx.ones((2, 2)) |
| 45 | phi, G = ot.mapping.nearest_brenier_potential_fit(X, X, its=3) |
| 46 | phi_lu, G_lu, log = ot.mapping.nearest_brenier_potential_predict_bounds( |
| 47 | X, phi, G, X, log=True |
| 48 | ) |
| 49 | # 'new' input isn't new, so should be equal to target |
| 50 | np.testing.assert_almost_equal(to_numpy(G_lu[0]), to_numpy(X)) |
| 51 | np.testing.assert_almost_equal(to_numpy(G_lu[1]), to_numpy(X)) |
| 52 | # test with no log but classes |
| 53 | ot.mapping.nearest_brenier_potential_predict_bounds( |
| 54 | X, phi, G, X, X_classes=nx.ones(2), Y_classes=nx.ones(2) |
| 55 | ) |
| 56 | |
| 57 | |
| 58 | def test_joint_OT_mapping(): |