Coder Social home page Coder Social logo

juliennonin / variational-gaussian-mixture Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 2.0 1.35 MB

Variational Bayesian Model Selection for Mixture Distributions [Corduneanu&Bishop01][PRML 10.2.1]

Python 60.20% Jupyter Notebook 39.80%
machine-learning gaussian-mixture-models variational-inference variational-bayes-inference prml

variational-gaussian-mixture's Introduction

Variational Bayesian Model Selection for Mixture Distributions

Two Variational Bayesian Gaussian mixture models proposed in [1] and [2] are compared. Their graphical models are respectively shown below. graphical models

  • The implementation for the first model [1], is implemented through the class VariationalGaussianMixture in src.viGMM_CB.
  • The full Bayesian GMM model [2] is implemented in the class VariationalGaussianMixture in src.viGMM_full.

Installation

First clone the project

git clone https://github.com/JulienNonin/variational-gaussian-mixture.git
cd variational-gaussian-mixture

variational-gaussian-mixture runs on Python 3.7. and only requires matplotlib ≥ 3.2.1 and numpy ≥ 1.18.1.

Usage

Import the module

import src as mixture

Load the "Old Faithful" data set and standardize the data.

X = np.loadtxt('data/faithful.txt')
X = (X - X.mean(axis=0)) / X.std(axis=0)

Apply a Bayesian GMM (mixture.VariationalGaussianMixtureCB or mixture.VariationalGaussianMixture)

model = mixture.VariationalGaussianMixtureCB(K=10, display=True, max_iter=201, plot_period=200, init_param="kmeans")
model.fit(X)

This should produce the following output results

References

[1] A. Corduneanu and C. Bishop, Variational Bayesian Model Selection for Mixture Distributions. in Proc. AI and Statistics Conf., Jan. 2001, pp. 27-34.

[2] C. Bishop, Pattern Recognition and Machine Learning (Information Science and Statistics). New York: Springer-Verlag, 2006.


To do

  • Create this README
  • Finally make the model without prior on mixing coefficients (viGMM_CB) work
  • Create a parent class (BaseGaussianMixture)
  • move fit_predict to the parent class
  • Generate a set of synthetic data
  • Fix random initialization of responsabilities
  • Compute the ELBO for GMM_CB
  • Compute the ELBO for GMM_full
  • Better visualization of GM
  • Stopping criterion using the ELBO
  • Make prediction
  • Add prior on mean for GMM_CB to allow non-standardization

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.