(nx)
| 692 | @pytest.skip_backend("jax") |
| 693 | @pytest.skip_backend("tf") |
| 694 | def test_linear_gw_mapping_class(nx): |
| 695 | ns = 50 |
| 696 | nt = 50 |
| 697 | |
| 698 | Xs, ys = make_data_classif("3gauss", ns) |
| 699 | Xt, yt = make_data_classif("3gauss2", nt) |
| 700 | |
| 701 | Xsb, Xtb = nx.from_numpy(Xs, Xt) |
| 702 | |
| 703 | for log in [True, False]: |
| 704 | otmap = ot.da.LinearGWTransport(log=log) |
| 705 | |
| 706 | otmap.fit(Xs=Xsb, Xt=Xtb) |
| 707 | assert hasattr(otmap, "A_") |
| 708 | assert hasattr(otmap, "B_") |
| 709 | assert hasattr(otmap, "A1_") |
| 710 | assert hasattr(otmap, "B1_") |
| 711 | |
| 712 | Xst = nx.to_numpy(otmap.transform(Xs=Xsb)) |
| 713 | |
| 714 | Ct = np.cov(Xt.T) |
| 715 | Cst = np.cov(Xst.T) |
| 716 | |
| 717 | np.testing.assert_allclose(Ct, Cst, rtol=1e-2, atol=1e-2) |
| 718 | |
| 719 | |
| 720 | @pytest.skip_backend("jax") |
nothing calls this directly
no test coverage detected