tensorflow-probability
Probabilistic modeling and statistical inference in TensorFlow
What it is and what it does
TensorFlow Probability is a library for probabilistic reasoning and statistical analysis built on top of TensorFlow. It provides a layered toolkit: distributions with broadcasting semantics, bijectors for transforming random variables, joint distributions for modeling dependencies, probabilistic neural network layers, and inference algorithms including MCMC, variational inference, and Monte Carlo methods. The library integrates automatic differentiation for gradient-based inference and supports hardware acceleration via GPUs and distributed computation.
It is designed for Bayesian machine learning workflows where you need to model uncertainty, perform hierarchical inference, or combine probabilistic methods with deep networks. The package also works as a JAX substrate, allowing the same probabilistic abstractions to run on JAX instead of TensorFlow. It is actively maintained but carries Beta status, meaning its public interfaces may change.
Use it for:
- Build Bayesian neural networks with uncertainty over weights and predictions for safety-critical applications.
- Perform hierarchical statistical modeling and inference on grouped or nested data using joint distributions.
- Implement variational autoencoders and other deep generative models with probabilistic layers.
- Run MCMC sampling for posterior inference in complex probabilistic models.
- Estimate covariances, mixture models, and other statistical quantities with automatic differentiation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
TensorFlow Probability provides probabilistic modeling, statistical inference, and Bayesian machine learning tools integrated with TensorFlow, including distributions, variational inference, MCMC sampling, and neural network layers with uncertainty quantification.
Yes, if you need probabilistic modeling or Bayesian inference in a TensorFlow workflow. The library is actively maintained, has low install friction, carries no security vulnerabilities, and offers a comprehensive toolkit for uncertainty quantification and statistical learning. Install with caution only if TensorFlow is not already a dependency in your project, since it adds a substantial indirect dependency; verify that the Beta status and potential interface changes align with your stability requirements.
Install
tensorflow-probability on PyPI
pip
pip install tensorflow-probabilityuv
uv add tensorflow-probabilitypoetry
poetry add tensorflow-probabilityInstalling tensorflow-probability
Before you install
Low install friction with a pure-Python wheel and common dependencies. The package is actively maintained with recent commits and has been in development since 2018, though it carries a Beta development status indicating interfaces may still change.
License in practice
Apache 2.0 is permissive, allowing commercial and private use with minimal restrictions—you must include a copy of the license and state significant changes, but there are no copyleft obligations.
Quickstart
pip install tensorflow-probability
import tensorflow_probability as tfp
dist = tfp.distributions.Normal(loc=0., scale=1.)
samples = dist.sample()
Requires TensorFlow as an implicit dependency (not listed in runtime deps but essential for core functionality); also requires Python 3.9 or later.
Verify before relying
- Whether TensorFlow is declared as a dependency elsewhere or must be installed separately by the user.
- Performance characteristics and scalability limits for large-scale probabilistic models on GPUs.
- Compatibility and feature parity between TensorFlow and JAX substrate implementations.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — absl-py, six, numpy, decorator, cloudpickle, gast, dm-tree |
| Maintenance | actively maintained — 644 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,223,637/month — #4,195 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tensorflow_probability-0.25.0-py2.py3-none-any.whl
Keywords: tensorflow, probability, statistics, bayesian, machine, learning
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
distraxDistrax provides JAX-native probability…
permissive · top 15,000 on PyPI
problogProbLog is a probabilistic logic programming…
permissive · top 15,000 on PyPI
pyjptpyjpt learns and reasons about joint…
unclear · top 15,000 on PyPI
pytensor-distributionsPyTensor-distributions provides a collection of…
permissive · top 15,000 on PyPI
pyro-pplPyro is a deep probabilistic programming…
permissive · top 5,000 on PyPI
numpyroNumPyro is a probabilistic programming library…
permissive · top 15,000 on PyPI
emceeemcee implements affine-invariant ensemble…
permissive · top 5,000 on PyPI
pyro-apiProvides a generic dispatch API for…
permissive · top 5,000 on PyPI
ngboostNGBoost implements Natural Gradient Boosting…
permissive · top 15,000 on PyPI
pymc3PyMC3 is a Python package for Bayesian…
permissive · top 15,000 on PyPI