diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2018-02-16 11:58:59 +0100 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2018-02-16 11:58:59 +0100 |
commit | 4a585de94109102c89bcd7ad43e35772e1027cd2 (patch) | |
tree | 3764b88f2a65404fcbc072ad3c6565cb921e89c0 /examples/plot_gromov.py | |
parent | ab2fc5486005732d60714b76eecf59d1104346f6 (diff) |
update examples
Diffstat (limited to 'examples/plot_gromov.py')
-rw-r--r-- | examples/plot_gromov.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/examples/plot_gromov.py b/examples/plot_gromov.py index d42c21a..5f2d826 100644 --- a/examples/plot_gromov.py +++ b/examples/plot_gromov.py @@ -81,23 +81,26 @@ pl.show() #%%
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_dist = ot.gromov_wasserstein2(C1, C2, p, q, 'square_loss', epsilon=5e-4)
+gw0,log0 = ot.gromov.gromov_wasserstein(C1, C2, p, q, 'square_loss', verbose=True,log=True)
-ot.tic()
-gw0,log0=ot.gromov.gw_lp(C1, C2, p, q, 'square_loss',log=True,verbose=True)
-ot.toc()
+gw,log= ot.gromov.entropic_gromov_wasserstein(C1, C2, p, q, 'square_loss', epsilon=5e-4,log=True,verbose=True)
-print('Gromov-Wasserstein distances between the distribution: ' + str(gw_dist))
+print('Gromov-Wasserstein distances: ' + str(log0['gw_dist']))
+print('Entropic Gromov-Wasserstein distances: ' + str(log['gw_dist']))
-pl.figure()
-pl.imshow(gw2, cmap='jet')
+
+pl.figure(1,(10,5))
+
+pl.subplot(1,2,1)
+pl.imshow(gw0, cmap='jet')
pl.colorbar()
+pl.title('Gromov Wasserstein')
+
+pl.subplot(1,2,2)
+pl.imshow(gw0, cmap='jet')
+pl.colorbar()
+pl.title('Entropic Gromov Wasserstein')
+
pl.show()
|