AbstractGaussianNode

class AbstractGaussianNode(*shape: int | None)[source]

Bases: VariationalNode, ABC

Base class for predictive coding nodes modelling Gaussian distributions.

A multivariate Gaussian distribution is described by the following probability density function:

\[f(\mathbf{x}; \boldsymbol{\mu}, \boldsymbol{\Sigma}) = \frac{1}{\sqrt{(2\pi)^N \lvert\boldsymbol{\Sigma}\rvert}} \exp \left(-\frac{1}{2} (\mathbf{z} - \boldsymbol{\mu}) \boldsymbol{\Sigma}^{-1} (\mathbf{z} - \boldsymbol{\mu})^\intercal \right)\]

where \(\mathbf{x}\) is a sample, \(\boldsymbol{\mu}\) is the mean, and \(\boldsymbol{\Sigma}\) is the covariance matrix, for an \(N\)-dimensional distribution.

Parameters:

*shape (int | None) – shape of the node’s learned state.

value

current value of the node.

Type:

Parameter

abstract property covariance: Tensor

Covariance matrix of the Gaussian distribution.

Parameters:

value (float | Tensor) – new covariance for the distribution.

Raises:

NotImplementedError – must be implemented by subclasses.

Returns:

covariance of the distribution.

Return type:

Tensor