From 062071b20d1d40c64bb619931bd11bd28e780485 Mon Sep 17 00:00:00 2001 From: Rémi Flamary Date: Fri, 1 Sep 2017 15:31:44 +0200 Subject: update example with rst titles --- docs/source/auto_examples/plot_barycenter_1D.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'docs/source/auto_examples/plot_barycenter_1D.py') diff --git a/docs/source/auto_examples/plot_barycenter_1D.py b/docs/source/auto_examples/plot_barycenter_1D.py index 875f44c..142b05e 100644 --- a/docs/source/auto_examples/plot_barycenter_1D.py +++ b/docs/source/auto_examples/plot_barycenter_1D.py @@ -4,6 +4,14 @@ 1D Wasserstein barycenter demo ============================== +This example illustrates the computation of regularized Wassersyein Barycenter +as proposed in [3]. + + +[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. + """ # Author: Remi Flamary @@ -17,6 +25,9 @@ import ot from mpl_toolkits.mplot3d import Axes3D # noqa from matplotlib.collections import PolyCollection +############################################################################## +# Generate data +############################################################################## #%% parameters @@ -37,6 +48,10 @@ n_distributions = A.shape[1] M = ot.utils.dist0(n) M /= M.max() +############################################################################## +# Plot data +############################################################################## + #%% plot the distributions pl.figure(1, figsize=(6.4, 3)) @@ -45,6 +60,10 @@ for i in range(n_distributions): pl.title('Distributions') pl.tight_layout() +############################################################################## +# Barycenter computation +############################################################################## + #%% barycenter computation alpha = 0.2 # 0<=alpha<=1 @@ -71,6 +90,10 @@ pl.legend() pl.title('Barycenters') pl.tight_layout() +############################################################################## +# Barycentric interpolation +############################################################################## + #%% barycenter interpolation n_alpha = 11 -- cgit v1.2.3