pyGPGO.covfunc module

class pyGPGO.covfunc.dotProd(sigmaf=1.0, sigman=1e-06, bounds=None, parameters=['sigmaf', 'sigman'])[source]

Bases: object

Dot-product kernel class.

Parameters:
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
K(X, Xstar)[source]

Computes covariance function values over X and Xstar.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
Returns:

Computed covariance matrix.

Return type:

np.ndarray

gradK(X, Xstar, param)[source]

Computes gradient matrix for instances X, Xstar and hyperparameter param.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
  • param (str) – Parameter to compute gradient matrix for.
Returns:

Gradient matrix for parameter param.

Return type:

np.ndarray

class pyGPGO.covfunc.expSine(l=1.0, period=1.0, bounds=None, parameters=['l', 'period'])[source]

Bases: object

Exponential sine kernel class.

Parameters:
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly. l: float
  • period (float) – Period hyperparameter.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
K(X, Xstar)[source]

Computes covariance function values over X and Xstar.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
Returns:

Computed covariance matrix.

Return type:

np.ndarray

gradK(X, Xstar, param)[source]
class pyGPGO.covfunc.gammaExponential(gamma=1, l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['gamma', 'l', 'sigmaf', 'sigman'])[source]

Bases: object

Gamma-exponential kernel class.

Parameters:
  • gamma (float) – Hyperparameter of the Gamma-exponential covariance function.
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
K(X, Xstar)[source]

Computes covariance function values over X and Xstar.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
Returns:

Computed covariance matrix.

Return type:

np.ndarray

__init__(gamma=1, l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['gamma', 'l', 'sigmaf', 'sigman'])[source]

Gamma-exponential kernel class.

Parameters:
  • gamma (float) – Hyperparameter of the Gamma-exponential covariance function.
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
gradK(X, Xstar, param)[source]

Computes gradient matrix for instances X, Xstar and hyperparameter param.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
  • param (str) – Parameter to compute gradient matrix for.
Returns:

Gradient matrix for parameter param.

Return type:

np.ndarray

pyGPGO.covfunc.kronDelta(X, Xstar)[source]

Computes Kronecker delta for rows in X and Xstar.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances.
  • Xstar (np.ndarray, shape((m, nfeatures))) – Instances.
Returns:

Kronecker delta between row pairs of X and Xstar.

Return type:

np.ndarray

pyGPGO.covfunc.l2norm_(X, Xstar)[source]

Wrapper function to compute the L2 norm

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances.
  • Xstar (np.ndarray, shape=((m, nfeatures))) – Instances
Returns:

Pairwise euclidian distance between row pairs of X and Xstar.

Return type:

np.ndarray

class pyGPGO.covfunc.matern(v=1, l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['v', 'l', 'sigmaf', 'sigman'])[source]

Bases: object

Matern kernel class.

Parameters:
  • v (float) – Scale-mixture hyperparameter of the Matern covariance function.
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
K(X, Xstar)[source]

Computes covariance function values over X and Xstar.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
Returns:

Computed covariance matrix.

Return type:

np.ndarray

__init__(v=1, l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['v', 'l', 'sigmaf', 'sigman'])[source]

Matern kernel class.

Parameters:
  • v (float) – Scale-mixture hyperparameter of the Matern covariance function.
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
class pyGPGO.covfunc.matern32(l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['l', 'sigmaf', 'sigman'])[source]

Bases: object

Matern v=3/2 kernel class.

Parameters:
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
K(X, Xstar)[source]

Computes covariance function values over X and Xstar.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
Returns:

Computed covariance matrix.

Return type:

np.ndarray

__init__(l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['l', 'sigmaf', 'sigman'])[source]

Matern v=3/2 kernel class.

Parameters:
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
gradK(X, Xstar, param)[source]

Computes gradient matrix for instances X, Xstar and hyperparameter param.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
  • param (str) – Parameter to compute gradient matrix for.
Returns:

Gradient matrix for parameter param.

Return type:

np.ndarray

class pyGPGO.covfunc.matern52(l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['l', 'sigmaf', 'sigman'])[source]

Bases: object

Matern v=5/2 kernel class.

Parameters:
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
K(X, Xstar)[source]

Computes covariance function values over X and Xstar.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
Returns:

Computed covariance matrix.

Return type:

np.ndarray

__init__(l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['l', 'sigmaf', 'sigman'])[source]

Matern v=5/2 kernel class.

Parameters:
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
gradK(X, Xstar, param)[source]

Computes gradient matrix for instances X, Xstar and hyperparameter param.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
  • param (str) – Parameter to compute gradient matrix for.
Returns:

Gradient matrix for parameter param.

Return type:

np.ndarray

class pyGPGO.covfunc.rationalQuadratic(alpha=1, l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['alpha', 'l', 'sigmaf', 'sigman'])[source]

Bases: object

Rational-quadratic kernel class.

Parameters:
  • alpha (float) – Hyperparameter of the rational-quadratic covariance function.
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
K(X, Xstar)[source]

Computes covariance function values over X and Xstar.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
Returns:

Computed covariance matrix.

Return type:

np.ndarray

__init__(alpha=1, l=1, sigmaf=1, sigman=1e-06, bounds=None, parameters=['alpha', 'l', 'sigmaf', 'sigman'])[source]

Rational-quadratic kernel class.

Parameters:
  • alpha (float) – Hyperparameter of the rational-quadratic covariance function.
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
gradK(X, Xstar, param)[source]

Computes gradient matrix for instances X, Xstar and hyperparameter param.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
  • param (str) – Parameter to compute gradient matrix for.
Returns:

Gradient matrix for parameter param.

Return type:

np.ndarray

class pyGPGO.covfunc.squaredExponential(l=1, sigmaf=1.0, sigman=1e-06, bounds=None, parameters=['l', 'sigmaf', 'sigman'])[source]

Bases: object

Squared exponential kernel class.

Parameters:
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
K(X, Xstar)[source]

Computes covariance function values over X and Xstar.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
Returns:

Computed covariance matrix.

Return type:

np.ndarray

__init__(l=1, sigmaf=1.0, sigman=1e-06, bounds=None, parameters=['l', 'sigmaf', 'sigman'])[source]

Squared exponential kernel class.

Parameters:
  • l (float) – Characteristic length-scale. Units in input space in which posterior GP values do not change significantly.
  • sigmaf (float) – Signal variance. Controls the overall scale of the covariance function.
  • sigman (float) – Noise variance. Additive noise in output space.
  • bounds (list) – List of tuples specifying hyperparameter range in optimization procedure.
  • parameters (list) – List of strings specifying which hyperparameters should be optimized.
gradK(X, Xstar, param='l')[source]

Computes gradient matrix for instances X, Xstar and hyperparameter param.

Parameters:
  • X (np.ndarray, shape=((n, nfeatures))) – Instances
  • Xstar (np.ndarray, shape=((n, nfeatures))) – Instances
  • param (str) – Parameter to compute gradient matrix for.
Returns:

Gradient matrix for parameter param.

Return type:

np.ndarray