Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sparse coding in Python [closed]

I'm looking for a library which implements the most common sparse coding and dictionary learning algorithms with a python interface, any suggestion?

like image 362
Luca Fiaschi Avatar asked Sep 15 '11 09:09

Luca Fiaschi


People also ask

Where is sparse coding used?

Sparse coding can be used to compress a set of signals, reducing the resources needed. Compressed sensing The goal here is to measure signals efficiently by exploiting knowledge about their structure. This allows more efficient storage and transmission, and may also allow measurements to be made more quickly.

How does Python deal with sparse matrix?

The solution to representing and working with sparse matrices is to use an alternate data structure to represent the sparse data. The zero values can be ignored and only the data or non-zero values in the sparse matrix need to be stored or acted upon.

What is sparse coding in neural network?

Sparse coding is the representation of items by the strong activation of a relatively small set of neurons. For each stimulus, this is a different subset of all available neurons.

What is sparse coding in machine learning?

Sparse coding is a class of unsupervised methods for learning sets of over-complete bases to represent data efficiently. The aim of sparse coding is to find a set of basis vectors ϕi such that we can represent an input vector x as a linear combination of these basis vectors: x=k∑i=1aiϕi.


2 Answers

Regarding this question; seems that a library which implements most of Sparse Coding algorithms is SPAMS http://spams-devel.gforge.inria.fr/ which now offers Python support

like image 81
Luca Fiaschi Avatar answered Oct 18 '22 10:10

Luca Fiaschi


That's a pretty broad question. Among sparse coding, dictionary learning, and nonnegative factorization, there are plenty of methods, many of which are still so new that there does not yet exist a dominant piece of Python software that is universally accepted.

These research areas have been my recent focus, and I primarily use Python. I just decided to write my own simple versions of matching pursuit, NMF (and nonnegative LS), KSVD, and more. I might recommend doing the same for your specific purposes; they are not difficult to implement and modify. Just get used to Numpy, Scipy, and numpy.linalg.

That said, there are publicly available Python tools, but you will need to search more specifically. For instance, "matching pursuit python" yields a few results.

For those with convex optimization formulations, you could use CVX which is really easy to use, but you may not find it fast enough.

like image 41
Steve Tjoa Avatar answered Oct 18 '22 11:10

Steve Tjoa