summaryrefslogtreecommitdiff
path: root/examples/plot_gromov.py
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2018-02-15 16:48:29 +0100
committerRémi Flamary <remi.flamary@gmail.com>2018-02-15 16:48:29 +0100
commit71b17f4e956de4503cbdffc2a822bcea18ed85d1 (patch)
treef59c07b7218a3ca81461e892ad2dc9bdb312d111 /examples/plot_gromov.py
parent42d0aa94e7cb49711a646fe9b263a86cdb817161 (diff)
large update gromov
Diffstat (limited to 'examples/plot_gromov.py')
-rw-r--r--examples/plot_gromov.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/examples/plot_gromov.py b/examples/plot_gromov.py
index d3f724c..d42c21a 100644
--- a/examples/plot_gromov.py
+++ b/examples/plot_gromov.py
@@ -78,16 +78,26 @@ pl.show()
# Compute Gromov-Wasserstein plans and distance
# ---------------------------------------------
-
+#%%
p = ot.unif(n_samples)
q = ot.unif(n_samples)
+ot.tic()
+gw = ot.gromov_wasserstein(C1, C2, p, q, 'square_loss', epsilon=5e-4,verbose=True)
+ot.toc()
+ot.tic()
+gw2,log2= ot.gromov.gromov_wasserstein0(C1, C2, p, q, 'square_loss', epsilon=5e-4,log=True,verbose=True)
+ot.toc()
-gw = ot.gromov_wasserstein(C1, C2, p, q, 'square_loss', epsilon=5e-4)
gw_dist = ot.gromov_wasserstein2(C1, C2, p, q, 'square_loss', epsilon=5e-4)
+ot.tic()
+gw0,log0=ot.gromov.gw_lp(C1, C2, p, q, 'square_loss',log=True,verbose=True)
+ot.toc()
+
+
print('Gromov-Wasserstein distances between the distribution: ' + str(gw_dist))
pl.figure()
-pl.imshow(gw, cmap='jet')
+pl.imshow(gw2, cmap='jet')
pl.colorbar()
pl.show()