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 intondarray
- 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 onX
?
- 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
. ifARD == False
,inverse_bandwidths
is equal to a scalar broadcast to the d components (withd = dimension
, i.e., the number of features inX
).- Parameters:
dimension (
int
) – Dimensionality \(d\) of input vectorsARD (
bool
) – Automatic relevance determination (inverse_bandwidth
vector of sized
)? Defaults toFalse
encoding_type (
str
) – Encoding forinverse_bandwidth
. Defaults toDEFAULT_ENCODING
- forward(X1, X2)[source]
Computes matrix of squared distances
- Parameters:
X1 – input matrix, shape
(n1, d)
X2 – input matrix, shape
(n2, d)
- 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 (withd = dimension
, i.e., the number of features inX
).Arguments on top of base class
SquaredDistance
:- Parameters:
has_covariance_scale (
bool
) – Kernel has covariance scale parameter? Defaults toTrue
- 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 onX
?