Published October 4, 2022 | Version v2
Software Open

Artifact for the paper "Smoothness Analysis for Probabilistic Programs with Application to Optimised Variational Inference"

  • 1. Stanford University
  • 2. INRIA
  • 3. KAIST

Description

We present a static analysis for discovering differentiable or more generally smooth parts of a given probabilistic program, and show how the analysis can be used to improve the pathwise gradient estimator, one of the most popular methods for posterior inference and model learning. Our improvement increases the scope of the estimator from differentiable models to non-differentiable ones without requiring manual intervention of the user; the improved estimator automatically identifies differentiable parts of a given probabilistic program using our static analysis, and applies the pathwise gradient estimator to the identified parts while using a more general but less efficient estimator, called score estimator, for the rest of the program. Our analysis has a surprisingly subtle soundness argument, partly due to the misbehaviours of some target smoothness properties when viewed from the perspective of program analysis designers. For instance, some smoothness properties, such as partial differentiability and partial continuity, are not preserved by function composition, and this makes it difficult to analyse sequential composition soundly without heavily sacrificing precision. We formulate five assumptions on a target smoothness property, prove the soundness of our analysis under those assumptions, and show that our leading examples satisfy these assumptions. We also show that by using information from our analysis instantiated for differentiability, our improved gradient estimator computes the correct estimate on average, i.e., it returns an unbiased estimate. Our experiments with representative probabilistic programs in the Pyro language show that our static analysis is capable of identifying smooth parts of those programs accurately, and making our improved pathwise gradient estimator exploit all the opportunities for high performance in those programs.

 

 

 

Artifact accompanying the article:

 

  "Smoothness Analysis for Probabilistic Programs

   with Application to Optimised Variational Inference"

 

--------------------------------------------------------------------------------

Dear User,

 

This artifact contains the following elements, described more in details

below and in the companion files:

  (1) the sources of the Pyppai static analyzer

  (2) the data files used in the paper

  (3) information on how to reproduce the results reported in the paper

      (using scripts that allow to reproduce most results using a single

      command, and instruction to reproduce individual data-points) and to.

      See pyppai/README.txt for detailed instructions.

 

About the virtual machine:

 - the virtual machine is based on the Ubuntu i386 distribution (18.04 LTS)

 - the default user account is "artifact":

        login:           artifact

    password:     artifact

 - user artifact can sudo (e.g., to install STHG, just do 'sudo apt-get

   install STHG' although this should not be necessary).

 - the analyser is written in OCaml; the virtual machine provides a local

   installation (in the artifact user directory) of the opam OCaml package

   manager, with the 4.14.0 OCaml compiler and all required libraries

   pre-installed (in particular, the analyser uses the pyml and pyast

   libraries for manipulating Python programs and the apron library of

   numerical abstract domain); no further installation should be necessary.

 

 

 

 

(1) The content of the artifact is described briefly in

 

        Desktop/FILES.txt

 

 

 

 

(2) The sources of the analyzer are available in the directory

 

        Desktop/pyppai

 

They can be compiled locally in that directory (by simply typing "make").

 

Files

Files (3.0 GB)

Name Size Download all
md5:ed301dac4054475936698c590aed89e1
3.0 GB Download