diff options
author | ncassereau-idris <84033440+ncassereau-idris@users.noreply.github.com> | 2021-09-28 16:34:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 16:34:28 +0200 |
commit | 7dde9e8e4b6aae756e103d49198caaa4f24150e3 (patch) | |
tree | 3961588cfe35d371ebf399bd6c138c2a1bcb1697 /test/test_da.py | |
parent | e0ba31ce39a7d9e65e50ea970a574b3db54e4207 (diff) |
[MRG] Regularized OT (optim.cg) bug solve (#286)
* Line search stops when derphi is 0 instead of bugging out like in some instances
* pep8 compliance
* Tests
Diffstat (limited to 'test/test_da.py')
-rw-r--r-- | test/test_da.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_da.py b/test/test_da.py index 44bb2e9..9f2bb50 100644 --- a/test/test_da.py +++ b/test/test_da.py @@ -565,6 +565,14 @@ def test_mapping_transport_class(): otda.fit(Xs=Xs, Xt=Xt) assert len(otda.log_.keys()) != 0 + # check that it does not crash when derphi is very close to 0 + np.random.seed(39) + Xs, ys = make_data_classif('3gauss', ns) + Xt, yt = make_data_classif('3gauss2', nt) + otda = ot.da.MappingTransport(kernel="gaussian", bias=False) + otda.fit(Xs=Xs, Xt=Xt) + np.random.seed(None) + def test_linear_mapping(): ns = 150 |