Skip to content
/ ggmm Public
forked from ebattenberg/ggmm

Python module to train GMMs using CUDA

Notifications You must be signed in to change notification settings

tspthomas/ggmm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ggmm

Python module to train GMMs using CUDA (via CUDAMat)

Contents

Dependencies
Installation
Example usage
Documentation

###Dependencies

###Installation

Clone ggmm and CUDAMat in local install path:

cd ${INSTALL_PATH}
git clone https://github.com/ebattenberg/ggmm.git
git clone https://github.com/cudamat/cudamat.git

Compile and install CUDAMat:

cd ${INSTALL_PATH}/cudamat
sudo python setup.py install

Run CUDAMat tests (optional, requires nose):

cd ${INSTALL_PATH}/cudamat
nosetests

Run ggmm tests (optional, requires nose):

cd ${INSTALL_PATH}/ggmm
nosetests

###Example Usage

import ggmm.gpu as ggmm

X = some_module.load_training_data()

# N - training examples
# D - data dimension
# K - number of GMM components
N, D = X.shape 
K = 128

ggmm.init()
gmm = ggmm.GMM(K,D)

thresh = 1e-3 # convergence threshold
n_iter = 20 # maximum number of EM iterations
init_params = 'wmc' # initialize weights, means, and covariances

# train GMM
gmm.fit(X, thresh, n_iter, init_params=init_params)

# retrieve parameters from trained GMM
weights = gmm.get_weights()
means = gmm.get_means()
covars = gmm.get_covars()

# compute posteriors of data
posteriors = gmm.compute_posteriors(X)

Documentation

Documentation available here

About

Python module to train GMMs using CUDA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 76.0%
  • Cuda 24.0%