GPs
decijax.models.gps
Gaussian process models.
GPJaxConjugateGP
dataclass
GPJaxConjugateGP(
posterior: ExactPosterior, num_features: int = 100
)
Bases: SupportsGaussianPrediction, SupportsSamplePaths
Adapter wrapping a GPJax ExactPosterior.
The posterior's training data is in prediction space: if the model was fit on standardised targets, the posterior's dataset contains these standardised targets and it will predict in this standardised space.
Parameters:
-
posterior(ExactPosterior) –The fitted GPJax model conditioned on its training data.
-
num_features(int, default:100) –Number of random Fourier features used for pathwise (Thompson) sampling.
Raises:
-
ValueError–If
posterioris not anExactPosterior, or ifnum_featuresis 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:
-
GaussianDistribution–The marginal Gaussian distribution at each query point, with a leading
-
GaussianDistribution–sample axis
S == 1.
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.