summaryrefslogtreecommitdiff
path: root/docs/source/auto_examples/plot_barycenter_1D.rst
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2017-09-01 15:31:44 +0200
committerRémi Flamary <remi.flamary@gmail.com>2017-09-01 15:31:44 +0200
commit062071b20d1d40c64bb619931bd11bd28e780485 (patch)
tree74bfcd48bb65304c2a5be74c24cdff29bd82ba4b /docs/source/auto_examples/plot_barycenter_1D.rst
parent212f3889b1114026765cda0134e02766daa82af2 (diff)
update example with rst titles
Diffstat (limited to 'docs/source/auto_examples/plot_barycenter_1D.rst')
-rw-r--r--docs/source/auto_examples/plot_barycenter_1D.rst113
1 files changed, 86 insertions, 27 deletions
diff --git a/docs/source/auto_examples/plot_barycenter_1D.rst b/docs/source/auto_examples/plot_barycenter_1D.rst
index af88e80..d3f243f 100644
--- a/docs/source/auto_examples/plot_barycenter_1D.rst
+++ b/docs/source/auto_examples/plot_barycenter_1D.rst
@@ -7,33 +7,13 @@
1D Wasserstein barycenter demo
==============================
+This example illustrates the computation of regularized Wassersyein Barycenter
+as proposed in [3].
-
-
-.. rst-class:: sphx-glr-horizontal
-
-
- *
-
- .. image:: /auto_examples/images/sphx_glr_plot_barycenter_1D_001.png
- :scale: 47
-
- *
-
- .. image:: /auto_examples/images/sphx_glr_plot_barycenter_1D_002.png
- :scale: 47
-
- *
-
- .. image:: /auto_examples/images/sphx_glr_plot_barycenter_1D_003.png
- :scale: 47
-
- *
-
- .. image:: /auto_examples/images/sphx_glr_plot_barycenter_1D_004.png
- :scale: 47
-
+[3] Benamou, J. D., Carlier, G., Cuturi, M., Nenna, L., & Peyré, G. (2015).
+Iterative Bregman projections for regularized transportation problems
+SIAM Journal on Scientific Computing, 37(2), A1111-A1138.
@@ -53,6 +33,19 @@
from matplotlib.collections import PolyCollection
+
+
+
+
+
+Generate data
+#############################################################################
+
+
+
+.. code-block:: python
+
+
#%% parameters
n = 100 # nb bins
@@ -72,6 +65,20 @@
M = ot.utils.dist0(n)
M /= M.max()
+
+
+
+
+
+
+Plot data
+#############################################################################
+
+
+
+.. code-block:: python
+
+
#%% plot the distributions
pl.figure(1, figsize=(6.4, 3))
@@ -80,6 +87,23 @@
pl.title('Distributions')
pl.tight_layout()
+
+
+
+.. image:: /auto_examples/images/sphx_glr_plot_barycenter_1D_001.png
+ :align: center
+
+
+
+
+Barycenter computation
+#############################################################################
+
+
+
+.. code-block:: python
+
+
#%% barycenter computation
alpha = 0.2 # 0<=alpha<=1
@@ -106,6 +130,23 @@
pl.title('Barycenters')
pl.tight_layout()
+
+
+
+.. image:: /auto_examples/images/sphx_glr_plot_barycenter_1D_003.png
+ :align: center
+
+
+
+
+Barycentric interpolation
+#############################################################################
+
+
+
+.. code-block:: python
+
+
#%% barycenter interpolation
n_alpha = 11
@@ -171,7 +212,25 @@
pl.show()
-**Total running time of the script:** ( 0 minutes 0.546 seconds)
+
+
+.. rst-class:: sphx-glr-horizontal
+
+
+ *
+
+ .. image:: /auto_examples/images/sphx_glr_plot_barycenter_1D_005.png
+ :scale: 47
+
+ *
+
+ .. image:: /auto_examples/images/sphx_glr_plot_barycenter_1D_006.png
+ :scale: 47
+
+
+
+
+**Total running time of the script:** ( 0 minutes 0.520 seconds)
@@ -190,4 +249,4 @@
.. rst-class:: sphx-glr-signature
- `Generated by Sphinx-Gallery <http://sphinx-gallery.readthedocs.io>`_
+ `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_