diff options
author | RĂ©mi Flamary <remi.flamary@gmail.com> | 2019-07-03 14:34:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-03 14:34:13 +0200 |
commit | 952503e02b1fc9bdf0811b937baacca57e4a98f1 (patch) | |
tree | c5b1b8f10eaee4c2ecaa12f629255489c2481590 /docs/source/auto_examples/plot_OT_2D_samples.rst | |
parent | 8b3927bb5e8935c3dbddf054f054dc0c036fbdfe (diff) | |
parent | 7402d344240ce94e33c53daff419d4356278d48f (diff) |
Merge pull request #88 from rflamary/doc_modules
[MRG] Update documentation and add quick start guide
Diffstat (limited to 'docs/source/auto_examples/plot_OT_2D_samples.rst')
-rw-r--r-- | docs/source/auto_examples/plot_OT_2D_samples.rst | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/docs/source/auto_examples/plot_OT_2D_samples.rst b/docs/source/auto_examples/plot_OT_2D_samples.rst index 624ae3e..1f1d713 100644 --- a/docs/source/auto_examples/plot_OT_2D_samples.rst +++ b/docs/source/auto_examples/plot_OT_2D_samples.rst @@ -17,6 +17,7 @@ sum of diracs. The OT matrix is plotted with the samples. # Author: Remi Flamary <remi.flamary@unice.fr> + # Kilian Fatras <kilian.fatras@irisa.fr> # # License: MIT License @@ -176,6 +177,8 @@ Compute Sinkhorn + + .. rst-class:: sphx-glr-horizontal @@ -192,7 +195,58 @@ Compute Sinkhorn -**Total running time of the script:** ( 0 minutes 3.027 seconds) +Emprirical Sinkhorn +---------------- + + + +.. code-block:: python + + + #%% sinkhorn + + # reg term + lambd = 1e-3 + + Ges = ot.bregman.empirical_sinkhorn(xs, xt, lambd) + + pl.figure(7) + pl.imshow(Ges, interpolation='nearest') + pl.title('OT matrix empirical sinkhorn') + + pl.figure(8) + ot.plot.plot2D_samples_mat(xs, xt, Ges, color=[.5, .5, 1]) + pl.plot(xs[:, 0], xs[:, 1], '+b', label='Source samples') + pl.plot(xt[:, 0], xt[:, 1], 'xr', label='Target samples') + pl.legend(loc=0) + pl.title('OT matrix Sinkhorn from samples') + + pl.show() + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image:: /auto_examples/images/sphx_glr_plot_OT_2D_samples_013.png + :scale: 47 + + * + + .. image:: /auto_examples/images/sphx_glr_plot_OT_2D_samples_014.png + :scale: 47 + + +.. rst-class:: sphx-glr-script-out + + Out:: + + Warning: numerical errors at iteration 0 + + +**Total running time of the script:** ( 0 minutes 2.616 seconds) |