DebiasOp.py 🚧¢

Source: LION/operators/DebiasOp.py

Warning

This file has not yet received a complete narrative and docstring audit. Its public source-level API is listed automatically below.

Debiasing least squares operator on the support of w.

class DebiasOp(op: Operator, y: torch.Tensor, w: torch.Tensor, support_tol: float = 0.001)

Debiasing least squares operator on the support of w.

Parameters β€”β€”β€”- operator : Operator Forward operator A. y : torch.Tensor Measurements, shape (M,). w : torch.Tensor l1 minimiser, shape (Nw,). support_tol : float Threshold defining nonzero support.

References β€”β€”β€”- .. [Koutsourakis2021] G. Koutsourakis, A. Thompson, and J. C. Blakesley, β€œToward Megapixel Resolution Compressed Sensing Current Mapping of Photovoltaic Devices Using Digital Light Processing”, Solar RRL, 5(11):2100467, 2021. doi:10.1002/solr.202100467

DebiasOp.forward(self, v: torch.Tensor) torch.Tensor

Apply the forward projection on the support.

Note

Prefer calling the instance of the DebiasOp operator as operator(v) over directly calling this method. See this PyTorch discussion.

DebiasOp.adjoint(self, r: torch.Tensor) torch.Tensor

Apply the adjoint projection on the support.

Parameters β€”β€”β€”- r : torch.Tensor Input measurements, shape (M,).

Returns β€”β€”- torch.Tensor Output vector on the support, shape (Ns,).

DebiasOp.domain_shape(self) tuple[int, ...]

Return the shape of the support domain.

DebiasOp.range_shape(self) tuple[int, ...]

Return the shape of the measurement range.

debias_ls(op: Operator, y: torch.Tensor, w: torch.Tensor, support_tol: float = 0.001, max_iter: int = 200, tol: float = 1e-05, progress_bar: bool = False) torch.Tensor

Debiasing least squares on the support of w.

Parameters β€”β€”β€”- op : Operator Forward operator A. y : torch.Tensor Measurements, shape (M,). w : torch.Tensor l1 minimiser, shape (Nw,). support_tol : float Threshold defining nonzero support. max_iter : int Maximum number of gradient descent iterations. tol : float Relative stopping threshold. progress_bar : bool Whether to show a progress bar. Default is False.

Returns β€”β€”- w_deb : torch.Tensor Debiased coefficient vector, shape (Nw,).