From f0b9a10cb812dba6f2564eae2116b7985c132700 Mon Sep 17 00:00:00 2001 From: Leonid Kostrykin Date: Tue, 16 Jul 2024 09:26:36 +0000 Subject: [PATCH] Remove `self.w` --- superdsm/dsm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superdsm/dsm.py b/superdsm/dsm.py index 594bf7d..eedbf31 100644 --- a/superdsm/dsm.py +++ b/superdsm/dsm.py @@ -337,7 +337,7 @@ def grad(self, params): grad = np.sum([term1 * q for q in self.q], axis=1) term1_sparse = coo_matrix(term1).transpose(copy=False) if self.smooth_mat.shape[1] > 0: - grad2 = (self.w.reshape(-1)[None, :] @ self.smooth_mat.multiply(term1_sparse)).reshape(-1) + grad2 = self.smooth_mat.multiply(term1_sparse).sum(axis=0).reshape(-1) grad2 += self.alpha * (params.ΞΎ / self.term2) grad = np.concatenate([grad, grad2]) return grad