summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMokhtar Z. Alaya <mzalaya@Mokhtars-iMac.local>2020-01-18 09:35:14 +0100
committerMokhtar Z. Alaya <mzalaya@Mokhtars-iMac.local>2020-01-18 09:35:14 +0100
commit7c25e0725e357e4beecc3bfb6f1468a5b5140e74 (patch)
tree389883558db2074653dd189867252ae472f07a85 /examples
parenta1747a10e80751eacca4273af61083a853fb9dd4 (diff)
clean
Diffstat (limited to 'examples')
-rw-r--r--examples/plot_screenkhorn_1D.py22
1 files changed, 2 insertions, 20 deletions
diff --git a/examples/plot_screenkhorn_1D.py b/examples/plot_screenkhorn_1D.py
index 7c0de82..bfd374e 100644
--- a/examples/plot_screenkhorn_1D.py
+++ b/examples/plot_screenkhorn_1D.py
@@ -14,7 +14,6 @@ Screening Sinkhorn Algorithm for Optimal transport.
import numpy as np
import matplotlib.pylab as pl
-import time
import ot.plot
from ot.datasets import make_1D_gauss as gauss
from ot.bregman import screenkhorn
@@ -59,28 +58,11 @@ ot.plot.plot1D_mat(a, b, M, 'Cost matrix M')
# -----------------------
# Screenkhorn
-lambd = 1e-03 # entropy parameter
+lambd = 2e-03 # entropy parameter
ns_budget = 30 # budget number of points to be keeped in the source distribution
nt_budget = 30 # budget number of points to be keeped in the target distribution
-tic = time.time()
G_screen = screenkhorn(a, b, M, lambd, ns_budget, nt_budget, uniform=False, restricted=True, verbose=True)
-tac_screen = time.time() - tic
-
-# Sinkhorn
-tic = time.time()
-G_sink = ot.sinkhorn(a, b, M, lambd, verbose=False)
-tac_sink = time.time() - tic
-
-
pl.figure(4, figsize=(5, 5))
ot.plot.plot1D_mat(a, b, G_screen, 'OT matrix Screenkhorn')
-
-pl.show()
-
-##############################################################################
-# Time complexity
-# -----------------------
-print("Sinkhorn time complexity: %s\n" % tac_sink)
-print("Screenkhorn time complexity: %s\n" % tac_screen)
-print("Time_Sinkhorn / Time_Screenkhorn: %s\n" % (tac_sink / tac_screen))
+pl.show() \ No newline at end of file