superstats.transition.stochastic.kernel.linear#

Linear covariance kernels.

Functions

get_linear_kernel(num_steps, variance)

Batched linear kernel construction.

Classes

LinearKernel([name])

Linear kernel.

class superstats.transition.stochastic.kernel.linear.LinearKernel(name=None)[source]#

Bases: Kernel

Linear kernel. Requires hyperparameter variance.

Parameters:
namestr, optional

Prefix for this kernel’s hyperparameter name. Leave unset for a single linear kernel, or when combining with a kernel of a different type. Required when combining two linear kernels.

Parameters:

name (str | None)

build(num_steps, **hyperparams)[source]#

Construct the (batch_size, num_steps, num_steps) kernel matrix.

Parameters:
num_stepsint
**hyperparamsnp.ndarray

Must contain every name in self.hyperparam_names, each of shape (batch_size,). Extra keys (from sibling kernels in a composite) are ignored.

Returns:
kernel_matnp.ndarray of shape (batch_size, num_steps, num_steps)
Parameters:
Return type:

ndarray

superstats.transition.stochastic.kernel.linear.get_linear_kernel(num_steps, variance)[source]#

Batched linear kernel construction.

Parameters:
num_stepsint

Number of points in the 1D grid.

variancenp.ndarray of shape (batch_size,)

Scale of the kernel per trajectory.

Returns:
kernel_matnp.ndarray of shape (batch_size, num_steps, num_steps)
Parameters:
Return type:

ndarray