Skip to content

alexander-mead/FOPPL

Repository files navigation

First-Order Probabilistic Programming Language

image

This repository contains a fully working first-order probabilistic programming language FOPPL interpreter. A FOPPL program is one in which it is possible to convert the program into a finite graphical model, and conversely any statistical problem that can be written as a finite graphical model can be written in FOPPL. This code can ingest either the graph-based or evaluation-based outputs of daphne and run a number of different inference algorithms to perform Bayesian posterior inference in any first-order probabilistic program. If your problem can be written in FOPPL (and therefore written as a graph) then this repository can perform Bayesian inference.

The code uses pytorch primitives, and thus supports automatic differentiation. This ensures that inference algorithms that require derivatives (e.g., Hamiltonian Monte Carlo; Variational inference) are supported.

Inference algorithms:

  • Importance sampling
  • Metropolis-Hastings Monte Carlo
  • Gibbs Monte Carlo
  • Hamiltonian Monte Carlo
  • Variational inference

In future we would like to include the inference compilation algorithm within the context of graphical models. It should be possible to use the reverse graphical model to limit the number of neural networks required as surrogate link functions.

To run, simply type

python run.py

edit the config.yaml (which uses hydra) to choose which probablistic programs (and tests) to run.

Dependencies (pip install numpy etc.):

  • numpy
  • pytorch
  • hydra
  • wandb
  • ttvfast

About

First-order probabilistic programming language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published