StandardGaussianNode¶
- class StandardGaussianNode(*shape: int | None)[source]¶
Bases:
AbstractGaussianNodeGaussian predictive coding node with unit variance.
Assumes the covariance matrix is an identity matrix.
\[\boldsymbol{\Sigma} = \mathbf{I}\]- Parameters:
*shape (int | None) – shape of the node’s learned state.
- property covariance: Tensor¶
Covariance matrix of the Gaussian distribution.
\[\boldsymbol{\Sigma} = \mathbf{I}\]- Parameters:
value (float | Tensor) – new covariance for the distribution.
- Raises:
RuntimeError – covariance is a fixed value.
- Returns:
covariance of the distribution.
- Return type:
- energy(pred: Tensor) Tensor[source]¶
Variational free energy with respect to the prediction.
\[\begin{split}\begin{aligned} \mathcal{F} &= \frac{1}{2} (\mathbf{z} - \boldsymbol{\mu}) (\mathbf{z} - \boldsymbol{\mu})^\intercal \\ &= \frac{1}{2} \lVert\mathbf{z} - \boldsymbol{\mu}\rVert_2^2 \end{aligned}\end{split}\]
- error(pred: Tensor) Tensor[source]¶
Error between the prediction and node state.
\[\boldsymbol{\varepsilon} = \mathbf{z} - \boldsymbol{\mu}\]