From d41ffdb24de5cb234237482b3f332b06514b10f0 Mon Sep 17 00:00:00 2001 From: RĂ©mi Flamary Date: Fri, 16 Feb 2018 14:04:28 +0100 Subject: no more pep8 problem, need cleanup plots in test and examples --- ot/da.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'ot/da.py') 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: -- cgit v1.2.3