syne_tune.optimizer.schedulers.searchers.bayesopt.gpautograd.kernel.base module

class syne_tune.optimizer.schedulers.searchers.bayesopt.gpautograd.kernel.base.KernelFunction(dimension, **kwargs)[source]

Bases: MeanFunction

Base class of kernel (or covariance) function math:k(x, x')

Parameters:

dimension (int) – Dimensionality of input points after encoding into ndarray

property dimension
Returns:

Dimension d of input points

diagonal(X)[source]
Parameters:

X – Input data, shape (n, d)

Returns:

Diagonal of \(k(X, X)\), shape (n,)

diagonal_depends_on_X()[source]

For stationary kernels, diagonal does not depend on X

Returns:

Does diagonal() depend on X?

class syne_tune.optimizer.schedulers.searchers.bayesopt.gpautograd.kernel.base.SquaredDistance(dimension, ARD=False, encoding_type='logarithm', **kwargs)[source]

Bases: Block

Block that is responsible for the computation of matrices of squared distances. The distances can possibly be weighted (e.g., ARD parametrization). For instance:

\[ \begin{align}\begin{aligned}m_{i j} = \sum_{k=1}^d ib_k^2 (x_{1: i k} - x_{2: j k})^2\\\mathbf{X}_1 = [x_{1: i j}],\quad \mathbf{X}_2 = [x_{2: i j}]\end{aligned}\end{align} \]

Here, \([ib_k]\) is the vector inverse_bandwidth. if ARD == False, inverse_bandwidths is equal to a scalar broadcast to the d components (with d = dimension, i.e., the number of features in X).

Parameters:
  • dimension (int) – Dimensionality \(d\) of input vectors

  • ARD (bool) – Automatic relevance determination (inverse_bandwidth vector of size d)? Defaults to False

  • encoding_type (str) – Encoding for inverse_bandwidth. Defaults to DEFAULT_ENCODING

forward(X1, X2)[source]

Computes matrix of squared distances

Parameters:
  • X1 – input matrix, shape (n1, d)

  • X2 – input matrix, shape (n2, d)

get_params()[source]

Parameter keys are “inv_bw<k> “if dimension > 1, and “inv_bw” if dimension == 1.

Return type:

Dict[str, Any]

set_params(param_dict)[source]
class syne_tune.optimizer.schedulers.searchers.bayesopt.gpautograd.kernel.base.Matern52(dimension, ARD=False, encoding_type='logarithm', has_covariance_scale=True, **kwargs)[source]

Bases: KernelFunction

Block that is responsible for the computation of Matern 5/2 kernel.

if ARD == False, inverse_bandwidths is equal to a scalar broadcast to the d components (with d = dimension, i.e., the number of features in X).

Arguments on top of base class SquaredDistance:

Parameters:

has_covariance_scale (bool) – Kernel has covariance scale parameter? Defaults to True

property ARD: bool
forward(X1, X2)[source]

Computes Matern 5/2 kernel matrix

Parameters:
  • X1 – input matrix, shape (n1,d)

  • X2 – input matrix, shape (n2,d)

diagonal(X)[source]
Parameters:

X – Input data, shape (n, d)

Returns:

Diagonal of \(k(X, X)\), shape (n,)

diagonal_depends_on_X()[source]

For stationary kernels, diagonal does not depend on X

Returns:

Does diagonal() depend on X?

param_encoding_pairs()[source]
Returns list of tuples

(param_internal, encoding)

over all Gluon parameters maintained here.

Returns:

List [(param_internal, encoding)]

get_covariance_scale()[source]
set_covariance_scale(covariance_scale)[source]
get_params()[source]
Return type:

Dict[str, Any]

Returns:

Dictionary with hyperparameter values

set_params(param_dict)[source]
Parameters:

param_dict (Dict[str, Any]) – Dictionary with new hyperparameter values

Returns: