Accelerated sparse representations and compressive sensing
Project description
An overview of the library.
This library aims to provide XLA/JAX based Python implementations for various algorithms related to:
Sparse approximation
Compressive sensing
Dictionary learning
The library also provides
Various simple dictionaries and sensing matrices
Sample data generation utilities
Framework for evaluation of sparse recovery algorithms
Example usage
A greedy pursuit based sparse recovery with synthetic data
Build a Gaussian dictionary/sensing matrix:
from jax import random
import cr.sparse.dict as crdict
M = 128
N = 256
key = random.PRNGKey(0)
Phi = crdict.gaussian_mtx(key, M,N)
Build a K-sparse signal with Gaussian non-zero entries:
import cr.sparse.data as crdata
import jax.numpy as jnp
K = 16
key, subkey = random.split(key)
x, omega = crdata.sparse_normal_representations(key, N, K, 1)
x = jnp.squeeze(x)
Build the measurement vector:
y = Phi @ x
Import the Compressive Sampling Matching Pursuit sparse recovery solver:
from cr.sparse.pursuit import cosamp
Solve the recovery problem:
solution = cosamp.matrix_solve(Phi, y, K)
For the complete set of available solvers, see the documentation.
Citing CR.Sparse
To cite this repository:
@software{crsparse2021github,
author = {Shailesh Kumar},
title = {{CR.Sparse}: XLA Accelerated Functional Models and Algorithms for Sparse Representations based Signal Processing},
url = {https://cr-sparse.readthedocs.io/en/latest/},
version = {0.1.5},
year = {2021},
}
Documentation | Code | Issues | Discussions | Examples | Experiments | Sparse-Plex
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cr_sparse-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c837241f04f20a7faee7962745478f56c18ec66b301e8b8676ad0535be849f0a |
|
MD5 | 8d88fcf7f3056f5c94b154ed58ef83b3 |
|
BLAKE2b-256 | b55cefcbb903d0b2d63bca680c7acb50ac1ec09f03f03cb05e34c3bd7fdf0a90 |