Metadata-Version: 2.1
Name: cr-sparse
Version: 0.1.4
Summary: Accelerated sparse representations and compressive sensing
Home-page: https://carnotresearch.github.io/cr-sparse
Author: CR.Sparse Development Team
Author-email: contact@carnotresearch.com
License: Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
Download-URL: https://github.com/carnotresearch/cr-sparse/archive/v0.1.4.tar.gz
Project-URL: Issue Tracker, https://github.com/carnotresearch/cr-sparse/issues
Keywords: Computer Vision
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Multimedia
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
Requires-Dist: chex (>=0.0.4)
Requires-Dist: jax (>=0.1.55)
Requires-Dist: jaxlib (>=0.1.37)
Requires-Dist: numpy (>=1.18.0)
Requires-Dist: sympy (>=1.6)
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: pandas (>=1.0.0)
Requires-Dist: imageio
Requires-Dist: click
Provides-Extra: dev
Provides-Extra: docs
Requires-Dist: sphinx (>=3.3.0) ; extra == 'docs'
Requires-Dist: sphinx-rtd-theme (>=0.5.0) ; extra == 'docs'
Requires-Dist: sphinxcontrib-katex (>=0.7.1) ; extra == 'docs'
Requires-Dist: sphinxcontrib-bibtex (>=1.0.0) ; extra == 'docs'
Requires-Dist: sphinx-autodoc-typehints (>=1.11.1) ; extra == 'docs'
Requires-Dist: IPython (>=7.16.1) ; extra == 'docs'
Requires-Dist: ipykernel (>=5.3.4) ; extra == 'docs'
Requires-Dist: pandoc (>>=1.0.2) ; extra == 'docs'
Requires-Dist: nbsphinx (>=0.8.0) ; extra == 'docs'
Provides-Extra: examples
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'

Accelerated sparse representations and compressive sensing
====================================================================

|docs| |unttests| |coverage|

An `overview <https://carnotresearch.github.io/cr-sparse/intro.html>`_ 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
----------------

.. rubric:: A greedy pursuit based sparse recovery with synthetic data

Build a Gaussian dictionary/sensing matrix:

.. code:: python

  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:

.. code:: python

  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:

.. code:: python

  y = Phi @ x


Import the Compressive Sampling Matching Pursuit sparse recovery solver:

.. code:: python

  from cr.sparse.pursuit import cosamp

Solve the recovery problem:

.. code:: python

  solution =  cosamp.matrix_solve(Phi, y, K)

For the complete set of available solvers, see the documentation.


Citing CR.Sparse
------------------------


To cite this repository:

.. code:: tex

    @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 <https://carnotresearch.github.io/cr-sparse>`_ | 
`Code <https://github.com/carnotresearch/cr-sparse>`_ | 
`Issues <https://github.com/carnotresearch/cr-sparse/issues>`_ | 
`Discussions <https://github.com/carnotresearch/cr-sparse/discussions>`_ |
`Examples <https://github.com/carnotresearch/cr-sparse/blob/master/examples/notebooks/README.rst>`_ |
`Experiments <https://github.com/carnotresearch/cr-sparse/blob/master/experiments/README.rst>`_ |
`Sparse-Plex <https://sparse-plex.readthedocs.io>`_


.. |docs| image:: https://github.com/carnotresearch/cr-sparse/actions/workflows/sphinx.yaml/badge.svg
    :alt: Documentation Status
    :scale: 100%
    :target: https://github.com/carnotresearch/cr-sparse/actions/workflows/sphinx.yaml

.. |unttests| image:: https://github.com/carnotresearch/cr-sparse/actions/workflows/ci.yml/badge.svg
    :alt: Unit Tests
    :scale: 100%
    :target: https://github.com/carnotresearch/cr-sparse/actions/workflows/ci.yml



.. |coverage| image:: https://codecov.io/gh/carnotresearch/cr-sparse/branch/master/graph/badge.svg?token=JZQW6QU3S4
    :alt: Coverage
    :scale: 100%
    :target: https://codecov.io/gh/carnotresearch/cr-sparse


