physbo.search.score_multi module
- physbo.search.score_multi.EHVI(fmean, fstd, pareto)[ソース]
Calculate Expected Hyper-Volume Improvement (EHVI).
Reference: (Couckuyt et al., 2014) Fast calculation of multiobjective probability of improvement and expected improvement criteria for Pareto optimization
- パラメータ:
fmean (numpy.ndarray) -- mean of the predictive distribution, shape (N, n_obj); the first axis must be the N candidates, the rest is reshaped to (N, n_obj)
fstd (numpy.ndarray) -- standard deviation of the predictive distribution, any shape with N * n_obj elements (reshaped to (N, n_obj))
pareto (Pareto object) -- Pareto object. The non-dominated region is divided into cells and the reference points are set by default if not done yet.
objectives (The result is the expected hypervolume improvement when the)
deviation (are independent normal variables with mean fmean and standard)
fstd
contribute (where predictions beyond reference_max in any objective)
between (zero (they are not clipped). It holds only while the front lies)
reference_max. (reference_min and)
- 戻り値:
score -- score of the candidates, shape (N,)
- 戻り値の型:
numpy.ndarray
- class physbo.search.score_multi.ExpectedHypervolumeImprovement[ソース]
ベースクラス:
objectCallable hypervolume acquisition function wrapping
EHVI().メモ
Called with predictor_list, training, test and pareto as positional arguments. Returns scores of shape
(test.X.shape[0],).参考
EHVIAcquisition function using posterior means and standard deviations.
- name = 'EHVI'
- physbo.search.score_multi.HVPI(fmean, fstd, pareto)[ソース]
Calculate Hypervolume-based Probability of Improvement (HVPI).
Reference: (Couckuyt et al., 2014) Fast calculation of multiobjective probability of improvement and expected improvement criteria for Pareto optimization
- パラメータ:
fmean (numpy.ndarray) -- mean of the predictive distribution, shape (N, n_obj); the first axis must be the N candidates, the rest is reshaped to (N, n_obj)
fstd (numpy.ndarray) -- standard deviation of the predictive distribution, any shape with N * n_obj elements (reshaped to (N, n_obj))
pareto (Pareto object) -- Pareto object. The non-dominated region is divided into cells and reference_min is set by default if not done yet.
reference_min. (The result holds only while the front lies above)
- 戻り値:
score -- score of the candidates, shape (N,)
- 戻り値の型:
numpy.ndarray
- class physbo.search.score_multi.HypervolumeProbabilityOfImprovement[ソース]
ベースクラス:
objectCallable hypervolume acquisition function wrapping
HVPI().メモ
Called with predictor_list, training, test and pareto as positional arguments. Returns scores of shape
(test.X.shape[0],).参考
HVPIAcquisition function using posterior means and standard deviations.
- name = 'HVPI'
- physbo.search.score_multi.TS(predictor_list, training, test, alpha=1, reduced_candidate_num=None, rng=None)[ソース]
Thompson Sampling for multi-objective optimization.
- パラメータ:
predictor_list (list of Predictor) -- List of predictors for each objective.
training (Variable) -- Training data containing all objectives.
test (Variable) -- Test points.
alpha (float, optional) -- Scaling parameter for sampling from posterior distribution. Default is 1.
reduced_candidate_num (int, optional) -- Number of candidates to randomly select for Pareto front calculation. If None or less than number of test points, all points are used. Default is None.
- 戻り値:
score_res -- Score array with 1 at the chosen index and 0 elsewhere.
- 戻り値の型:
numpy.ndarray
- class physbo.search.score_multi.ThompsonSampling(alpha=1.0, reduced_candidate_num=None, rng=None)[ソース]
ベースクラス:
objectCallable multi-objective Thompson sampling wrapping
TS().- パラメータ:
alpha (float, optional) -- Posterior sampling scale. Default is 1.0.
reduced_candidate_num (int, optional) -- Maximum number of candidates used for Pareto front calculation. Default is None, which uses all candidates.
rng (rng object, optional) -- Random number generator for the posterior samples and the choice among the Pareto front; None (default) draws from the global
numpy.randomstate. An instance given to a policy without a generator of its own borrows the policy's (seephysbo._rng.attach_rng()).
参考
TSMulti-objective Thompson sampling acquisition function.
- name = 'TS'
- physbo.search.score_multi.resolve(score, *, alpha=1.0, reduced_candidate_num=None, rng=None)[ソース]
Resolve a multi-objective score name or return a callable unchanged.
- パラメータ:
score (str or callable) -- "EHVI", "HVPI", "TS", or a callable accepting predictor_list, training, test and pareto as positional arguments.
alpha (float, optional) -- Posterior sampling scale for "TS". Default is 1.0.
reduced_candidate_num (int, optional) -- Candidate limit for "TS". Default is None, using all candidates.
rng (rng object, optional) -- Random number generator for "TS". A callable that holds a generator in an
rngattribute and was not given one of its own (the built-inThompsonSampling) is attached to it (seephysbo._rng.attach_rng()). Default is None, the globalnumpy.randomstate.
- 戻り値:
Acquisition function. Existing callables are returned unchanged.
- 戻り値の型:
callable
- 例外:
NotImplementedError -- If the score name is unknown.
TypeError -- If score is a class rather than an instance, or is neither a string nor a callable.
- physbo.search.score_multi.score(mode, predictor_list, test, training, **kwargs)[ソース]
Calculate multi-objective acquisition scores for test data.
- パラメータ:
mode (str or callable) -- "EHVI", "HVPI", "TS", or a callable called as
mode(predictor_list, training, test, pareto).predictor_list (list of predictor objects) -- Predictor for each objective.
test (physbo.Variable) -- Test inputs.
training (physbo.Variable) -- Training dataset containing all objectives.
pareto (Pareto) -- Required for EHVI and HVPI. Passed to callable modes, as None when omitted.
alpha (float) -- Posterior sampling scale for string "TS". Default is 1.0.
reduced_candidate_num (int or None) -- Required candidate limit for string "TS"; None uses all candidates. Callable modes ignore this parameter and alpha.
rng (rng object) -- Random number generator for string "TS" (default: the global
numpy.randomstate); a callable mode draws from its own.
- 戻り値:
Acquisition scores of shape
(test.X.shape[0],).- 戻り値の型:
numpy.ndarray