Git Product home page Git Product logo

probability's Introduction

TensorFlow Probability

This package collects tools for probabilistic reasoning in TensorFlow. It is intended to serve as a hub for development of modeling tools, inference algorithms, useful models, and general statistical computation. Taking advantage of the TensorFlow ecosystem allows straightforward combination of probabilistic methods with deep networks, gradient-based inference via automatic differentiation, and scalability to large datasets and models via hardware acceleration (e.g., GPUs) and distributed computation.

Contents of this package currently include:

  • Sampling algorithms E.g., tfp.mcmc.sample_chain, tfp.mcmc.HamiltonianMonteCarlo, tfp.monte_carlo.expectation.
  • Example models (tfp.examples): implementations of common probability models in TensorFlow using tools from this package and from tf.contrib.distributions.

Contents of this repository should be considered under active development; interfaces may change at any time. We welcome external contributions! See Contributing for details.

Installation

As simple as:

pip install tfp-nightly --user --upgrade     # depends on tensorflow (CPU-only)

We also provide a GPU-enabled flavor:

pip install tfp-nightly-gpu --user --upgrade # depends on tensorflow-gpu (GPU enabled)

TensorFlow Probability does not currently contain any GPU-specific code; the primary difference between these packages is that tensorflow-probability-gpu depends on a GPU-enabled version of TensorFlow.

To force a Python 3-specific install, replace pip with pip3 in the above commands. For additional installation help, guidance installing prerequisites, and (optionally) setting up virtual environments, see the TensorFlow installation guide.

You can also install from source. This requires the Bazel build system.

git clone https://github.com/tensorflow/probability.git
cd probability
bazel build --config=opt --copt=-O3 --copt=-march=native :pip_pkg
./bazel-bin/pip_pkg /tmp/tensorflow_probability_pkg
pip install /tmp/tensorflow_probability_pkg/*.whl --user --upgrade

Examples

It is often easiest to learn by example. The examples/ directory contains reference implementations of common probabilistic models and demonstrates idiomatic styles for building probability models in TensorFlow. Example code may be run directly from the command line, e.g.,

python -m tensorflow_probability.examples.weight_uncertainty.mnist_deep_nn

to train a Bayesian deep network to classify MNIST digits. See the examples directory for the list of example implementations.

Usage

After you've installed tensorflow_probability, functions can be accessed as:

import tensorflow_probability as tfp

Contributing

We're eager to collaborate with you! Feel free to open an issue on GitHub and/or send us your pull requests. See our contribution doc for more details.

probability's People

Contributors

csuter avatar davmre 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.