markovflow.kernels.kernel

Module containing a base class for kernels.

Module Contents

class Kernel(name=None)[source]

Bases: tf.Module, abc.ABC

Abstract class generating a StateSpaceModel for a given set of time points.

For a given set of time points \(tₖ\), define a state space model of the form:

\[xₖ₊₁ = Aₖ xₖ + qₖ\]

…where:

\[\begin{split}&qₖ \sim 𝓝(0, Qₖ)\\ &x₀ \sim 𝓝(μ₀, P₀)\\ &xₖ ∈ ℝ^d\\ &Aₖ ∈ ℝ^{d × d}\\ &Qₖ ∈ ℝ^{d × d}\\ &μ₀ ∈ ℝ^{d × 1}\\ &P₀ ∈ ℝ^{d × d}\\ &d \verb| is the state_dim|\end{split}\]

And an EmissionModel for a given output dimension:

\[fₖ = H xₖ\]

…where:

\[\begin{split}&x ∈ ℝ^d\\ &f ∈ ℝ^m\\ &H ∈ ℝ^{m × d}\\ &m \verb| is the output_dim|\end{split}\]

Note

Implementations of this class should typically avoid performing computation in their __init__ method. Performing computation in the constructor conflicts with running in TensorFlow’s eager mode.

property output_dimint[source]

Return the output dimension of the kernel.

abstract build_finite_distribution(time_points: tf.Tensor)markovflow.gauss_markov.GaussMarkovDistribution[source]

Return the GaussMarkovDistribution that this kernel represents on the provided time points.

Note

Currently the only representation we can use is a StateSpaceModel.

Parameters

time_points – The times between which to define the distribution, with shape batch_shape + [num_data].

abstract generate_emission_model(time_points: tf.Tensor)markovflow.emission_model.EmissionModel[source]

Return the EmissionModel associated with this kernel that maps from the latent GaussMarkovDistribution to the observations.

Parameters

time_points – The time points over which the emission model is defined, with shape batch_shape + [num_data].