OptimizeResult#
Note
The main output of a PyBADS run is a OptimizeResult dictionary object.
Its attributes and interface are described below.
- class pybads.bads.OptimizeResult(bads=None)[source]#
It represents the optimization result. The class is based on
scipy.optimize.OptimizeResult. See also: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.OptimizeResult.html.Attributes:
- fun: callable
The objective function to be minimized, the object passed to
BADS.
- non_box_cons: callable
Non-box constraints function (if any), the object passed to
BADS.
- x0: np.ndarray
Initial starting point, as given or drawn at random, with the fixed variables at their values.
- x: np.ndarray
The solution of the optimization.
- fval: float
Value of objective function at solution. In a noisy run, an estimate of the target’s mean at
x: normally the average ofyval_vec, weighted by their precisions withspecify_target_noise. Without final samples, the estimate available when the run stops, normally from the GP.
- fsd: float
Uncertainty (SD) of
fvalas an estimate of the target’s value atx, such as the standard error of the final samples in a noisy run; 0 for a deterministic target.
- yval_vec: np.ndarray or None
In a noisy run, the observations of the target at
xthatfvalaverages; None for a deterministic target, withnoise_final_samples=0, or when the budget leaves no final samples. With one final sample and nospecify_target_noise, includes the observation already recorded atx. If an output function stops the run at"init"after samples have been reserved, holds the incumbent’s observation alone.
- ysd_vec: np.ndarray or None
Standard deviations of the final sampled observations (
"yval_vec") that the target returns withspecify_target_noise; None otherwise, and when no final sample was taken.
- mesh_size: float
Final mesh size.
- func_count: int
Number of evaluations of the objective functions. The evaluations made before the run (
precomputed_evaluations) are not counted.
- precomputed_observations: int
Number of evaluations made before the run that
BADSwas given (precomputed_evaluations); present only when it was given at least one.
- precomputed_locations: int
Number of distinct points among them; present with
precomputed_observations.
- iterations: int
Number of iterations performed by the optimizer.
- success: bool
True when the run converged, on
tol_meshor the stall criterion (status1 or 2); False when it stopped onmax_fun_evals,max_iteroroutput_fcn(status0).
- status: int
The criterion that ended the run: 0 for
max_fun_evals,max_iteroroutput_fcn; 1 when the mesh size fell belowtol_mesh; 2 when the improvement over the lasttol_stall_itersiterations fell belowtol_fun.
- message: str
Termination message.
- problem_type: str
Type of problem (unconstrained, bound constraints, non-box constraints).
- target_type: str
"deterministic","stochastic"for a noisy target whose noise BADS infers, or"stochastic (specified noise)"withspecify_target_noise.
- total_time: float
Time taken by
optimize(), in seconds; the setup made whenBADSis created is not counted.
- overhead: float
The optimizer’s own time relative to the time spent evaluating the target:
total_timedivided by the evaluations’ time, minus 1. The automatic noise test atx0counts as optimizer time.
- random_seed: int or None
The
random_seedoption if it is an integer, andNoneotherwise.
- algorithm: str
"Bayesian adaptive direct search".
- version: str
Version of the optimizer.
- Parameters:
- bads: pybads.BADS
An Instance of the BADS class. It is used to set the attributes of the optimization result.