diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2017-09-01 15:31:44 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2017-09-01 15:31:44 +0200 |
commit | 062071b20d1d40c64bb619931bd11bd28e780485 (patch) | |
tree | 74bfcd48bb65304c2a5be74c24cdff29bd82ba4b /examples/plot_barycenter_1D.py | |
parent | 212f3889b1114026765cda0134e02766daa82af2 (diff) |
update example with rst titles
Diffstat (limited to 'examples/plot_barycenter_1D.py')
-rw-r--r-- | examples/plot_barycenter_1D.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/examples/plot_barycenter_1D.py b/examples/plot_barycenter_1D.py index f3be247..142b05e 100644 --- a/examples/plot_barycenter_1D.py +++ b/examples/plot_barycenter_1D.py @@ -4,7 +4,7 @@ 1D Wasserstein barycenter demo ============================== -This example illustrate the computation of regularized Wassersyein Barycenter +This example illustrates the computation of regularized Wassersyein Barycenter as proposed in [3]. @@ -25,6 +25,9 @@ import ot from mpl_toolkits.mplot3d import Axes3D # noqa from matplotlib.collections import PolyCollection +############################################################################## +# Generate data +############################################################################## #%% parameters @@ -45,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)) @@ -53,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 @@ -79,6 +90,10 @@ pl.legend() pl.title('Barycenters') pl.tight_layout() +############################################################################## +# Barycentric interpolation +############################################################################## + #%% barycenter interpolation n_alpha = 11 |