geometric_kernels.kernels.hodge_compositional¶
This module provides the MaternHodgeCompositionalKernel
kernel, for discrete spectrum spaces with Hodge decomposition, subclasses
of HodgeDiscreteSpectrumSpace.
Module Contents¶
- class geometric_kernels.kernels.hodge_compositional.MaternHodgeCompositionalKernel(space, num_levels, normalize=True)[source]¶
Bases:
geometric_kernels.kernels.base.BaseGeometricKernelThis class is similar to
MaternKarhunenLoeveKernel, but provides a more expressive family of kernels on the spaces where Hodge decomposition is available.The resulting kernel is a sum of three kernels,
\[k(x, x') = a k_{\text{harmonic}}(x, x') + b k_{\text{gradient}}(x, x') + c k_{\text{curl}}(x, x'),\]where \(a, b, c\) are weights \(a, b, c \geq 0\) and \(a + b + c = 1\), and \(k_{\text{harmonic}}\), \(k_{\text{gradient}}\), \(k_{\text{curl}}\) are the instances of
MaternKarhunenLoeveKernelthat only use the eigenpairs of the Laplacian corresponding to a single part of the Hodge decomposition.The parameters of this kernel are represented by a dict with three keys: “harmonic”, “gradient”, “curl”, each corresponding to a dict with keys “logit”, “nu”, “lengthscale”, where “nu” and “lengthscale” are the parameters of the respective
MaternKarhunenLoeveKernel, while the “logit” parameters determine the weights \(a, b, c\) in the formula above: \(a, b, c\) are the “logit” parameters normalized to satisfy \(a + b + c = 1\).Same as for
MaternKarhunenLoeveKernel, these kernels can sometimes be computed more efficiently using addition theorems.Note
A brief introduction into the theory behind
MaternHodgeCompositionalKernelcan be found in this documentation page.- Parameters:
space (geometric_kernels.spaces.HodgeDiscreteSpectrumSpace) – The space to define the kernel upon, a subclass of
HodgeDiscreteSpectrumSpace.num_levels (int) – Number of levels to include in the summation.
normalize (bool) – Whether to normalize kernel to have unit average variance.
- K(params, X, X2=None, **kwargs)[source]¶
Compute the cross-covariance matrix between two batches of vectors of inputs, or batches of matrices of inputs, depending on the space.
- Parameters:
params (beartype.typing.Dict[str, beartype.typing.Dict[str, lab.NPNumeric]])
X (lab.Numeric)
X2 (beartype.typing.Optional[lab.Numeric])
- Return type:
lab.Numeric
- K_diag(params, X, **kwargs)[source]¶
Returns the diagonal of the covariance matrix self.K(params, X, X), typically in a more efficient way than actually computing the full covariance matrix with self.K(params, X, X) and then extracting its diagonal.
- Parameters:
params (beartype.typing.Dict[str, beartype.typing.Dict[str, lab.NPNumeric]])
X (lab.Numeric)
- Return type:
lab.Numeric
- init_params()[source]¶
Initialize the three sets of parameters for the three kernels.
- Return type:
beartype.typing.Dict[str, beartype.typing.Dict[str, lab.NPNumeric]]
- property space: geometric_kernels.spaces.HodgeDiscreteSpectrumSpace¶
The space on which the kernel is defined.
- Return type: