summaryrefslogtreecommitdiff
path: root/ot/da.py
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2018-02-16 14:04:28 +0100
committerRémi Flamary <remi.flamary@gmail.com>2018-02-16 14:04:28 +0100
commitd41ffdb24de5cb234237482b3f332b06514b10f0 (patch)
tree03887793107ded56f3fc9340f06eb8670c07ce4b /ot/da.py
parentf089a3cbc27c30ba9416ea1659c2fdbac1857146 (diff)
no more pep8 problem, need cleanup plots in test and examples
Diffstat (limited to 'ot/da.py')
-rw-r--r--ot/da.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/ot/da.py b/ot/da.py
index ee73ec8..c688654 100644
--- a/ot/da.py
+++ b/ot/da.py
@@ -330,17 +330,17 @@ def joint_OT_mapping_linear(xs, xt, mu=1, eta=0.001, bias=False, verbose=False,
if bias:
xs1 = np.hstack((xs, np.ones((ns, 1))))
xstxs = xs1.T.dot(xs1)
- I = np.eye(d + 1)
- I[-1] = 0
- I0 = I[:, :-1]
+ Id = np.eye(d + 1)
+ Id[-1] = 0
+ I0 = Id[:, :-1]
def sel(x):
return x[:-1, :]
else:
xs1 = xs
xstxs = xs1.T.dot(xs1)
- I = np.eye(d)
- I0 = I
+ Id = np.eye(d)
+ I0 = Id
def sel(x):
return x
@@ -361,7 +361,7 @@ def joint_OT_mapping_linear(xs, xt, mu=1, eta=0.001, bias=False, verbose=False,
def solve_L(G):
""" solve L problem with fixed G (least square)"""
xst = ns * G.dot(xt)
- return np.linalg.solve(xstxs + eta * I, xs1.T.dot(xst) + eta * I0)
+ return np.linalg.solve(xstxs + eta * Id, xs1.T.dot(xst) + eta * I0)
def solve_G(L, G0):
"""Update G with CG algorithm"""
@@ -520,8 +520,8 @@ def joint_OT_mapping_kernel(xs, xt, mu=1, eta=0.001, kerneltype='gaussian',
K = kernel(xs, xs, method=kerneltype, sigma=sigma)
if bias:
K1 = np.hstack((K, np.ones((ns, 1))))
- I = np.eye(ns + 1)
- I[-1] = 0
+ Id = np.eye(ns + 1)
+ Id[-1] = 0
Kp = np.eye(ns + 1)
Kp[:ns, :ns] = K
@@ -535,14 +535,14 @@ def joint_OT_mapping_kernel(xs, xt, mu=1, eta=0.001, kerneltype='gaussian',
else:
K1 = K
- I = np.eye(ns)
+ Id = np.eye(ns)
# ls regul
# K0 = K1.T.dot(K1)+eta*I
# Kreg=I
# proper kernel ridge
- K0 = K + eta * I
+ K0 = K + eta * Id
Kreg = K
if log: