kerasadf.layers.core.ADFLayer

class kerasadf.layers.core.ADFLayer(mode='diag', **kwargs)

Bases: Layer

Abstract base class for Assumed Density Filtering layers.

Derived from Layer and it offers mostly the same functionality. It adds one additional required argument for all ADF layers, namely the mode of the probability distribution propagation through the layer.

All modes propagate the mean (similar to the usual point-estimate of a standard Keras layer). Modes differ in how they treat second moment information, that is how they propagate correlations/covariances.

ADF layers take two inputs and produce two outputs for every input and output of the respective standard Keras layer.

Available modes are:

1. “diag” or “diagonal”, meaning that nodes within a layer are considered statistically independent and only variances (but no covariances) are propagated. This amounts to propagating only the diagonal of the covariance matrix through the layer.

2. “lowrank” or “half”, meaning that nodes within a layer are considered statistically dependent and variances as well as covariances are propagated. However, instead of the full covariance matrix only one half of a symmetric low-rank factorization of it is propagated for computational benefits.

3. “full”, meaning that nodes within a layer are considered statistically dependent and variances as well as covariances are propagated. The full covariance matrix is propagated in this mode, which results in a huge memory requirement. Therefore, the full covariance mode is often infeasible and it is typically recommended to use the diagonal or low rank factorization mode instead.

Parameters:
mode{“diag”, “diagonal”, “lowrank”, “half”, “full”}, optional

Covariance propagation mode. The default mode is “diag”.

**kwargs

Keyword arguments, passed on to Keras Layer base class.

Attributes:
mode{“diag”, “half”, “full”}

Covariance propagation mode.

get_config()
property mode