OptimizeResult

Contents

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 of yval_vec, weighted by their precisions with specify_target_noise. Without final samples, the estimate available when the run stops, normally from the GP.

  • fsd: float
    • Uncertainty (SD) of fval as an estimate of the target’s value at x, 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 x that fval averages; None for a deterministic target, with noise_final_samples=0, or when the budget leaves no final samples. With one final sample and no specify_target_noise, includes the observation already recorded at x. 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 with specify_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 BADS was 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_mesh or the stall criterion (status 1 or 2); False when it stopped on max_fun_evals, max_iter or output_fcn (status 0).

  • status: int
    • The criterion that ended the run: 0 for max_fun_evals, max_iter or output_fcn; 1 when the mesh size fell below tol_mesh; 2 when the improvement over the last tol_stall_iters iterations fell below tol_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)" with specify_target_noise.

  • total_time: float
    • Time taken by optimize(), in seconds; the setup made when BADS is created is not counted.

  • overhead: float
    • The optimizer’s own time relative to the time spent evaluating the target: total_time divided by the evaluations’ time, minus 1. The automatic noise test at x0 counts as optimizer time.

  • random_seed: int or None
    • The random_seed option if it is an integer, and None otherwise.

  • 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.