Skip to content

GPs

decijax.models.gps

Gaussian process models.

GPJaxConjugateGP dataclass

GPJaxConjugateGP(
    posterior: ConjugatePosterior,
    dataset: Dataset,
    num_features: int = 100,
)

Bases: SupportsGaussianPrediction, SupportsSamplePaths

Adapter wrapping a GPJax ConjugatePosterior + its training data.

The dataset is assumed to be in prediction space: if the posterior was fit on standardised targets, pass the standardised dataset and the standardised predictions / incumbent fall out consistently.

Parameters:

  • posterior (ConjugatePosterior) –

    The fitted GPJax posterior.

  • dataset (Dataset) –

    Training data in prediction space.

  • num_features (int, default: 100 ) –

    Number of random Fourier features used for pathwise (Thompson) sampling.

Raises:

  • ValueError –

    If posterior is not a ConjugatePosterior, or if num_features is not a positive integer.

training_inputs property

training_inputs: Float[Array, 'N D']

Inputs the model was conditioned on.

observations property

observations: Float[Array, 'N 1']

Observed targets, in prediction space.

predict

predict(x: Float[Array, 'N D']) -> GaussianDistribution

Marginal Gaussian predictive at x, over the latent function (noise-free).

Parameters:

  • x (Float[Array, 'N D']) –

    Query points.

Returns:

draw_sample_paths

draw_sample_paths(
    num_samples: int, key: KeyArray
) -> SamplePath

Draw differentiable posterior sample paths via decoupled sampling.

Parameters:

  • num_samples (int) –

    Number of sample paths to draw.

  • key (KeyArray) –

    PRNG key controlling the draw.

Returns:

  • SamplePath –

    A single callable mapping [N, D] -> [N, num_samples], evaluable

  • SamplePath –

    and differentiable at arbitrary inputs.