summaryrefslogtreecommitdiff
path: root/examples/plot_gromov.py
diff options
context:
space:
mode:
authorNicolas Courty <Nico@pc-mna-08.univ-ubs.fr>2017-08-31 16:44:18 +0200
committerNicolas Courty <Nico@pc-mna-08.univ-ubs.fr>2017-08-31 16:44:18 +0200
commit3007f1da1094f93fa4216386666085cf60316b04 (patch)
tree5e07b1674769403f2e09476b7d73f1e00a845384 /examples/plot_gromov.py
parent0a68bf4e83ee9092c3f3878115fea894922d7d56 (diff)
Minor corrections suggested by @agramfort + new barycenter example + test function
Diffstat (limited to 'examples/plot_gromov.py')
-rw-r--r--examples/plot_gromov.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/plot_gromov.py b/examples/plot_gromov.py
index a33fde1..9bbdbde 100644
--- a/examples/plot_gromov.py
+++ b/examples/plot_gromov.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
"""
-====================
+==========================
Gromov-Wasserstein example
-====================
+==========================
This example is designed to show how to use the Gromov-Wassertsein distance
computation in POT.
"""
@@ -14,14 +14,14 @@ computation in POT.
import scipy as sp
import numpy as np
+import matplotlib.pylab as pl
import ot
-import matplotlib.pylab as pl
"""
Sample two Gaussian distributions (2D and 3D)
-====================
+=============================================
The Gromov-Wasserstein distance allows to compute distances with samples that do not belong to the same metric space.
For demonstration purpose, we sample two Gaussian distributions in 2- and 3-dimensional spaces.
"""
@@ -42,7 +42,7 @@ xt = np.random.randn(n, 3).dot(P) + mu_t
"""
Plotting the distributions
-====================
+==========================
"""
fig = pl.figure()
ax1 = fig.add_subplot(121)
@@ -54,7 +54,7 @@ pl.show()
"""
Compute distance kernels, normalize them and then display
-====================
+=========================================================
"""
C1 = sp.spatial.distance.cdist(xs, xs)
@@ -72,7 +72,7 @@ pl.show()
"""
Compute Gromov-Wasserstein plans and distance
-====================
+=============================================
"""
p = ot.unif(n)