rc.gpr.kernels§

Contains Kernel classes for gpr.

Classes§

Kernel

Abstract interface to a Kernel. Essentially this is the code contract with the MOGP interface.

RBF

Abstract interface to a Kernel. Essentially this is the code contract with the MOGP interface.

Module Contents§

class Kernel(folder, read_data=False, **kwargs)§

Bases: rc.base.models.DataBase

Inheritance diagram of rc.gpr.kernels.Kernel

Abstract interface to a Kernel. Essentially this is the code contract with the MOGP interface.

Parameters:
  • folder (rc.base.definitions.Path | str)

  • read_data (bool)

  • kwargs (NP.Matrix)

class Data§

Bases: rc.base.models.Tables

Inheritance diagram of rc.gpr.kernels.Kernel.Data

The Data set of a Kernel.

calibrate(**kwargs)§

Merely sets which data are trainable.

Parameters:

kwargs (rc.base.definitions.Any)

Return type:

rc.base.definitions.Dict[str, rc.base.definitions.Any]

property TYPE_IDENTIFIER: str§
Classmethod:

Return type:

str

The type of this Kernel object or class as ‘__module__.Kernel.__name__’.

classmethod TypeFromIdentifier(TypeIdentifier)§

Convert a TypeIdentifier to a Kernel NamedTuple.

Parameters:

TypeIdentifier (str) – A string generated by Kernel.TypeIdentifier().

Returns:

The type of Kernel that _TypeIdentifier specifies.

Return type:

rc.base.definitions.Type[Kernel]

classmethod TypeFromParameters(parameters)§

Recognize the NamedTuple of a Kernel from its Data.

Parameters:

parameters (Data) – A Kernel.Data array to recognize.

Returns:

The type of Kernel that data defines.

Return type:

rc.base.definitions.Type[Kernel]

property L: int§

The output (Y) dimensionality, or 1 for a single kernel shared across all outputs.

Return type:

int

property M: int§

The input (X) dimensionality, or 1 for an isotropic kernel.

Return type:

int

property is_covariant: bool§

Whether the kernel is covariant between outputs.

Return type:

bool

broadcast_parameters(variance_shape, M)§

Broadcast this kernel to higher dimensions. Shrinkage raises errors, unchanged dimensions silently nop. A diagonal variance matrix broadcast to a square matrix is initially diagonal. All other expansions are straightforward broadcasts. :param variance_shape: The new shape for the variance, must be (1, L) or (L, L). :param M: The number of input Lengthscales per output.

Returns: self, for chaining calls. :raises IndexError: If an attempt is made to shrink a parameter.

Parameters:

variance_shape (rc.base.definitions.Tuple[int, int])

Return type:

Kernel

property implementation: rc.base.definitions.Tuple[rc.base.definitions.Any, Ellipsis]§
Abstractmethod:

Return type:

rc.base.definitions.Tuple[rc.base.definitions.Any, Ellipsis]

The implementation of this Kernel in GPFlow. If self.variance.shape == (1,L) an L-tuple of kernels is returned. If self.variance.shape == (L,L) a 1-tuple of multi-output kernels is returned.

class RBF(folder, read_data=False, **kwargs)§

Bases: Kernel

Inheritance diagram of rc.gpr.kernels.RBF

Abstract interface to a Kernel. Essentially this is the code contract with the MOGP interface.

Parameters:
  • folder (rc.base.definitions.Path | str)

  • read_data (bool)

  • kwargs (NP.Matrix)

property implementation: rc.base.definitions.Tuple[rc.base.definitions.Any, Ellipsis]§

The implement of this Kernel in GPFlow. If self.variance.shape == (1,1) a 1-tuple of kernels is returned. If self.variance.shape == (1,L) an L-tuple of kernels is returned. If self.variance.shape == (L,L) a 1-tuple of multi-output kernels is returned.

Return type:

rc.base.definitions.Tuple[rc.base.definitions.Any, Ellipsis]