From 2b375f263ef88100b0321c8ef1b3605dfbb95b3d Mon Sep 17 00:00:00 2001 From: RĂ©mi Flamary Date: Wed, 30 May 2018 10:34:48 +0200 Subject: update notebooks --- examples/plot_barycenter_lp_vs_entropic.py | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'examples/plot_barycenter_lp_vs_entropic.py') diff --git a/examples/plot_barycenter_lp_vs_entropic.py b/examples/plot_barycenter_lp_vs_entropic.py index 2255107..b82765e 100644 --- a/examples/plot_barycenter_lp_vs_entropic.py +++ b/examples/plot_barycenter_lp_vs_entropic.py @@ -15,8 +15,6 @@ Wasserstein problems. SIAM Journal on Imaging Sciences, 9(1), 320-343. Iterative Bregman projections for regularized transportation problems SIAM Journal on Scientific Computing, 37(2), A1111-A1138. - - """ # Author: Remi Flamary @@ -32,8 +30,8 @@ from matplotlib.collections import PolyCollection # noqa #import ot.lp.cvx as cvx -# -# Generate data +############################################################################## +# Gaussian Data # ------------- #%% parameters @@ -58,9 +56,6 @@ n_distributions = A.shape[1] M = ot.utils.dist0(n) M /= M.max() -# -# Plot data -# --------- #%% plot the distributions @@ -70,10 +65,6 @@ for i in range(n_distributions): pl.title('Distributions') pl.tight_layout() -# -# Barycenter computation -# ---------------------- - #%% barycenter computation alpha = 0.5 # 0<=alpha<=1 @@ -110,6 +101,10 @@ pl.tight_layout() problems.append([A, [bary_l2, bary_wass, bary_wass2]]) +############################################################################## +# Dirac Data +# ---------- + #%% parameters a1 = 1.0 * (x > 10) * (x < 50) @@ -135,9 +130,6 @@ for i in range(n_distributions): pl.title('Distributions') pl.tight_layout() -# -# Barycenter computation -# ---------------------- #%% barycenter computation @@ -207,9 +199,6 @@ for i in range(n_distributions): pl.title('Distributions') pl.tight_layout() -# -# Barycenter computation -# ---------------------- #%% barycenter computation @@ -249,7 +238,7 @@ pl.title('Barycenters') pl.tight_layout() -# +############################################################################## # Final figure # ------------ # -- cgit v1.2.3