GithubHelp home page GithubHelp logo

gpflow's Introduction

GPflow

GPflow is a package for building Gaussian process models in python, using TensorFlow. It was written by James Hensman and Alexander G. de G. Matthews.

Install

1) Install Tensorflow fork

To make Gaussian processes work, we've had to add some extra functionality to TensorFlow. You'll need to install our fork. If you are already using tensorflow be aware that changing to our fork may change how it works for you.

EITHER:

1a) Install Tensorflow fork using Pip. Best option for most users.

The sequence of commands for Linux is:

pip uninstall tensorflow
pip install http://mlg.eng.cam.ac.uk/matthews/GPflow/python_packages/version_0.1/linux/tensorflow-0.6.0-py2-none-any.whl

The sequence of commands for Mac OS is:

pip uninstall tensorflow
http://mlg.eng.cam.ac.uk/matthews/GPflow/python_packages/version_0.1/osx/tensorflow-0.6.0-py2-none-any.whl

OR:

1b) Install Tensorflow fork from sources.

You will also need Bazel. The sequence of commands is:

pip uninstall tensorflow
git clone --recurse-submodules github.com/gpflow/tensorflow
cd tensorflow
./configure 
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install /tmp/tensorflow_pkg/<package name>

For more information see this page.

2) install package

GPflow is a pure python library for now, so you could just add it to your path (we use python setup.py develop) or try an install python setup.py install (untested). You can run the tests with python setup.py test.

What's the difference between GPy and GPflow?

GPflow has origins in GPy by the GPy contributors, and much of the interface is intentionally similar for continuity (though some parts of the interface may diverge in future). GPflow has a rather different remit from GPy though:

  • GPflow attempts to leverage tensorflow for faster/bigger computation
  • GPflow has much less code than GPy, mostly because all gradient computation is handled by tensorflow.
  • GPflow focusses on variational inference and MCMC -- there is no expectation propagation or Laplace approximation.
  • GPflow does not do latent variable models (GPLVMs).
  • GPflow does not have any plotting functionality.
  • GPflow is not meant as a tool to teach about GPs. GPy is much better at that.

What models are implemented?

GPflow has a slew of kernels that can be combined in a similar way to GPy (see this tutorial). As for inference, the options are currently:

Regression

For GP regression with Gaussian noise, it's possible to marginalize the function values exactly: you'll find this in GPflow.gpr.GPR. You can do maximum liklelihood or MCMC for the covariance function parameters (notebook).

MCMC

For non-Gaussian likelohoods, GPflow has a model that can jointly sample over the function values and the covariance parameters: GPflow.gpmc.GPMC. There's also a sparse equivalent in GPflow.sgpmc.SGPMC, based on a recent paper [1]. This notebook introduces the interface.

Variational inference

It's often sufficient to approximate the function values as a Gaussian, for which we follow [2] in GPflow.vgp.VGP. In addition, there is a sparse version based on [3] in GPflow.svgp.SVGP. All of the sparse methods in GPflow are solidified in [4].

References

[1] MCMC for Variationally Sparse Gaussian Processes J Hensman, A G de G Matthews, M Filippone, Z Ghahramani Advances in Neural Information Processing Systems, 1639-1647

[2] The variational Gaussian approximation revisited M Opper, C Archambeau Neural computation 21 (3), 786-792

[3] Scalable Variational Gaussian Process Classification J Hensman, A G de G Matthews, Z Ghahramani Proceedings of AISTATS 18, 2015

[4] On Sparse variational methods and the Kullback-Leibler divergence between stochastic processes A G de G Matthews, J Hensman, R E Turner, Z Ghahramani Proceedings of AISTATS 19, 2016

gpflow's People

Contributors

alexggmatthews avatar jameshensman avatar karlnapf avatar

Watchers

 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.