cr.nimble.gaussian_mtx

cr.nimble.gaussian_mtx(key, N, D, normalize_atoms=True)[source]

A dictionary/sensing matrix where entries are drawn independently from normal distribution.

Parameters
  • key – a PRNG key used as the random key.

  • N (int) – Number of rows of the sensing matrix

  • D (int) – Number of columns of the sensing matrix

  • normalize_atoms (bool) – Whether the columns of sensing matrix are normalized (default True)

Returns

A Gaussian sensing matrix of shape (N, D)

Return type

(jax.numpy.ndarray)

Example

>>> from jax import random
>>> import cr.nimble as cnb
>>> m, n = 8, 16
>>> Phi = cnb.gaussian_mtx(random.PRNGKey(0), m, n)
>>> print(Phi.shape)
(8, 16)
>>> print(cnb.norms_l2_cw(Phi))
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]