diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2018-05-30 10:34:48 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2018-05-30 10:34:48 +0200 |
commit | 2b375f263ef88100b0321c8ef1b3605dfbb95b3d (patch) | |
tree | a2ae2e21bf7fac9fe2fa368782d7df5ea9974342 /examples/plot_barycenter_lp_vs_entropic.py | |
parent | b5e45bbc83fd8cd8c1634a78f2f983d1cf28af73 (diff) |
update notebooks
Diffstat (limited to 'examples/plot_barycenter_lp_vs_entropic.py')
-rw-r--r-- | examples/plot_barycenter_lp_vs_entropic.py | 25 |
1 files changed, 7 insertions, 18 deletions
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 <remi.flamary@unice.fr> @@ -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 # ------------ # |