TensorFlow Probability
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
TensorFlow Probability 是 TensorFlow 中用于概率推理和统计分析的库。TensorFlow Probability 是 TensorFlow 生态系统的一部分,提供了概率方法与深度网络的集成、使用自动微分的基于梯度的推理,并能扩展到包含硬件加速 (GPU) 和分布式计算的大型数据集和大型模型。
要开始使用 TensorFlow Probability,请参阅安装指南并查看 Python 笔记本教程。
组件
我们的概率机器学习工具采用如下结构:
第 0 层:TensorFlow
数值运算(尤其是 LinearOperator
类)使无矩阵实现成为可能,这类实现可以利用特定结构(对角、低秩等)实现高效的计算。它由 TensorFlow Probability 团队构建和维护,已成为核心 TensorFlow 中 tf.linalg
的一部分。
第 1 层:统计构建块
第 2 层:模型构建
第 3 层:概率推理
TensorFlow Probability 正在积极开发,接口可能变化。
示例
除了导航中列出的 Python 笔记本教程外,还提供了一些示例脚本:
报告问题
使用 TensorFlow Probability 问题跟踪器报告错误或提交功能请求。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2022-09-21。
[null,null,["最后更新时间 (UTC):2022-09-21。"],[],[],null,["# TensorFlow Probability\n\n\u003cbr /\u003e\n\nTensorFlow Probability is a library for probabilistic reasoning and statistical\nanalysis in TensorFlow. As part of the TensorFlow ecosystem, TensorFlow\nProbability provides integration of probabilistic methods with deep networks,\ngradient-based inference using automatic differentiation, and scalability to\nlarge datasets and models with hardware acceleration (GPUs) and distributed\ncomputation.\n\nTo get started with TensorFlow Probability, see the\n[install guide](./install) and view the\n[Python notebook tutorials](https://github.com/tensorflow/probability/blob/main/tensorflow_probability/examples/jupyter_notebooks/).\n\nComponents\n----------\n\nOur probabilistic machine learning tools are structured as follows:\n\n### Layer 0: TensorFlow\n\n*Numerical operations* ---in particular, the `LinearOperator`\nclass---enables matrix-free implementations that can exploit a particular structure\n(diagonal, low-rank, etc.) for efficient computation. It is built and maintained\nby the TensorFlow Probability team and is part of\n[`tf.linalg`](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python/ops/linalg)\nin core TensorFlow.\n\n### Layer 1: Statistical Building Blocks\n\n- *Distributions* ([`tfp.distributions`](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/python/distributions)): A large collection of probability distributions and related statistics with batch and [broadcasting](https://docs.scipy.org/doc/numpy-1.14.0/user/basics.broadcasting.html) semantics.\n- *Bijectors* ([`tfp.bijectors`](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/python/bijectors)): Reversible and composable transformations of random variables. Bijectors provide a rich class of transformed distributions, from classical examples like the [log-normal distribution](https://en.wikipedia.org/wiki/Log-normal_distribution) to sophisticated deep learning models such as [masked autoregressive flows](https://arxiv.org/abs/1705.07057).\n\n### Layer 2: Model Building\n\n- Joint Distributions (e.g., [`tfp.distributions.JointDistributionSequential`](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/python/distributions/joint_distribution_sequential.py)): Joint distributions over one or more possibly-interdependent distributions. For an introduction to modeling with TFP's `JointDistribution`s, check out [this colab](https://github.com/tensorflow/probability/blob/main/tensorflow_probability/examples/jupyter_notebooks/Modeling_with_JointDistribution.ipynb)\n- *Probabilistic layers* ([`tfp.layers`](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/python/layers)): Neural network layers with uncertainty over the functions they represent, extending TensorFlow layers.\n\n### Layer 3: Probabilistic Inference\n\n- *Markov chain Monte Carlo* ([`tfp.mcmc`](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/python/mcmc)): Algorithms for approximating integrals via sampling. Includes [Hamiltonian Monte Carlo](https://en.wikipedia.org/wiki/Hamiltonian_Monte_Carlo), random-walk Metropolis-Hastings, and the ability to build custom transition kernels.\n- *Variational Inference* ([`tfp.vi`](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/python/vi)): Algorithms for approximating integrals through optimization.\n- *Optimizers* ([`tfp.optimizer`](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/python/optimizer)): Stochastic optimization methods, extending TensorFlow Optimizers. Includes [Stochastic Gradient Langevin Dynamics](http://www.icml-2011.org/papers/398_icmlpaper.pdf).\n- *Monte Carlo* ([`tfp.monte_carlo`](https://github.com/tensorflow/probability/blob/main/tensorflow_probability/python/monte_carlo)): Tools for computing Monte Carlo expectations.\n\nTensorFlow Probability is under active development and interfaces may change.\n\nExamples\n--------\n\nIn addition to the\n[Python notebook tutorials](https://github.com/tensorflow/probability/blob/main/tensorflow_probability/examples/jupyter_notebooks/)\nlisted in the navigation, there are some example scripts available:\n\n- [Variational Autoencoders](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/examples/vae.py) ---Representation learning with a latent code and variational inference.\n- [Vector-Quantized Autoencoder](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/examples/vq_vae.py) ---Discrete representation learning with vector quantization.\n- [Bayesian Neural Networks](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/examples/bayesian_neural_network.py) ---Neural networks with uncertainty over their weights.\n- [Bayesian Logistic Regression](https://github.com/tensorflow/probability/tree/main/tensorflow_probability/examples/logistic_regression.py) ---Bayesian inference for binary classification.\n\nReport issues\n-------------\n\nReport bugs or feature requests using the\n[TensorFlow Probability issue tracker](https://github.com/tensorflow/probability/issues)."]]