From 1c7cac63beafcef92931f65c8a80ea237c1cb6f4 Mon Sep 17 00:00:00 2001 From: Etienne van de Bijl Date: Wed, 29 May 2024 11:26:43 +0200 Subject: [PATCH] TCA implementation corrected with peer-reviewed article pseudocode --- adapt/feature_based/_tca.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adapt/feature_based/_tca.py b/adapt/feature_based/_tca.py index 45847ec..73a72b5 100644 --- a/adapt/feature_based/_tca.py +++ b/adapt/feature_based/_tca.py @@ -123,7 +123,7 @@ def fit_transform(self, Xs, Xt, **kwargs): H = np.eye(n+m) - 1/(n+m) * np.ones((n+m, n+m)) # Compute solution - a = np.eye(n+m) + self.mu * K.dot(L.dot(K)) + a = K.dot(L.dot(K)) + self.mu * np.eye(n+m) b = K.dot(H.dot(K)) sol = linalg.lstsq(a, b)[0] @@ -166,4 +166,4 @@ def transform(self, X, domain="tgt"): K = np.concatenate((Kss, Kst), axis=1) - return K.dot(self.vectors_) \ No newline at end of file + return K.dot(self.vectors_)