AMP

2D implementation of Approximate message passing algorithms.

See docstring of amp2d for reference implementation details. It’s companion is LCAMP. What’s interesting is that they circular shift in the transform domain. I’m not sure why they do that, but empirically it seems to work!

The wavelet transform is about what they are using. I’m trying to keep the implementation as simple as possible, so I used a built in transform from PyWavelets that is close, but I’m not sure why it doesn’t match up completely.

mr_utils.cs.thresholding.amp.amp2d(y, forward_fun, inverse_fun, sigmaType=2, randshift=False, tol=1e-08, x=None, ignore_residual=False, disp=False, maxiter=100)[source]

Approximate message passing using wavelet sparsifying transform.

Parameters:
  • y (array_like) – Measurements, i.e., y = Ax.
  • forward_fun (callable) – A, the forward transformation function.
  • inverse_fun (callable) – A^H, the inverse transformation function.
  • sigmaType (int) – Method for determining threshold.
  • randshift (bool, optional) – Whether or not to randomly circular shift every iteration.
  • tol (float, optional) – Stop when stopping criteria meets this threshold.
  • x (array_like, optional) – The true image we are trying to reconstruct.
  • ignore_residual (bool, optional) – Whether or not to ignore stopping criteria.
  • disp (bool, optional) – Whether or not to display iteration info.
  • maxiter (int, optional) – Maximum number of iterations.
Returns:

wn – Estimate of x.

Return type:

array_like

Notes

Solves the problem:

\[\min_x || \Psi(x) ||_1 \text{ s.t. } || y - \text{forward}(x) ||^2_2 < \epsilon^2\]

The CDF-97 wavelet is used. If x=None, then MSE will not be calculated.

Algorithm described in [1], based on MATLAB implementation found at [2].

References

[1]“Message Passing Algorithms for CS” Donoho et al., PNAS 2009;106:18914
[2]http://kyungs.bol.ucla.edu/Site/Software.html