GithubHelp home page GithubHelp logo

sandy4321 / py-mcmc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from predictivesciencelab/py-mcmc

0.0 2.0 0.0 236 KB

A simple MCMC framework for training Gaussian processes adding functionality to GPy.

License: GNU Lesser General Public License v3.0

Python 100.00%

py-mcmc's Introduction

A python module implementing some generic MCMC routines

The main purpose of this module is to serve as a simple MCMC framework for generic models. Probably the most useful contribution at the moment, is that it can be used to train Gaussian process (GP) models implemented in the GPy package.

Features

The code features the following things at the moment:

  • Fully object oriented. The models can be of any type as soon as they offer the right interface.
  • Random walk proposals.
  • Metropolis Adjusted Langevin Dynamics.
  • The MCMC chains are stored in fast HDF5 format using PyTables.
  • A mean function can be added to the (GP) models of the GPy package.

Installation

Clone the package, get into its directory and do a:

python setup.py install

Related Packages

Probably, the most related package to what I am offering is the excellent PyMC code. The reason I have departed from it is two-fold:

  • In the old versions (e.g. PyMC 2.3), could not find an easy way to implement Metropolis Adjusted Langevin Dynamics. This was unfortunate because it is one of the most powerful sampling methods when derivatives are available.
  • In the new version (e.g. PyMC 3, which is based on Theano schemes with derivatives can be easily implemented but there are several issues when one tries to deal with existing models. In particular, it is not possible at the moment to deal in an easy way with a model that is not directly implemented using Theano (e.g. if it calls an external library or runs a complicated program). This is a tremendous limitation when it comes to solving realistic inverse problems. In addition, it is not easy to exploit the Gaussian process functionality of GPy in order to train these models with MCMC.

Therefore, the purpose of this package is to fill the gap between PyMC 2.3 and PyMC 3. When the programers of PyMC 3 fix the afforementioned problem, then the MCMC part of this code will become obsolete.

Additional Useful Packages

I have written some other packages that are useful in combination with py-mcmc:

  • Py-ORTHPOL: Construct orthogonal polynomials with respect to arbitrary weight functions. These can be useful as mean functions for the Gaussian processes discussed here. They can be used directly.
  • Py-Design: Design of experiments for Python. This is extremely useful if you are trying to learn the output of a computer code and you want to a good design of points to evaluate it.

Demos

I provide various demos demonstrating how the code can be used:

  • demos/demo1.py: Demonstrates how to train GPy model using MCMC.
  • demos/demo2.py: Demonstrates how a GP with a mean can be trained. This model is equivalent to Bayesian linear regression.
  • demos/demo3.py: Demonstrates how a GP with a mean using automatic relevance determination for the basis functions can be used. This is equivalent to a Relevance Vector Machine model.
  • demos/demo4.py: Demonstrates how a GP with a mean can be combined with a normal covariance kernel.

Ilias Bilionis, December, 2014 PredictiveScience Laboratory, School of Mechanical Engineering, Purdue University, West Lafayette, IN, USA

py-mcmc's People

Contributors

ebilionis avatar

Watchers

James Cloos avatar  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.