pysparse.cs.sensing package¶
Submodules¶
pysparse.cs.sensing.obsmat module¶
-
pysparse.cs.sensing.obsmat.
bernoulli
(shape, seed=None, verbose=True)[source]¶ return a matrix, which have bernoulli distribution elements columns are l2 normalized
-
pysparse.cs.sensing.obsmat.
bernoulli0
(shape, seed=None, verbose=True)[source]¶ generates Bernoulli observation matrix
Generates M-by-N Bernoulli observation matrix
\[{\bm \Phi}_{ij} =\left\{\begin{array}{cc}{+\frac{1}{\sqrt{M}}} & {P=\frac{1}{2}} \\ {-\frac{1}{\sqrt{M}}} & {P=\frac{1}{2}}\end{array}= \frac{1}{\sqrt{M}}\left\{\begin{array}{cc}{+1} & {P=\frac{1}{2}} \\ {-1} & {P=\frac{1}{2}}\end{array}\right.\right. \]Parameters: shape (list or tuple) – shape of Bernoulli observation matrix [M, N] Keyword Arguments: verbose (bool) – display log info (default: {True}) Returns: Phi – Bernoulli observation matrix Return type: ndarray
-
pysparse.cs.sensing.obsmat.
gaussian
(shape, seed=None, verbose=True)[source]¶ generates Gauss observation matrix
Generates M-by-N Gauss observation matrix which have gaussian distribution elements( columns are l2 normalized).
\[{\bm \Phi} \sim {\mathcal N}(0, \frac{1}{M}) \]Parameters: shape (list or tuple) – shape of Gauss observation matrix [M, N] Keyword Arguments: verbose (bool) – display log info (default: {True}) Returns: A – Gauss observation matrix \(\bm A\). Return type: ndarray
-
pysparse.cs.sensing.obsmat.
gaussian0
(shape, seed=None, verbose=True)[source]¶ generates Gauss observation matrix
Generates M-by-N Gauss observation matrix
\[{\bm \Phi} \sim {\mathcal N}(0, \frac{1}{M}) \]Parameters: shape (list or tuple) – shape of Gauss observation matrix [M, N] Keyword Arguments: verbose (bool) – display log info (default: {True}) Returns: Phi – Gauss observation matrix \(\bm \Phi\). Return type: ndarray
-
pysparse.cs.sensing.obsmat.
toeplitz
(shape, verbose=True)[source]¶ generates Toeplitz observation matrix
Generates M-by-N Toeplitz observation matrix
\[{\bm \Phi}_{ij} = \left[\begin{array}{ccccc}{a_{0}} & {a_{-1}} & {a_{-2}} & {\cdots} & {a_{-n+1}} \\ {a_{1}} & {a_{0}} & {a_{-1}} & {\cdots} & {a_{-n+2}} \\ {a_{2}} & {a_{1}} & {a_{0}} & {\cdots} & {a_{-n+3}} \\ {\vdots} & {\vdots} & {\vdots} & {\ddots} & {\vdots} \\ {a_{n-1}} & {a_{n-2}} & {a_{n-3}} & {\cdots} & {a_{0}}\end{array}\right] \]Parameters: shape (list or tuple) – shape of Toeplitz observation matrix [M, N] Keyword Arguments: verbose (bool) – display log info (default: {True}) Returns: A – Toeplitz observation matrix \(\bm A\). Return type: ndarray