From 0bbe450f4ba3f955699e1b6b15751a57b0354120 Mon Sep 17 00:00:00 2001 From: facero Date: Thu, 28 Apr 2022 13:42:07 +0200 Subject: [PATCH] Changing how Lambdas are normalized if Simplex=True Two issues here: - Lambdas need to be divided by sum(L) not sum(abs(L)) - new Lambdas were not updated in params["Lambda"] When testing Sum(L) is 1 now (not the case before). --- codes/IAE_JAX_v2_devl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codes/IAE_JAX_v2_devl.py b/codes/IAE_JAX_v2_devl.py index bbae376..3673b79 100644 --- a/codes/IAE_JAX_v2_devl.py +++ b/codes/IAE_JAX_v2_devl.py @@ -734,8 +734,8 @@ def get_cost(params): if not self.simplex: B = params["Lambda"] @ self.PhiE else: - Lambda = params["Lambda"] / (np.sum(np.abs(params["Lambda"] ), axis=1)[:, np.newaxis] + 1e-3) - B = Lambda @ self.PhiE + params["Lambda"] = params["Lambda"] / (np.sum(params["Lambda"], axis=1)[:, np.newaxis] + 1e-3) + B = params["Lambda"] @ self.PhiE XRec = self.decoder(B)