Skip to content
/ libgmm Public

A library for training Gaussian Mixture Models written in C, with wrappers for MATLAB and Python.

License

Notifications You must be signed in to change notification settings

snitish/libgmm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0e987ce · Dec 28, 2015

History

19 Commits
Dec 28, 2015
Nov 27, 2015
Oct 15, 2015
Oct 29, 2015
Oct 6, 2015
Oct 29, 2015
Oct 29, 2015
Nov 27, 2015
Nov 27, 2015
Nov 27, 2015

Repository files navigation

libgmm

A library for training Gaussian Mixture Models written in C.

How to build

  • To enable OpenMP, add the '-fopenmp' option to line 2 of Makefile
CFLAGS = -std=c99 -O3 -fopenmp
  • To build the library, navigate to the libgmm directory using the terminal and type
make
  • To build the MATLAB wrapper, run matlab/make.m from the MATLAB console.
  • To build and the Python wrapper, navigate to the libgmm/python directory using the terminal and type
python setup.py install

Usage

  • Using C API

Refer to test.c

  • MATLAB wrapper
gmm = trainGMM(X, k, 'Name', 'Value', ...);

Where,
X = NxD data matrix containing N data points, each of length D
k = Number of GMM components

Optional name-value pairs:

  • CovType = Covariance matrix type: "diagonal" or "spherical". (Default "diagonal")
  • MaxIter = Maximum number of EM iterations. (Default 1000)
  • ConvergenceTol = Convergence tolerance. (Default 1e-6)
  • RegularizationValue = Regularization Value (small value added to covariance matrix to prevent it from being singular). (Default 1e-6)
  • InitMethod = GMM parameter initialization method. Can be 'random' or 'kmeans'. (Default 'random')
  • Python wrapper
import gmm
gmm1 = gmm.GMM(k=1, CovType='diagonal', MaxIter=1000, ConvergenceTol=1e-6, RegularizationValue=1e-6, InitMethod='random')
gmm1.fit(X)

Where,

  • X = NxD numpy matrix containing N data points, each of length D
  • k = Number of GMM components. (Default 1)
  • CovType = Covariance matrix type: "diagonal" or "spherical". (Default "diagonal")
  • MaxIter = Maximum number of EM iterations. (Default 1000)
  • ConvergenceTol = Convergence tolerance. (Default 1e-6)
  • RegularizationValue = Regularization Value (small value added to covariance matrix to prevent it from being singular). (Default 1e-6)
  • InitMethod = GMM parameter initialization method. Can be 'random' or 'kmeans'. (Default 'random')

About

A library for training Gaussian Mixture Models written in C, with wrappers for MATLAB and Python.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages