probability
Probabilistic reasoning and statistical analysis in TensorFlow
What is probability?
Probabilistic reasoning and statistical analysis in TensorFlow
Overview of probability
What it is
TensorFlow Probability is a library for probabilistic reasoning and statistical analysis in TensorFlow. It is part of the TensorFlow ecosystem and provides integration 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. It also works as “Tensor-friendly Probability” in pure JAX using from tensorflow_probability.substrates import jax as tfp.
Key features
- Distributions (
tfp.distributions): a large collection of probability distributions with batch and broadcasting semantics. - Bijectors (
tfp.bijectors): reversible and composable transformations of random variables, enabling transformed distributions and normalizing flows. - Joint Distributions (e.g.,
tfp.distributions.JointDistributionSequential): joint distributions over one or more possibly-interdependent distributions. - Probabilistic Layers (
tfp.layers): neural network layers with uncertainty over the functions they represent, extending TensorFlow Layers. - Markov chain Monte Carlo (
tfp.mcmc): algorithms for approximating integrals via sampling, including Hamiltonian Monte Carlo and random-walk Metropolis-Hastings. - Variational Inference (
tfp.vi): algorithms for approximating integrals via optimization. - Optimizers (
tfp.optimizer): stochastic optimization methods, including Stochastic Gradient Langevin Dynamics.
Use cases
TensorFlow Probability can be used for hierarchical linear models (e.g., Eight Schools), Bayesian Gaussian mixture models, probabilistic principal components analysis, Gaussian copulas, representation learning with variational autoencoders, Bayesian neural networks, Bayesian logistic regression, and covariance estimation. End-to-end examples are available in the tensorflow_probability/examples/ directory.
Getting started
To install the latest stable version, run the following commands:python -m pip install --upgrade --user pippython -m pip install --upgrade --user tensorflow tensorflow_probabilityFor CPU-only usage, install with tensorflow-cpu instead of tensorflow. For pre-2.0 TensorFlow, see the repository README for alternative instructions.
License and pricing
License: Apache-2.0. Pricing: open source.
Based on the project's public README and repository metadata.