physbo.gp.cov.gauss module

class physbo.gp.cov.gauss.gauss(num_dim, width=3, scale=1, ard=False, max_width=1000000.0, min_width=1e-06, max_scale=1000000.0, min_scale=1e-06)[ソース]

ベースクラス: object

gaussian kernel

cat_params(width, scale)[ソース]

Taking the logarithm of width and scale parameters and concatinate them into one ndarray

パラメータ:
  • width (int) --

  • scale (int) --

戻り値:

params -- Parameters

戻り値の型:

numpy.ndarray

decomp_params(params)[ソース]

decompose the parameters defined on the log region into width and scale parameters

パラメータ:

params (numpy.ndarray) -- parameters

戻り値:

  • width (float)

  • scale (float)

get_cand_params(X, t)[ソース]

Getting candidate parameters.

パラメータ:
  • X (numpy.ndarray) -- N x d dimensional matrix. Each row of X denotes the d-dimensional feature vector of search candidate.

  • t (numpy.ndarray) -- N dimensional array. The negative energy of each search candidate (value of the objective function to be optimized).

戻り値:

params

戻り値の型:

numpy.ndarray

get_cov(X, Z=None, params=None, diag=False)[ソース]

compute the covariant matrix :param X: N x d dimensional matrix. Each row of X denotes the d-dimensional feature vector of search candidate. :type X: numpy.ndarray :param Z: N x d dimensional matrix. Each row of Z denotes the d-dimensional feature vector of search candidate. :type Z: numpy.ndarray :param params: Parameters :type params: numpy.ndarray :param diag: If X is the diagonalization matrix, true. :type diag: bool

戻り値:

G -- covariant matrix

戻り値の型:

numpy.ndarray

get_grad(X, params=None)[ソース]

Getting gradiant values of X

パラメータ:
  • X (numpy.ndarray) -- N x d dimensional matrix. Each row of X denotes the d-dimensional feature vector of search candidate.

  • params (numpy.ndarray) --

戻り値:

grad

戻り値の型:

numpy.ndarray

get_params_bound()[ソース]

Getting boundary array.

戻り値:

bound -- A num_params-dimensional array with the tuple (min_params, max_params).

戻り値の型:

list

load(file_name)[ソース]

Recovering the Gaussian kernel from file :param file_name: file name to load the information of the kernel :type file_name: str

prepare(params=None)[ソース]

Setting parameters

パラメータ:

params (numpy.ndarray) -- parameters

戻り値:

  • params (numpy.ndarray)

  • width (int)

  • scale (int)

print_params()[ソース]

show the current kernel parameters

rand_expans(num_basis, params=None)[ソース]

Kernel Expansion

パラメータ:
  • num_basis (int) -- total number of basis

  • params (numpy.ndarray) -- Parameters

戻り値の型:

tupple (W, b, amp)

save(file_name)[ソース]

save the gaussian kernel

パラメータ:

file_name (str) -- file name to save the information of the kernel

set_params(params)[ソース]

set kernel parameters

パラメータ:

params (numpy.ndarray) -- Parameters for optimization.

supp_params(params)[ソース]

Set maximum (minimum) values for parameters when the parameter is greater(less) than this value.

パラメータ:

params (numpy.ndarray) -- Parameters for optimization. Array of real elements of size (n,), where ‘n’ is the number of independent variables.

戻り値:

params

戻り値の型:

numpy.ndarray