Skip to content

Cython Implementation of Orthogonal Matching Pursuit — maybe it'll be useful to someone

License

Notifications You must be signed in to change notification settings

canbakiskan/cython-omp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cython Implementation of Orthogonal Matching Pursuit

This repository implements orthogonal matching pursuit (OMP) and least absolute shrinkage and selection operator (lasso) algorithm in numba and Cython.

Requirements

Install the requirements:

sudo apt-get install libatlas-base-dev # or equivalent
pip install -r requirements.txt

Then add project and reconstruction methods directories to $PYTHONPATH:

export PYTHONPATH="${PYTHONPATH}:/path/containing/project/directory/"
export PYTHONPATH="${PYTHONPATH}:/path/containing/project/directory/cython-omp/src/reconstruction_methods/" # this is because of ray's relative import inability

Following commands assume the name of the folder is cython-omp.

Dictionary Learning

To learn the overcomplete dictionary, run:

python -m cython-omp.src.learn_patch_dict

Compiling Cython scripts

cd src/reconstruction_methods
python omp_setup.py build_ext --inplace
python lasso_setup.py build_ext --inplace

Reconstruction Demo

python -m cython_omp.src.demo --method=<method>

choices for the method are:

  • OMP_numba
  • OMP_batch_numba
  • OMP_cython
  • OMP_batch_cython (default)
  • lasso_numba
  • lasso_batch_numba
  • lasso_cython
  • lasso_batch_cython

License

Apache License 2.0

About

Cython Implementation of Orthogonal Matching Pursuit — maybe it'll be useful to someone

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages