Skip to content

Commit

Permalink
Debug dsm.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kostrykin committed Jul 16, 2024
1 parent 3047131 commit 5d251b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions superdsm/dsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ def grad(self, params):
if self.smooth_mat.shape[1] > 0:
grad2 = (np.ones((1, np.prod(self.w.shape))) @ self.smooth_mat.multiply(term1_sparse)).reshape(-1)
#grad2 = self.smooth_mat.multiply(term1_sparse).sum(axis=0).reshape(-1)
assert np.allclose(
(np.ones((1, np.prod(self.w.shape))) @ self.smooth_mat.multiply(term1_sparse)).reshape(-1),
self.smooth_mat.multiply(term1_sparse).sum(axis=0).reshape(-1)
)
grad2 += self.alpha * (params.ξ / self.term2)
grad = np.concatenate([grad, grad2])
return grad
Expand Down

0 comments on commit 5d251b2

Please sign in to comment.