Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
guanhuaw committed Feb 29, 2024
1 parent 2e9ed46 commit 10a6c59
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mirtorch/prox/prox.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class BoxConstraint(Prox):
arg \min_{x \in [lower, upper]} \frac{1}{2} \| x - v \|_2^2
Attributes:
Lambda: flaot, regularization parameter.
Lambda: float, regularization parameter.
lower: float, minimum value
upper: float, maximum value
T: LinearMap, optional, unitary LinearMap
Expand All @@ -244,9 +244,9 @@ def _apply(self, v: torch.Tensor, alpha: FloatLike) -> torch.Tensor:
x = torch.clamp(v, self.l, self.u)
else:
Lambda = self.P(self.Lambda * alpha * torch.ones(self.P.size_in))
l = self.l / Lambda
u = self.u / Lambda
x = torch.minimum(u, torch.minimum(v, l))
low = self.l / Lambda
up = self.u / Lambda
x = torch.minimum(up, torch.minimum(v, low))
return x


Expand Down

0 comments on commit 10a6c59

Please sign in to comment.