API reference

GPmp routines take arrays managed by gpmp.num: NumPy arrays with the NumPy backend and PyTorch tensors with the torch backend. The gpmp.core module defines the GP model object, and gpmp.kernel provides covariance functions and parameter-selection procedures that operate on plain covariance-parameter vectors. The gpmp.parameter module provides objects for naming, normalizing, displaying, and inspecting these vectors. gpmp.core and gpmp.kernel do not depend on it.

Common API conventions

Use these conventions when calling the API programmatically.

  • Observation points are arrays xi with shape (n, d).

  • Scalar observations are arrays zi with shape (n,) or (n, 1).

  • Prediction points are arrays xt with shape (m, d).

  • Covariance parameters are one-dimensional arrays. The sigma2_rho layout is covparam = [log(sigma2), -log(rho_0), ..., -log(rho_{d-1})]. It is used by covariance functions parameterized by a variance and anisotropic lengthscales. The matern sigma2_nu_rho layout adds log(nu) after log(sigma2).

  • Selection procedures modify model.covparam and return (model, info) when info=True. With info=False, they return (model, None).

  • Use gpmp.num arrays or objects convertible by gpmp.num.asarray. Unless a function documents a conversion, outputs use the array type of the active numerical backend. Use gpmp.num.to_np when NumPy arrays are needed outside GPmp.

  • Write custom mean, covariance, and criterion functions with gpmp.num operations when they must work with both backends.

Module order