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
[![Codacy Badge]()]()
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.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea86cfaf4b37e7faabe78a6230d99d1cbaeb9aa0d02532a2cacb14e7067467e2 |
|
MD5 | 6a3253ce508def5a0a050cf15f7c88dd |
|
BLAKE2b-256 | d65e9c9c4706177deab33abc1bf1003a71c3179a943e7d2cc82b4eef55bd647d |