bayeso.gp.gp_common

bayeso.gp.gp_common.get_kernel_cholesky(X_train, hyps, str_cov, is_fixed_noise=True, is_gradient=False, debug=False)

This function computes a kernel inverse with Cholesky decomposition.

Parameters:
  • X_train (numpy.ndarray) – inputs. Shape: (n, d) or (n, m, d).
  • hyps (dict.) – dictionary of hyperparameters for Gaussian process.
  • str_cov (str.) – the name of covariance function.
  • is_fixed_noise (bool., optional) – flag for fixing a noise.
  • is_gradient (bool., optional) – flag for computing and returning gradients of negative log marginal likelihood.
  • debug (bool., optional) – flag for printing log messages.
Returns:

a tuple of kernel matrix over X_train, lower matrix computed by Cholesky decomposition, and gradients of kernel matrix. If is_gradient is False, gradients of kernel matrix would be None.

Return type:

tuple of (numpy.ndarray, numpy.ndarray, numpy.ndarray)

Raises:

AssertionError

bayeso.gp.gp_common.get_kernel_inverse(X_train, hyps, str_cov, is_fixed_noise=True, is_gradient=False, debug=False)

This function computes a kernel inverse without any matrix decomposition techniques.

Parameters:
  • X_train (numpy.ndarray) – inputs. Shape: (n, d) or (n, m, d).
  • hyps (dict.) – dictionary of hyperparameters for Gaussian process.
  • str_cov (str.) – the name of covariance function.
  • is_fixed_noise (bool., optional) – flag for fixing a noise.
  • is_gradient (bool., optional) – flag for computing and returning gradients of negative log marginal likelihood.
  • debug (bool., optional) – flag for printing log messages.
Returns:

a tuple of kernel matrix over X_train, kernel matrix inverse, and gradients of kernel matrix. If is_gradient is False, gradients of kernel matrix would be None.

Return type:

tuple of (numpy.ndarray, numpy.ndarray, numpy.ndarray)

Raises:

AssertionError