variational Package

variational Package

Code for variational inference

dirichlet_process Module

See Blei, Jordan - Variational Methods for Dirichlet Processes

class infpy.variational.dirichlet_process.ExpFamilyDP(X, K, alpha, family, lambda_)[source]

Bases: object

Implements a variational algorithm for inference in a dirichlet process mixture model of exponential family distributions.

K = None

Variational # mixtures truncation parameter.

N = None

# of data.

alpha = None

Dirichlet process parameter.

data = None

The data as sufficient statistics.


Expected value of theta under the variational distribution.

family = None

Exponential family.

gamma = None

The variational parameters for the V’s (array of shape (K,2)).


Set the variational parameters to some starting point.

lambda_ = None

Conjugate prior parameter.


The log likelihood of the data.


The pdf of the variational density at T.

@param T: sufficient statistic


The pdf of variational density at z given T as an array over all z’s

@param T: sufficient statistic

phi = None

The variational parameters for the Z’s (array of shape (N,2)).

tau = None

The variational parameters for the eta’s (array of length K).

tau_0 = None

The pseudo count variational parameters for the eta’s (array of length K).


Perform one update step.


Update gamma


Update phi.


Update tau

Table Of Contents

Previous topic

test Package

Next topic

message_passing Package

This Page