Optimisation

class mini_gpr.opt.optimise_model(
m,
objective,
X,
y,
*,
optimise_noise=False,
max_iterations=100,
)[source]

Optimise the model (kernel hyperparameters and noise) to minimise the objective function.

Parameters:
  • m (mini_gpr.models.Model) – the model to optimise.

  • objective (mini_gpr.opt.Objective) – the objective function to minimise.

  • X (jaxtyping.Float[ndarray, 'N D']) – the training data.

  • y (jaxtyping.Float[ndarray, 'N']) – the training targets.

  • optimise_noise (bool) – whether to optimise the noise.

  • max_iterations (int) – the maximum number of iterations.

Objectives

class mini_gpr.opt.Objective(*args, **kwargs)[source]

An objective function takes a model as input, and returns a scalar value, such that a lower value is a “better” model.

__call__(model)[source]

Call self as a function.

Parameters:

model (Model)

Return type:

float

class mini_gpr.opt.maximise_log_likelihood(model)[source]

Maximise the log likelihood of the model.

Parameters:

model (Model)

class mini_gpr.opt.validation_set_mse(X, y)[source]

Minimise the mean squared error of the model on the validation set.

Parameters:
  • X (Float[ndarray, 'N D'])

  • y (Float[ndarray, 'N'])

Return type:

Objective

class mini_gpr.opt.validation_set_log_likelihood(X, y)[source]

Minimise the log likelihood of the model on the validation set.

Parameters:
  • X (Float[ndarray, 'N D'])

  • y (Float[ndarray, 'N'])

Return type:

Objective