Skip to content

NMF algorithm implementations for CUDA GPUs via python

License

Notifications You must be signed in to change notification settings

aerval/nmf_cuda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NMF_CUDA

Implementation of NMF algorithm in CUDA via python

About

This repository implements a number of Non-negative matrix facotrization (NMF) algorithms for Nvidia CUDA-GPUs using the python libraries (a) cudamat and (b) PyCUDA and scikit-cuda. The project was designed as a replacement for NMF-GPU by Mejia-Roa et al. that only implements Kullbach-Leibler divergence minimizing NMF. We use it to run different NMF algorithms on the GPU in the bratwurst project.

Dependencies

The project is designed so that only some of the used libries need to be installed. You can either run the solver on any normal CPU via numpy, or on CUDA capable GPUs via cudamat or PyCUDA and skcuda. Note that the latter does not support all matrix factorization. Performance is skcuda > cudamat > numpy, the latter especially depending on the used numpy BLAS lib.

Solver

NMF-CUDA includes the following NMF solver:

  • original NMF by Lee & Seung 1999, 2001 for both cost functions Euclidean norm and Kullbach-Leibler divergence
  • sparse NMF (i.e spare results, not deconvolution of sparse matrices)
  • affine NMF from Laurberg & Hansen 2007
  • semiNMF and convexNMF from Ding et al. 2010

Usage

Running nmf.py gives the command line arguments. The project basically takes one large matrix (either a tabseparated text file or numpy matrix) and returns two (three for affine NMF) files of the same format for each NMF run.

Project Structure

The file nmf.py is the command line callable script of the whole project. NMFbase.py provides the NMF base object(s) that are then customized for the three used libraries (library combinations).

About

NMF algorithm implementations for CUDA GPUs via python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages