GithubHelp home page GithubHelp logo

snitish / libgmm Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 22 KB

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

License: MIT License

Makefile 0.78% C 94.44% Mercury 0.25% Python 4.53%

libgmm's Introduction

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')

libgmm's People

Contributors

snitish avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.