bayeso.utils.utils_covariance

bayeso.utils.utils_covariance._get_list_first()

It provides list of strings. The strings in that list require two hyperparameters, signal and lengthscales. We simply call it as list_first.

Returns:list of strings, which satisfy some requirements we mentioned above.
Return type:list
bayeso.utils.utils_covariance.convert_hyps(str_cov, hyps, is_fixed_noise=False)

It converts hyperparameters dictionary, hyps to numpy array.

Parameters:
  • str_cov (str.) – the name of covariance function.
  • hyps (dict.) – dictionary of hyperparameters for covariance function.
  • is_fixed_noise (bool., optional) – flag for fixing a noise.
Returns:

converted array of the hyperparameters given by hyps.

Return type:

numpy.ndarray

Raises:

AssertionError

bayeso.utils.utils_covariance.get_hyps(str_cov, int_dim, is_ard=True)

It returns a dictionary of default hyperparameters for covariance function, where str_cov and int_dim are given. If is_ard is True, the length scales would be int_dim-dimensional vector.

Parameters:
  • str_cov (str.) – the name of covariance function.
  • int_dim (int.) – dimensionality of the problem we are solving.
  • is_ard (bool., optional) – flag for automatic relevance determination.
Returns:

dictionary of default hyperparameters for covariance function.

Return type:

dict.

Raises:

AssertionError

bayeso.utils.utils_covariance.get_range_hyps(str_cov, int_dim, is_ard=True, is_fixed_noise=False)

It returns default optimization ranges of hyperparameters for Gaussian process regression.

Parameters:
  • str_cov (str.) – the name of covariance function.
  • int_dim (int.) – dimensionality of the problem we are solving.
  • is_ard (bool., optional) – flag for automatic relevance determination.
  • is_fixed_noise (bool., optional) – flag for fixing a noise.
Returns:

list of default optimization ranges for hyperparameters.

Return type:

list

Raises:

AssertionError

bayeso.utils.utils_covariance.restore_hyps(str_cov, hyps, is_fixed_noise=False, fixed_noise=0.01)

It restores hyperparameters array, hyps to dictionary.

Parameters:
  • str_cov (str.) – the name of covariance function.
  • hyps (numpy.ndarray) – array of hyperparameters for covariance function.
  • is_fixed_noise (bool., optional) – flag for fixing a noise.
  • fixed_noise (float, optional) – fixed noise value.
Returns:

restored dictionary of the hyperparameters given by hyps.

Return type:

numpy.ndarray

Raises:

AssertionError

bayeso.utils.utils_covariance.validate_hyps_arr(arr_hyps, str_cov, int_dim)

It validates hyperparameters array, arr_hyps.

Parameters:
  • arr_hyps (numpy.ndarray) – array of hyperparameters for covariance function.
  • str_cov (str.) – the name of covariance function.
  • int_dim (int.) – dimensionality of the problem we are solving.
Returns:

a tuple of valid hyperparameters and validity flag.

Return type:

(numpy.ndarray, bool.)

Raises:

AssertionError

bayeso.utils.utils_covariance.validate_hyps_dict(dict_hyps, str_cov, int_dim)

It validates hyperparameters dictionary, dict_hyps.

Parameters:
  • dict_hyps (dict.) – dictionary of hyperparameters for covariance function.
  • str_cov (str.) – the name of covariance function.
  • int_dim (int.) – dimensionality of the problem we are solving.
Returns:

a tuple of valid hyperparameters and validity flag.

Return type:

(dict., bool.)

Raises:

AssertionError