summaryrefslogtreecommitdiff
path: root/examples/barycenters
diff options
context:
space:
mode:
Diffstat (limited to 'examples/barycenters')
-rw-r--r--examples/barycenters/plot_barycenter_1D.py3
-rw-r--r--examples/barycenters/plot_free_support_barycenter.py8
-rw-r--r--examples/barycenters/plot_generalized_free_support_barycenter.py2
3 files changed, 7 insertions, 6 deletions
diff --git a/examples/barycenters/plot_barycenter_1D.py b/examples/barycenters/plot_barycenter_1D.py
index 8096245..40dc444 100644
--- a/examples/barycenters/plot_barycenter_1D.py
+++ b/examples/barycenters/plot_barycenter_1D.py
@@ -4,7 +4,7 @@
1D Wasserstein barycenter demo
==============================
-This example illustrates the computation of regularized Wassersyein Barycenter
+This example illustrates the computation of regularized Wasserstein Barycenter
as proposed in [3].
@@ -80,6 +80,7 @@ plt.show()
##############################################################################
# Barycentric interpolation
# -------------------------
+
#%% barycenter interpolation
n_alpha = 11
diff --git a/examples/barycenters/plot_free_support_barycenter.py b/examples/barycenters/plot_free_support_barycenter.py
index f4a13dd..b6a4a11 100644
--- a/examples/barycenters/plot_free_support_barycenter.py
+++ b/examples/barycenters/plot_free_support_barycenter.py
@@ -5,7 +5,7 @@
========================================================
Illustration of 2D Wasserstein and Sinkhorn barycenters if distributions are weighted
-sum of diracs.
+sum of Diracs.
"""
@@ -50,7 +50,7 @@ pl.title('Distributions')
# %%
# Compute free support Wasserstein barycenter
-# -------------------------------
+# -------------------------------------------
k = 200 # number of Diracs of the barycenter
X_init = np.random.normal(0., 1., (k, d)) # initial Dirac locations
@@ -60,7 +60,7 @@ X = ot.lp.free_support_barycenter(measures_locations, measures_weights, X_init,
# %%
# Plot the Wasserstein barycenter
-# ---------
+# -------------------------------
pl.figure(2, (8, 3))
pl.scatter(x1[:, 0], x1[:, 1], alpha=0.5)
@@ -81,7 +81,7 @@ X = ot.bregman.free_support_sinkhorn_barycenter(measures_locations, measures_wei
# %%
# Plot the Wasserstein barycenter
-# ---------
+# -------------------------------
pl.figure(2, (8, 3))
pl.scatter(x1[:, 0], x1[:, 1], alpha=0.5)
diff --git a/examples/barycenters/plot_generalized_free_support_barycenter.py b/examples/barycenters/plot_generalized_free_support_barycenter.py
index e685ec7..a4d081b 100644
--- a/examples/barycenters/plot_generalized_free_support_barycenter.py
+++ b/examples/barycenters/plot_generalized_free_support_barycenter.py
@@ -57,7 +57,7 @@ weights = np.array([1 / 3, 1 / 3, 1 / 3])
# Number of barycenter points to compute
n_samples_bary = 150
-# Send the input measures into 3D space for visualisation
+# Send the input measures into 3D space for visualization
X_visu = [Xi @ Pi for (Xi, Pi) in zip(X_list, P_list)]
# Plot the input data