pavi¶
Plate-amortized variational inference (PAVI) in Pyro.

What pavi provides¶
pavi provides a Pyro guide, i.e. a parameterized family of distributions that approximates the posterior distribution of a model. The guide fits any generative model implemented with Pyro, as long as its repeated variables are declared with plates. pavi also provides the tools to infer its parameters: training loops, a mini-batch sampler over plates, a PyTorch Lightning module and callbacks.
The idea¶
A hierarchical model repeats the same latent variable across the instances of a plate: one variable per subject, per brain vertex, etc. Classical variational inference estimates the statistics of the approximate posterior for every instance, for example the mean and standard deviation of a Gaussian in the mean-field approximation. With millions of instances, this means billions of parameters.
PAVI instead summarizes all the statistics of an instance in a small encoding. A transform shared by all the instances of the plate maps this encoding to the instance's posterior. Encodings being much smaller than the statistics they replace, the total number of parameters is reduced in the same proportion. This made inference possible on a brain model with 60 million latent variables.
Where to go next¶
- Getting started: install
paviand fit a first model. - Concepts: the ideas behind PAVI.
- User guide: the PAVI guide, encodings, transforms, schemes and training.
- Examples: a toy model and the brain functional networks application.
- API reference.
Citation¶
If you use pavi, please cite:
@article{rouillard2023pavi,
title = {{PAVI}: Plate-Amortized Variational Inference},
author = {Rouillard, Louis and Le Bris, Alexandre and Moreau, Thomas and Wassermann, Demian},
journal = {Transactions on Machine Learning Research},
year = {2023}
}
For the brain functional network application: Le Bris, A., Rouillard, L., & Wassermann, D. (2024). Improving Individual-Specific Functional Parcellation through Transfer Learning. hal-04506561.
pavi is released under the MIT license.