Skip to main content

High performance ℓ₁-minimization solvers

Project description

import sparsesolvers as ss
import numpy as np

N = 10

# Create an example sensing matrix
A = np.random.normal(loc=0.025, scale=0.025, size=(N, N)) + np.identity(N)

# An incoming signal
signal = np.zeros(N)
signal[2] = 1

# Use the homotopy solver to produce sparse solution, x.
x, info = ss.Homotopy(A).solve(signal, tolerance=0.1)

# Example output: error=0.064195, sparsity=0.9, argmax=2
print("error=%f, sparsity=%f, argmax=%i" % (
    info.solution_error, 1 - np.count_nonzero(x) / np.double(N),
    np.argmax(x)))

References

  1. A. Y. Yang, Z. Zhou, A. Ganesh, S. S. Sastry, and Y. MaFast ℓ₁-minimization Algorithms For Robust Face Recognition – IEEE Trans. Image Processing, vol. 22, pp. 3234–3246, Aug 2013.

  2. R. Chartrand, W. YinIteratively Reweighted Algorithms For Compressive Sensing – Acoustics Speech and Signal Processing 2008. ICASSP 2008. IEEE International Conference, pp. 3869-3872, March 2008.

  3. D. O’LearyRobust Regression Computation Using Iteratively Reweighted Least Squares – Society for Industrial and Applied Mathematics, 1990

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

sparsesolvers-0.8.8-cp36-cp36m-manylinux1_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.6m

sparsesolvers-0.8.8-cp35-cp35m-manylinux1_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.5m

sparsesolvers-0.8.8-cp27-cp27mu-manylinux1_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 2.7mu

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page