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 algorithms for inverse problems},
url = {https://github.com/carnotresearch/cr-sparse},
version = {0.1.3},
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.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75dbc7245813be9dd79759666b7fd60d3a1b02b5ec69dd4fea072c3644208b27 |
|
MD5 | 034d6015960004a4fee3cd941782c29a |
|
BLAKE2b-256 | a232cb138fd636a91442ddd338c35b2f0bee7d7c8112ea14399320269ae5dc23 |