gpflux.layers.basis_functions.fourier_features.quadrature#

A kernel’s features and coefficients using quadrature Fourier features (QFF).

Submodules#

Package Contents#

class QuadratureFourierFeatures(kernel: gpflow.kernels.Kernel, n_components: int, **kwargs: Mapping)[source]#

Bases: gpflux.layers.basis_functions.fourier_features.base.FourierFeaturesBase

The base class for all Fourier feature layers, used for both random Fourier feature layers and quadrature layers. We subclass tf.keras.layers.Layer, so we must provide :method:`build` and :method:`call` methods.

Parameters:
  • kernel – kernel to approximate using a set of Fourier bases.

  • n_components – number of components (e.g. Monte Carlo samples, quadrature nodes, etc.) used to numerically approximate the kernel.

build(input_shape: gpflux.types.ShapeType) None[source]#

Creates the variables of the layer. See tf.keras.layers.Layer.build().

_compute_bases(inputs: gpflow.base.TensorType) tf.Tensor[source]#

Compute basis functions.

Returns:

A tensor with the shape [N, 2M^D].

_compute_constant() tf.Tensor[source]#

Compute normalizing constant for basis functions.

Returns:

A tensor with the shape [2M^D,]