Merged
Merged
Conversation
rflamary
changed the title
Pytest with 85% coverage
Pytest with 89% coverage
| before_script: # configure a headless display to test plot generation | ||
| - "export DISPLAY=:99.0" | ||
| - "sh -e /etc/init.d/xvfb start" | ||
| - sleep 3 # give xvfb some time to start |
| reg = 1e-3 | ||
| bary_wass = ot.bregman.barycenter(A, M, reg, weights) | ||
|
|
||
| assert np.allclose(1, np.sum(bary_wass)) |
| G, log = ot.sinkhorn([], [], M, 1, stopThr=1e-10, verbose=True, log=True) | ||
| # check constratints | ||
| assert np.allclose(u, G.sum(1), atol=1e-05) # cf convergence sinkhorn | ||
| assert np.allclose(u, G.sum(0), atol=1e-05) # cf convergence sinkhorn |
|
|
||
| # Gaussian distributions | ||
| a1 = ot.datasets.get_1D_gauss(n, m=30, s=10) # m= mean, s= std | ||
| a2 = ot.datasets.get_1D_gauss(n, m=40, s=10) |
| n = 150 # nb bins | ||
|
|
||
| xs, ys = ot.datasets.get_data_classif('3gauss', n) | ||
| xt, yt = ot.datasets.get_data_classif('3gauss2', n) |
| M = ot.utils.dist0(n, method='lin_square') | ||
|
|
||
| # dist0 default to linear sampling with quadratic loss | ||
| assert np.allclose(M[0, -1], (n - 1) * (n - 1)) |
Labels
None yet