summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdata/cross.png (renamed from data/rond.png)bin230 -> 230 bytes
-rwxr-xr-xdata/square.png (renamed from data/carre.png)bin168 -> 168 bytes
-rwxr-xr-xdata/star.png (renamed from data/coeur.png)bin225 -> 225 bytes
-rw-r--r--examples/plot_gromov.py5
-rwxr-xr-xexamples/plot_gromov_barycenter.py13
-rw-r--r--test/test_gromov.py3
6 files changed, 9 insertions, 12 deletions
diff --git a/data/rond.png b/data/cross.png
index 1c1a068..1c1a068 100755
--- a/data/rond.png
+++ b/data/cross.png
Binary files differ
diff --git a/data/carre.png b/data/square.png
index 45ff0ef..45ff0ef 100755
--- a/data/carre.png
+++ b/data/square.png
Binary files differ
diff --git a/data/coeur.png b/data/star.png
index 3f511a6..3f511a6 100755
--- a/data/coeur.png
+++ b/data/star.png
Binary files differ
diff --git a/examples/plot_gromov.py b/examples/plot_gromov.py
index 92312ae..0f839a3 100644
--- a/examples/plot_gromov.py
+++ b/examples/plot_gromov.py
@@ -22,8 +22,9 @@ import ot
"""
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.
+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.
"""
n_samples = 30 # nb samples
diff --git a/examples/plot_gromov_barycenter.py b/examples/plot_gromov_barycenter.py
index 4f17117..c138031 100755
--- a/examples/plot_gromov_barycenter.py
+++ b/examples/plot_gromov_barycenter.py
@@ -48,13 +48,10 @@ def smacof_mds(C, dim, max_iter=3000, eps=1e-9):
eps : float
relative tolerance w.r.t stress to declare converge
-
Returns
-------
npos : ndarray, shape (R, dim)
Embedded coordinates of the interpolated point cloud (defined with one isometry)
-
-
"""
rng = np.random.RandomState(seed=3)
@@ -91,12 +88,12 @@ def im2mat(I):
return I.reshape((I.shape[0] * I.shape[1], I.shape[2]))
-square = spi.imread('../data/carre.png').astype(np.float64) / 256
-circle = spi.imread('../data/rond.png').astype(np.float64) / 256
-triangle = spi.imread('../data/triangle.png').astype(np.float64) / 256
-arrow = spi.imread('../data/coeur.png').astype(np.float64) / 256
+square = spi.imread('../data/square.png').astype(np.float64)[:,:,2] / 256
+cross = spi.imread('../data/cross.png').astype(np.float64)[:,:,2] / 256
+triangle = spi.imread('../data/triangle.png').astype(np.float64)[:,:,2] / 256
+star = spi.imread('../data/star.png').astype(np.float64)[:,:,2] / 256
-shapes = [square, circle, triangle, arrow]
+shapes = [square, cross, triangle, star]
S = 4
xs = [[] for i in range(S)]
diff --git a/test/test_gromov.py b/test/test_gromov.py
index 28495e1..e808292 100644
--- a/test/test_gromov.py
+++ b/test/test_gromov.py
@@ -17,8 +17,7 @@ def test_gromov():
xs = ot.datasets.get_2D_samples_gauss(n_samples, mu_s, cov_s)
- xt = xs[::-1]
- xt = np.array(xt)
+ xt = xs[::-1].copy()
p = ot.unif(n_samples)
q = ot.unif(n_samples)