summaryrefslogtreecommitdiff
path: root/ot/optim.py
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2018-03-21 08:29:50 +0100
committerRémi Flamary <remi.flamary@gmail.com>2018-03-21 08:29:50 +0100
commit6fdf5de8fa27fa16d6b8910fe96eb67b7761aa0e (patch)
tree55b8d6e463b131134b4aa9d4e3013bbb77811da6 /ot/optim.py
parent287c659ad35f5036ba2687caf73009ef455c7239 (diff)
add linear mapping test + autopep8
Diffstat (limited to 'ot/optim.py')
-rw-r--r--ot/optim.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ot/optim.py b/ot/optim.py
index 1d09adc..f31fae2 100644
--- a/ot/optim.py
+++ b/ot/optim.py
@@ -15,7 +15,8 @@ from .bregman import sinkhorn
# The corresponding scipy function does not work for matrices
-def line_search_armijo(f, xk, pk, gfk, old_fval, args=(), c1=1e-4, alpha0=0.99):
+def line_search_armijo(f, xk, pk, gfk, old_fval,
+ args=(), c1=1e-4, alpha0=0.99):
"""
Armijo linesearch function that works with matrices
@@ -71,7 +72,8 @@ def line_search_armijo(f, xk, pk, gfk, old_fval, args=(), c1=1e-4, alpha0=0.99):
return alpha, fc[0], phi1
-def cg(a, b, M, reg, f, df, G0=None, numItermax=200, stopThr=1e-9, verbose=False, log=False):
+def cg(a, b, M, reg, f, df, G0=None, numItermax=200,
+ stopThr=1e-9, verbose=False, log=False):
"""
Solve the general regularized OT problem with conditional gradient
@@ -202,7 +204,8 @@ def cg(a, b, M, reg, f, df, G0=None, numItermax=200, stopThr=1e-9, verbose=False
return G
-def gcg(a, b, M, reg1, reg2, f, df, G0=None, numItermax=10, numInnerItermax=200, stopThr=1e-9, verbose=False, log=False):
+def gcg(a, b, M, reg1, reg2, f, df, G0=None, numItermax=10,
+ numInnerItermax=200, stopThr=1e-9, verbose=False, log=False):
"""
Solve the general regularized OT problem with the generalized conditional gradient