cr.sparse.dict.rademacher_mtx¶
- cr.sparse.dict.rademacher_mtx(key, M, N, normalize_atoms=True)[source]¶
A dictionary/sensing matrix where entries are drawn independently from Rademacher distribution.
- Parameters
- Returns
A Rademacher sensing matrix of shape (M, N)
- Return type
(jax.numpy.ndarray)
Example
>>> from jax import random >>> import cr.sparse as crs >>> import cr.sparse.dict >>> m, n = 8, 16 >>> Phi = cr.sparse.dict.rademacher_mtx(random.PRNGKey(0), m, n, normalize_atoms=False) >>> print(Phi) [[ 1 1 1 -1 -1 1 -1 -1 1 1 1 -1 1 1 -1 1] [-1 1 1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 1] [ 1 -1 -1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 -1] [ 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 1 -1 1] [-1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1] [-1 1 -1 1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 1] [-1 -1 1 1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1] [ 1 -1 1 1 1 1 1 1 -1 -1 1 -1 -1 1 1 1]]