physbo.gp.core.model module¶
-
class
physbo.gp.core.model.
model
(lik, mean, cov, inf='exact')[ソース]¶ -
cat_params
(lik_params, prior_params)[ソース]¶ Concatinate the likelihood and prior parameters
パラメータ: - lik_params (numpy.ndarray) -- Parameters for likelihood
- prior_params (numpy.ndarray) -- Parameters for prior
戻り値: params -- parameters about likelihood and prior
戻り値の型: numpy.ndarray
-
decomp_params
(params=None)[ソース]¶ decomposing the parameters to those of likelifood and priors
パラメータ: params (numpy.ndarray) -- parameters 戻り値: - lik_params (numpy.ndarray)
- prior_params (numpy.ndarray)
-
eval_marlik
(params, X, t, N=None)[ソース]¶ Evaluating marginal likelihood.
パラメータ: - params (numpy.ndarray) -- 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).
- N (int) -- Total number of subset data (if not specified, all dataset is used)
戻り値: - marlik (float)
- Marginal likelihood.
-
export_blm
(num_basis)[ソース]¶ Exporting the blm(Baysean linear model) predictor
パラメータ: num_basis (int) -- Total number of basis 戻り値: 戻り値の型: physbo.blm.core.model
-
fit
(X, t, config)[ソース]¶ Fitting function (update 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).
- config (physbo.misc.set_config object) --
-
get_cand_params
(X, t)[ソース]¶ Getting candidate for 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 -- Parameters
戻り値の型: numpy.ndarray
-
get_grad_marlik
(params, X, t, N=None)[ソース]¶ Evaluating gradiant of marginal likelihood.
パラメータ: - params (numpy.ndarray) -- 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).
- N (int) -- Total number of subset data (if not specified, all dataset is used)
戻り値: grad_marlik -- Gradiant of marginal likelihood.
戻り値の型: numpy.ndarray
-
get_params_bound
()[ソース]¶ Getting boundary of the parameters.
戻り値: bound -- An array with the tuple (min_params, max_params). 戻り値の型: list
-
get_post_fcov
(X, Z, params=None, diag=True)[ソース]¶ Calculating posterior covariance matrix of model (function)
パラメータ: - X (numpy.ndarray) -- inputs
- Z (numpy.ndarray) -- feature maps
- params (numpy.ndarray) -- Parameters
- diag (bool) -- If X is the diagonalization matrix, true.
戻り値: 戻り値の型: physbo.gp.inf.exact.get_post_fcov
-
get_post_fmean
(X, Z, params=None)[ソース]¶ Calculating posterior mean of model (function)
パラメータ: - X (numpy.ndarray) -- inputs
- Z (numpy.ndarray) -- feature maps
- params (numpy.ndarray) -- Parameters
-
post_sampling
(X, Z, params=None, N=1, alpha=1)[ソース]¶ draws samples of mean value of model
パラメータ: - X (numpy.ndarray) -- inputs
- Z (numpy.ndarray) -- feature maps
- N (int) -- number of samples (default: 1)
- alpha (float) -- noise for sampling source
戻り値: 戻り値の型: numpy.ndarray
-
predict_sampling
(X, Z, params=None, N=1)[ソース]¶ パラメータ: - X (numpy.ndarray) -- inputs
- Z (numpy.ndarray) -- feature maps
- params (numpy.ndarray) -- Parameters
- N (int) -- number of samples (default: 1)
戻り値: 戻り値の型: numpy.ndarray
-
prepare
(X, t, params=None)[ソース]¶ パラメータ: - 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) -- Parameters.
-
sub_sampling
(X, t, N)[ソース]¶ Make subset for sampling
パラメータ: - X (numpy.ndarray) -- Each row of X denotes the d-dimensional feature vector of search candidate.
- t (numpy.ndarray) -- The negative energy of each search candidate (value of the objective function to be optimized).
- N (int) -- Total number of data in subset
戻り値: - subX (numpy.ndarray)
- subt (numpy.ndarray)
-