summaryrefslogtreecommitdiff
path: root/ot/optim.py
diff options
context:
space:
mode:
authorRĂ©mi Flamary <remi.flamary@gmail.com>2019-11-18 11:13:03 +0100
committerGitHub <noreply@github.com>2019-11-18 11:13:03 +0100
commitbbd8f2046ec42751eba8e5356366aded74a2930d (patch)
tree6e8b8ceb9bfc59257360ef2d2d54417a8041a30e /ot/optim.py
parent3635fc46d6fc55e6fa30b33ad07fe092dfd23241 (diff)
parent0280a3441b09c781035cda3b74213ec92026ff9e (diff)
Merge pull request #108 from kilianFatras/master
[MRG] Fix log and nbiter bug in gromov_wasserstein and gromov_wasserstein2
Diffstat (limited to 'ot/optim.py')
-rw-r--r--ot/optim.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ot/optim.py b/ot/optim.py
index 0abd9e9..4012e0d 100644
--- a/ot/optim.py
+++ b/ot/optim.py
@@ -134,7 +134,7 @@ def solve_linesearch(cost, G, deltaG, Mi, f_val,
return alpha, fc, f_val
-def cg(a, b, M, reg, f, df, G0=None, numItermax=200,
+def cg(a, b, M, reg, f, df, G0=None, numItermax=200, numItermaxEmd=100000,
stopThr=1e-9, stopThr2=1e-9, verbose=False, log=False, **kwargs):
"""
Solve the general regularized OT problem with conditional gradient
@@ -172,6 +172,8 @@ def cg(a, b, M, reg, f, df, G0=None, numItermax=200,
initial guess (default is indep joint density)
numItermax : int, optional
Max number of iterations
+ numItermaxEmd : int, optional
+ Max number of iterations for emd
stopThr : float, optional
Stop threshol on the relative variation (>0)
stopThr2 : float, optional
@@ -238,7 +240,7 @@ def cg(a, b, M, reg, f, df, G0=None, numItermax=200,
Mi += Mi.min()
# solve linear program
- Gc = emd(a, b, Mi)
+ Gc = emd(a, b, Mi, numItermax=numItermaxEmd)
deltaG = Gc - G