PhotocurrentMapOp.py 🚧¢

Source: LION/operators/PhotocurrentMapOp.py

Warning

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

Photocurrent mapping operator using subsampled WHT and dyadic permutation.

normal_to_dyadic_permutation(J: int) np.ndarray

No docstring is available.

class Subsampler(n: int, delta: float, coarseJ: int, rng: np.random.Generator | None = None)

No docstring is available.

Subsampler.subsampled_indices(self) np.ndarray

No docstring is available.

class PhotocurrentMapOp(J: int, subsampler: Subsampler, wht_dim: int = -1, device: torch.device | str | None = None)

Photocurrent mapping operator using subsampled WHT and dyadic permutation.

Parameters β€”β€”β€”- J : int The exponent such that the image size is (2^J, 2^J). subsampler : Subsampler The subsampler defining the measurement indices. wht_dim : int, optional The dimension along which to apply the WHT. Default is -1 (last dimension). device : str or torch.device Device where tensors are placed.

PhotocurrentMapOp.forward(self, x: torch.Tensor) torch.Tensor

Apply the forward photocurrent mapping.

Note

Prefer calling the instance of the PhotocurrentMapOp operator as operator(x) over directly calling this method. See this PyTorch discussion <https://discuss.pytorch.org/t/is-model-forward-x-the-same-as-model-call-x/33460/3>

PhotocurrentMapOp.adjoint(self, y: torch.Tensor) torch.Tensor

Apply the adjoint photocurrent mapping.

Parameters β€”β€”β€”- y : torch.Tensor The input measurements to which the adjoint photocurrent mapping is applied.

Returns β€”β€”- torch.Tensor The reconstructed image from the adjoint photocurrent mapping.

PhotocurrentMapOp.pseudo_inv(self, y: torch.Tensor) torch.Tensor

Apply the pseudo-inverse photocurrent mapping.

Parameters β€”β€”β€”- y : torch.Tensor The input measurements to which the pseudo-inverse photocurrent mapping is applied.

Returns β€”β€”- torch.Tensor The reconstructed image from the pseudo-inverse photocurrent mapping.

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

Return the shape of the image domain.

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

Return the shape of the measurement range.