pyro

pyro-pplApache-2.0活跃维护

基于 PyTorch 的深度概率编程库,用 Python 写贝叶斯模型,支持变分推断和 MCMC,适合做不确定性建模与生成模型研究。

Deep universal probabilistic programming with Python and PyTorch

1.9.2发布于 2026-10-03 18:23 UTC9,074star +1 / 7 天1,039fork同步于 2026-11-10 11:30 UTC

怎么上手

由 README 提炼,执行前请确认
pip install pyro-ppl
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 PyTorch 的通用深度概率编程库,用少量代码表达生成模型与推断

基于 PyTorch 的深度概率编程库,用 Python 写贝叶斯模型,支持变分推断和 MCMC,适合做不确定性建模与生成模型研究。

核心能力

  • 可表示任意可计算的概率分布
  • 以小型可组合抽象为核心实现
  • 高层抽象写模型,专家可定制推断
  • 相比手写代码开销小,可扩展大数据集

容易踩的坑

跑 examples/tutorials 里的模型需额外安装 pip install pyro-ppl[extras];extras 模型须与已安装的 Pyro 版本同源;README 未说明默认端口等其他限制

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本1.9.2
  1. 1.9.2最新正式版2026-10-03 · 2026-10-03 18:23 UTC

    What's Changed

  2. 1.9.12024-06-02 · 2024-06-02 00:37 UTC
    查看更新说明

    New Features

    Type hints

    Additional changes

    New Contributors

    Full Changelog: https://github.com/pyro-ppl/pyro/compare/1.9.0...1.9.1

  3. 1.9.02024-02-19 · 2024-02-19 18:02 UTC
    查看更新说明

    Breaking Changes

    • Drop support for PyTorch 1
    • Drop support for Python 3.7

    New features

    • Type hints are now available in some parts of Pyro, thanks to @ordabayevy. Please let us know about any issues. We welcome help adding type hints to remaining parts of Pyro. #2550
    • New tutorials using Zuko normalizing flows by @francois-rozet
    • A new simple RandomWalkKernel by @martinjankowiak
    • A new SimplexToOrderedTransform by @peblair
    • A new simple PyTorch training example by @eb8680

    Detailed Changes

  4. 1.8.62023-07-29 · 2023-07-29 21:20 UTC
    查看更新说明

    Summary

    • Reenable support for PyTorch 1.11 (after Pyro's 1.8.5 release had narrowly required torch>=2.0)
    • Improve docstrings of Pyro's distribution wrappers around torch distributions #3246

    What's Changed

    New Contributors

    Full Changelog: https://github.com/pyro-ppl/pyro/compare/1.8.5...1.8.6

  5. 1.8.52023-05-29 · 2023-05-29 02:59 UTC
    查看更新说明

    This release includes a number of fixes to support PyTorch 2.

    What's Changed

    New Contributors

    Full Changelog: https://github.com/pyro-ppl/pyro/compare/1.8.4...1.8.5

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Build Status Coverage Status Latest Version Documentation Status CII Best Practices

    Getting Started | Documentation | Community | Contributing

    Pyro is a flexible, scalable deep probabilistic programming library built on PyTorch. Notably, it was designed with these principles in mind:

    • Universal: Pyro is a universal PPL - it can represent any computable probability distribution.
    • Scalable: Pyro scales to large data sets with little overhead compared to hand-written code.
    • Minimal: Pyro is agile and maintainable. It is implemented with a small core of powerful, composable abstractions.
    • Flexible: Pyro aims for automation when you want it, control when you need it. This is accomplished through high-level abstractions to express generative and inference models, while allowing experts easy-access to customize inference.

    Pyro was originally developed at Uber AI and is now actively maintained by community contributors, including a dedicated team at the Broad Institute. In 2019, Pyro became a project of the Linux Foundation, a neutral space for collaboration on open source software, open standards, open data, and open hardware.

    For more information about the high level motivation for Pyro, check out our launch blog post. For additional blog posts, check out work on experimental design and time-to-event modeling in Pyro.

    Installing

    Installing a stable Pyro release

    Install using pip:

    pip install pyro-ppl
    

    Install from source:

    git clone [email protected]:pyro-ppl/pyro.git
    cd pyro
    git checkout master  # master is pinned to the latest release
    pip install .
    

    Install with extra packages:

    To install the dependencies required to run the probabilistic models included in the examples/tutorials directories, please use the following command:

    pip install pyro-ppl[extras] 
    

    Make sure that the models come from the same release version of the Pyro source code as you have installed.

    Installing Pyro dev branch

    For recent features you can install Pyro from source.

    Install Pyro using pip:

    pip install git+https://github.com/pyro-ppl/pyro.git
    

    or, with the extras dependency to run the probabilistic models included in the examples/tutorials directories:

    pip install git+https://github.com/pyro-ppl/pyro.git#egg=project[extras]
    

    Install Pyro from source:

    git clone https://github.com/pyro-ppl/pyro
    cd pyro
    pip install .  # pip install .[extras] for running models in examples/tutorials
    

    Running Pyro from a Docker Container

    Refer to the instructions here.

    Citation

    If you use Pyro, please consider citing:

    @article{bingham2019pyro,
      author    = {Eli Bingham and
                   Jonathan P. Chen and
                   Martin Jankowiak and
                   Fritz Obermeyer and
                   Neeraj Pradhan and
                   Theofanis Karaletsos and
                   Rohit Singh and
                   Paul A. Szerlip and
                   Paul Horsfall and
                   Noah D. Goodman},
      title     = {Pyro: Deep Universal Probabilistic Programming},
      journal   = {J. Mach. Learn. Res.},
      volume    = {20},
      pages     = {28:1--28:6},
      year      = {2019},
      url       = {http://jmlr.org/papers/v20/18-403.html}
    }