geometric_kernels.feature_maps.deterministic¶
This module provides the DeterministicFeatureMapCompact
, a
Karhunen-Loève expansion-based feature map for those
DiscreteSpectrumSpace
s, for which the eigenpairs
are explicitly known.
Module Contents¶
- class geometric_kernels.feature_maps.deterministic.DeterministicFeatureMapCompact(space, num_levels, repeated_eigenvalues_laplacian=None, eigenfunctions=None)[source]¶
Bases:
geometric_kernels.feature_maps.base.FeatureMap
Deterministic feature map for
DiscreteSpectrumSpace
s for which the actual eigenpairs are explicitly available.- Parameters:
space (geometric_kernels.spaces.DiscreteSpectrumSpace) – A
DiscreteSpectrumSpace
space.num_levels (int) – Number of levels in the kernel approximation.
repeated_eigenvalues_laplacian (beartype.typing.Optional[lab.Numeric]) – Allowing to pass the repeated eigenvalues of the Laplacian directly, instead of computing them from the space. If provided, eigenfunctions must also be provided. Used for
HodgeDiscreteSpectrumSpace
.eigenfunctions (beartype.typing.Optional[geometric_kernels.spaces.eigenfunctions.Eigenfunctions]) – Allowing to pass the eigenfunctions directly, instead of computing them from the space. If provided, repeated_eigenvalues_laplacian must also be provided. Used for
HodgeDiscreteSpectrumSpace
.
- __call__(X, params, normalize=True, **kwargs)[source]¶
- Parameters:
X (lab.Numeric) – [N, …] points in the space to evaluate the map on.
params (beartype.typing.Dict[str, lab.Numeric]) – Parameters of the kernel (length scale and smoothness).
normalize (bool) – Normalize to have unit average variance. If omitted, set to True.
**kwargs – Unused.
- Returns:
Tuple(None, features) where features is an [N, O] array, N is the number of inputs and O is the dimension of the feature map.
- Return type:
beartype.typing.Tuple[None, lab.Numeric]
Note
The first element of the returned tuple is the simple None and should be ignored. It is only there to support the abstract interface: for some other subclasses of
FeatureMap
, this first element may be an updated random key.
- class geometric_kernels.feature_maps.deterministic.HodgeDeterministicFeatureMapCompact(space, num_levels)[source]¶
Bases:
geometric_kernels.feature_maps.base.FeatureMap
Deterministic feature map for
HodgeDiscreteSpectrumSpace
s for which the actual eigenpairs are explicitly available.Corresponds to
MaternHodgeCompositionalKernel
and takes parameters in the same format.- Parameters:
num_levels (int)
- __call__(X, params, normalize=True, **kwargs)[source]¶
- Parameters:
X (lab.Numeric) – [N, …] points in the space to evaluate the map on.
params (beartype.typing.Dict[str, beartype.typing.Dict[str, lab.Numeric]]) – Parameters of the kernel (length scale and smoothness).
normalize (bool) – Normalize to have unit average variance. If omitted, set to True.
**kwargs – Unused.
- Returns:
Tuple(None, features) where features is an [N, O] array, N is the number of inputs and O is the dimension of the feature map.
- Return type:
beartype.typing.Tuple[None, lab.Numeric]
Note
The first element of the returned tuple is the simple None and should be ignored. It is only there to support the abstract interface: for some other subclasses of
FeatureMap
, this first element may be an updated random key.