pymc.variational.operators.KL#

class pymc.variational.operators.KL(approx, beta=1.0)[source]#

Operator based on Kullback Leibler Divergence

This operator constructs Evidence Lower Bound (ELBO) objective

\[ELBO_\beta = \log p(D|\theta) - \beta KL(q||p)\]

where

\[KL[q(v)||p(v)] = \int q(v)\log\frac{q(v)}{p(v)}dv\]
Parameters:
approx: :class:`Approximation`

Approximation used for inference

beta: float

Beta parameter for KL divergence, scales the regularization term.

Methods

KL.__init__(approx[, beta])

KL.apply(f)

Operator itself

Attributes

T

datalogp

datalogp_norm

has_test_function

inputs

logp

logp_norm

logq

logq_norm

model

require_logq

returns_loss

supports_aevb

varlogp

varlogp_norm