bask.utils.guess_priors

bask.utils.guess_priors(kernel)[source]

Guess suitable priors for the hyperparameters of a given kernel.

This function recursively explores the given (composite) kernel and adds suitable priors each encountered hyperparameter.

Here we use a half-Normal(0, 2.0) prior for all ConstantKernels and WhiteKernels, and an round-flat(0.1, 0.6) prior for all lengthscales. Change of variables is applied, since inference is done in log-space.

Parameters:
kernelKernel object.

Can be a single kernel (e.g. Matern), a Product or Sum kernel, or a CompoundKernel.

Returns:
priorslist of functions.

The function returns the list of priors in the same order as the vector theta provided by the kernel. Each prior evaluates the logpdf of its argument.