Updated: 2022-11-19 Sat 19:42

Pyro - A Universal Deep Probabilistic Programming language

1. Introduction

Pyro is a python library that, as per the website, can be used to perform “Deep Probabilistic Programming” tasks. It was developed by UberAI and then open-sourced back in 2017.

1.1. Why Deep, Probabilistic Programming, and Universal?

Pyro is built up on PyTorch, which is one of the two major deep learning libraries in Python (second being Tensorflow by Google). This allows it to leverage all the PyTorch abilities to perform deep learning tasks while working in the probilistic realm. This brings us to the Probabilistic Programming part of the title. Without going into much depth about what bayesian inference, pyro provides a framework to work on such problems instead of just estimating point values. By being a “Probabilistic Programming Language”, we can use these interfaces of Pyro to transform the mathematical models into a learnable model. And since it can be used to represent almost any computable probability distribution, it’s called as a “Universal” language.

2. Basic Concepts

2.1. Parameters and Samples

2.2. Inference methods

2.2.1. SVI

2.2.2. HMC

2.2.3. SVGD

3. Simple Examples

3.1. Basic Framework

3.2. Gaussian distribution

3.3. Poisson distribution

3.4. Bernoulli’s distribution