Xác suất dòng chảy Tensor
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
TensorFlow Probability là một thư viện dành cho lý luận xác suất và phân tích thống kê trong TensorFlow. Là một phần của hệ sinh thái TensorFlow, TensorFlow Probability cung cấp khả năng tích hợp các phương pháp xác suất với mạng sâu, suy luận dựa trên độ dốc bằng cách sử dụng tính năng phân biệt tự động và khả năng mở rộng cho các bộ dữ liệu và mô hình lớn với khả năng tăng tốc phần cứng (GPU) và tính toán phân tán.
Để bắt đầu với Xác suất TensorFlow, hãy xem hướng dẫn cài đặt và xem hướng dẫn sổ ghi chép Python .
Các thành phần
Các công cụ học máy xác suất của chúng tôi được cấu trúc như sau:
Lớp 0: TensorFlow
Các phép toán số —đặc biệt là lớp LinearOperator
—cho phép triển khai không cần ma trận và có thể khai thác một cấu trúc cụ thể (đường chéo, thứ hạng thấp, v.v.) để tính toán hiệu quả. Nó được xây dựng và duy trì bởi nhóm TensorFlow Probability và là một phần của tf.linalg
trong lõi TensorFlow.
Lớp 1: Khối xây dựng thống kê
Lớp 2: Xây dựng mô hình
- Phân phối chung (ví dụ:
tfp.distributions.JointDistributionSequential
): Phân phối chung trên một hoặc nhiều phân phối có thể phụ thuộc lẫn nhau. Để biết phần giới thiệu về lập mô hình với JointDistribution
của TFP, hãy xem colab này - Các lớp xác suất (
tfp.layers
): Các lớp mạng thần kinh không chắc chắn về các chức năng mà chúng đại diện, mở rộng các lớp TensorFlow.
Lớp 3: Suy luận xác suất
- Chuỗi Markov Monte Carlo (
tfp.mcmc
): Thuật toán tính gần đúng tích phân thông qua lấy mẫu. Bao gồm Hamiltonian Monte Carlo , Metropolis-Hastings đi bộ ngẫu nhiên và khả năng xây dựng các hạt nhân chuyển tiếp tùy chỉnh. - Suy luận biến phân (
tfp.vi
): Thuật toán tính gần đúng tích phân thông qua tối ưu hóa. - Trình tối ưu hóa (
tfp.optimizer
): Các phương pháp tối ưu hóa ngẫu nhiên, mở rộng Trình tối ưu hóa TensorFlow. Bao gồm Động lực học Langevin gradient ngẫu nhiên . - Monte Carlo (
tfp.monte_carlo
): Công cụ tính toán kỳ vọng của Monte Carlo.
Xác suất TensorFlow đang được phát triển tích cực và giao diện có thể thay đổi.
Ví dụ
Ngoài các hướng dẫn về sổ ghi chép Python được liệt kê trong phần điều hướng, còn có một số tập lệnh mẫu có sẵn:
Báo cáo vấn đề
Báo cáo lỗi hoặc yêu cầu tính năng bằng cách sử dụng trình theo dõi vấn đề Xác suất TensorFlow .
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],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)."]]