AePPL

AePPL is a set of tools to build A[e]PPL with Aesara. The code is available on Github. AePPL takes any Aesara graph that contains random variables, such as:

import aesara
import aesara.tensor as at

srng = at.random.RandomStream(0)

mu_rv = srng.normal(0, 1)
sigma_rv = srng.halfcauchy(1)
x_rv = srng.normal(mu_rv, sigma_rv)

fn = aesara.function([], [mu_rv, sigma_rv, x_rv])
samples = fn()
print(samples)

and constructs graphs that compute the joint log-density:

import aeppl

logprob, (mu_vv, sigma_vv, x_vv) = aeppl.joint_logprob(mu_rv, sigma_rv, x_rv)
fn = aesara.function([mu_vv, sigma_vv, x_vv], logprob)
print(fn(*samples))

Or conditional log-densities:

import aeppl

logprobs, (mu_vv, sigma_vv, x_vv) = aeppl.conditional_logprob(mu_rv, sigma_rv, x_rv)
fn = aesara.function([mu_vv, sigma_vv, x_vv], logprobs[x_rv])
print(fn(*samples))

AePPL is designed to support every model that is mathematically well-defined, using an intermediate representation for probabilistic models in terms of probability measures.

AePPL provides support for the following:

Links to this note