Skip to content

Commit

Permalink
removed transform option from L1Reg prox.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankong committed Jul 10, 2018
1 parent f426b6b commit 691a5c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions sigpy/mri/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def __init__(self, ksp, mps, lamda,
self.img = sp.util.zeros(mps.shape[1:], dtype=ksp.dtype, device=device)

W = sp.linop.Wavelet(A.ishape, wave_name=wave_name)
proxg = sp.prox.L1Reg(A.ishape, lamda, transform=W)
proxg = sp.prox.UnitaryTransform(sp.prox.L1Reg(A.ishape, lamda), W)

def g(input):
device = sp.util.get_device(input)
Expand Down Expand Up @@ -181,7 +181,7 @@ def __init__(
A = linop.Sense(mps, coord=coord)
self.img = sp.util.zeros(mps.shape[1:], dtype=ksp.dtype, device=device)
W = sp.linop.Wavelet(A.ishape, wave_name=wave_name)
proxg = sp.prox.L1Reg(A.ishape, 1, transform=W)
proxg = sp.prox.UnitaryTransform(sp.prox.L1Reg(A.ishape, 1), W)

super().__init__(A, ksp, self.img, proxg, eps, weights=weights, **kwargs)

Expand Down
11 changes: 2 additions & 9 deletions sigpy/prox.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,15 @@ class L1Reg(Prox):
Args:
shape (tuple of ints): input shape
lamda (float): regularization parameter
transform (Linop): Unitary linear operator.
"""

def __init__(self, shape, lamda, transform=None):
def __init__(self, shape, lamda):
self.lamda = lamda
self.transform = transform

super().__init__(shape)

def _prox(self, alpha, input):

if self.transform is None:
return thresh.soft_thresh(self.lamda * alpha, input)
else:
return self.transform.H(thresh.soft_thresh(self.lamda * alpha,
self.transform(input)))
return thresh.soft_thresh(self.lamda * alpha, input)


class L0Proj(Prox):
Expand Down

0 comments on commit 691a5c8

Please sign in to comment.