Skip to main content

Optimization and Regularization variants of NMF

Project description

# libNMF

The library contains implementations of different optimization and regularization variants of non-negative matrix factorization.

List of algorithms implemented:
1. Multiplicative Update Rule (
2. Alternating Least Squares NMF (
3. Graph Regularized NMF (
4. Probabilistc NMF (
5. Kernel NMF (
6. Chambolle-Pock based first-order primal dual algo (

## Setup:

To get the project's source code, clone the github repository:

$ git clone

Install VirtualEnv using the following (optional):

$ [sudo] pip install virtualenv

Create and activate your virtual environment (optional):

$ virtualenv venv
$ source venv/bin/activate

Install all the required packages:

$ pip install -r requirements.txt

Install the library by running the following command from the root directory of the repository:

$ python install

## Usage:

>>> import numpy as np

>>> # For Graph Regularized NMF
>>> from libnmf.gnmf import GNMF
>>> X = np.random.random((10,10))
>>> gnmf= GNMF(X, rank=4)
>>> gnmf.compute_factors(max_iter= 20, lmd= 0.3, weight_type='heat-kernel', param= 0.4)

>>> # For first-order primal-dual algo
>>> from libnmf.fpdnmf import FPDNMF
>>> fpdnmf= FPDNMF(X, rank=4)
>>> fpdnmf.compute_factors(max_iter=30, nditer=5)
>>> #print fpdnmf.W, fpdnmf.H, fpdnmf.div_error

Refer to examples/Simple-Usage.ipynb for more on usage.

## References

* [1] Lee, D. D., & Seung, H. S. (2001). Algorithms for non-negative matrix factorization. In Advances in neural information processing systems (pp. 556-562). [Paper](

* [2] Lee, D. D. and Seung, H. S. (1999), Learning the Parts of Objects by Non-negative Matrix Factorization, Nature 401(6755), 788-799. [Paper](

* [3] Cai, D., He, X., Han, J., & Huang, T. S. (2011). Graph regularized nonnegative matrix factorization for data representation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(8), 1548-1560. [Paper](

* [4] Bayar, B., Bouaynaya, N., & Shterenberg, R. (2014). Probabilistic non-negative matrix factorization: theory and application to microarray data analysis. Journal of bioinformatics and computational biology, 12(01), 1450001. [Paper](

* [5] Zhang, D., Zhou, Z. H., & Chen, S. (2006). Non-negative matrix factorization on kernels. PRICAI 2006: Trends in Artificial Intelligence, 404-412. [Paper](

* [6] Yanez, Felipe, and Francis Bach. "Primal-dual algorithms for non-negative matrix factorization with the Kullback-Leibler divergence." In Acoustics, Speech and Signal Processing (ICASSP), 2017 IEEE International Conference on, pp. 2257-2261. IEEE, 2017. [Paper](

Project details

Download files

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

Files for libNMF, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size libNMF-0.1.2-py3-none-any.whl (10.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size libNMF-0.1.2.tar.gz (7.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page