A Note on Notation¶
As much as possible, a consistent notation is used in the magni
package. This implies that variable names are shared between functions that are related. Furthermore a consistent coordinate system is used for the description of related surfaces.
The Compressed Sensing Reconstruction Problem¶
In the magni.cs
subpackage, a consistent naming scheme is used for variables, i.e., vectors and matrices. This section gives an overview of the chosen notation. For the purpose of illustration, consider the Basis Pursuit CS reconstruction problem [1]:
Here \(\mathbf{A} \in \mathbb{C}^{m \times n}\) is the matrix product of a sampling matrix \(\mathbf{\Phi} \in \mathbb{C}^{m \times p}\) and a dictionary matrix \(\mathbf{\Psi} \in \mathbb{C}^{p \times n}\). The dictionary coefficients are denoted \(\mathbf{\alpha} \in \mathbb{C}^{n \times 1}\) whereas the (noiseless) measurements are denoted by \(\mathbf{z} \in \mathbb{C}^{m \times 1}\).
Thus, the following relations are used:
Here the vector \(\mathbf{x} \in \mathbb{C}^{p \times 1}\) represents the signal of interrest. That is, it is the signal that is assumed to have a sparse representation in the dictionary \(\mathbf{\Psi}\). The sparsity of the coefficient vector \(\mathbf{\alpha}\), that is the size of the support set, is denoted \(k=|\text{supp}(\mathbf{\alpha})|\). Furthermore, we have the undersampling ratio \(\delta=m/n\), the sparsity level is \(\rho=k/m\), and the signal density is \(\tau=k/n\).
Oftentimes, one considers noisy measurements, e.g. measurements corrupted by Additive White Gaussian Noise (AWGN) \(\mathbf{e} \in \mathbb{R}^{m \times 1}\) with
Here the (noisy) measurements are denoted \(\mathbf{y} \in \mathbb{C}^{m \times 1}\).
Note
All vectors in magni
are considered to be column vectors, i.e. they explicitly have a second dimension of length 1 when defined as numpy
arrays.
Note
Even though the above example involves complex vectors and matrices, the algorithms provided in magni.cs
may be restricted to inputs and outputs that are real.
References
[1] |
|
Handling Images as Matrices and Vectors¶
In parts of magni.imaging
, an image is considered a matrix \(\mathbf{M} \in \mathbb{R}^{h \times w}\). That is, the image height is \(h\) whereas the width is \(w\). In the magni.cs
subpackage, the image must be represented as a vector. This is done by stacking the columns of \(\mathbf{M}\) to form the vector \(\mathbf{x}\). Thus, the dimension of the image vector representation is \(n = h \cdot w\). The magni.imaging._util.vec2mat()
(available as magni.imaging.vec2mat()
) and magni.imaging._util.mat2vec()
(available as magni.imaging.mat2vec()
) may be use to convert between the matrix and vector notations.
When the matrix representation is used, the following coordinate system is used for its visual representation:
This way, a position on an AFM sample of size \(w \times h\) is specified by a \((x, y)\) coordinate pair.