GPyOpt.optimization package¶
Submodules¶
GPyOpt.optimization.acquisition_optimizer module¶
-
class
GPyOpt.optimization.acquisition_optimizer.
AcquisitionOptimizer
(space, optimizer='lbfgs', **kwargs)¶ Bases:
object
General class for acquisition optimizers defined in domains with mix of discrete, continuous, bandit variables
Parameters: - space – design space class from GPyOpt.
- optimizer – optimizer to use. Can be selected among: - ‘lbfgs’: L-BFGS. - ‘DIRECT’: Dividing Rectangles. - ‘CMA’: covariance matrix adaptation.
-
optimize
(f=None, df=None, f_df=None, duplicate_manager=None)¶ Optimizes the input function.
Parameters: - f – function to optimize.
- df – gradient of the function to optimize.
- f_df – returns both the function to optimize and its gradient.
-
class
GPyOpt.optimization.acquisition_optimizer.
ContextManager
(space, context=None)¶ Bases:
object
class to handle the context variable in the optimizer :param space: design space class from GPyOpt. :param context: dictionary of variables and their contex values
GPyOpt.optimization.anchor_points_generator module¶
-
class
GPyOpt.optimization.anchor_points_generator.
AnchorPointsGenerator
(space, design_type, num_samples)¶ Bases:
object
-
get
(num_anchor=5, duplicate_manager=None, unique=False, context_manager=None)¶
-
get_anchor_point_scores
(X)¶
-
-
class
GPyOpt.optimization.anchor_points_generator.
ObjectiveAnchorPointsGenerator
(space, design_type, objective, num_samples=1000)¶ Bases:
GPyOpt.optimization.anchor_points_generator.AnchorPointsGenerator
-
get_anchor_point_scores
(X)¶
-
-
class
GPyOpt.optimization.anchor_points_generator.
RandomAnchorPointsGenerator
(space, design_type, num_samples=10000)¶ Bases:
GPyOpt.optimization.anchor_points_generator.AnchorPointsGenerator
-
get_anchor_point_scores
(X)¶
-
-
class
GPyOpt.optimization.anchor_points_generator.
ThompsonSamplingAnchorPointsGenerator
(space, design_type, model, num_samples=25000)¶ Bases:
GPyOpt.optimization.anchor_points_generator.AnchorPointsGenerator
-
get_anchor_point_scores
(X)¶
-
GPyOpt.optimization.optimizer module¶
-
class
GPyOpt.optimization.optimizer.
OptCma
(bounds, maxiter=1000)¶ Bases:
GPyOpt.optimization.optimizer.Optimizer
Wrapper the Covariance Matrix Adaptation Evolutionary strategy (CMA-ES) optimization method. It works generating an stochastic search based on multivariate Gaussian samples. Only requires f and the box constraints to work.
-
optimize
(x0, f=None, df=None, f_df=None)¶ Parameters: - x0 – initial point for a local optimizer.
- f – function to optimize.
- df – gradient of the function to optimize.
- f_df – returns both the function to optimize and its gradient.
-
-
class
GPyOpt.optimization.optimizer.
OptDirect
(bounds, maxiter=1000)¶ Bases:
GPyOpt.optimization.optimizer.Optimizer
Wrapper for DIRECT optimization method. It works partitioning iteratively the domain of the function. Only requires f and the box constraints to work.
-
optimize
(x0, f=None, df=None, f_df=None)¶ Parameters: - x0 – initial point for a local optimizer.
- f – function to optimize.
- df – gradient of the function to optimize.
- f_df – returns both the function to optimize and its gradient.
-
-
class
GPyOpt.optimization.optimizer.
OptLbfgs
(bounds, maxiter=1000)¶ Bases:
GPyOpt.optimization.optimizer.Optimizer
Wrapper for l-bfgs-b to use the true or the approximate gradients.
-
optimize
(x0, f=None, df=None, f_df=None)¶ Parameters: - x0 – initial point for a local optimizer.
- f – function to optimize.
- df – gradient of the function to optimize.
- f_df – returns both the function to optimize and its gradient.
-
-
class
GPyOpt.optimization.optimizer.
OptimizationWithContext
(x0, f, df=None, f_df=None, context_manager=None)¶ Bases:
object
-
df_nc
(x)¶ Wrapper of the derivative of f: takes an input x with size of the not fixed dimensions expands it and evaluates the gradient of the entire function.
-
f_df_nc
(x)¶ Wrapper of the derivative of f: takes an input x with size of the not fixed dimensions expands it and evaluates the gradient of the entire function.
-
f_nc
(x)¶ Wrapper of f: takes an input x with size of the noncontext dimensions expands it and evaluates the entire function.
-
-
class
GPyOpt.optimization.optimizer.
Optimizer
(bounds)¶ Bases:
object
Class for a general acquisition optimizer.
Parameters: bounds – list of tuple with bounds of the optimizer -
optimize
(x0, f=None, df=None, f_df=None)¶ Parameters: - x0 – initial point for a local optimizer.
- f – function to optimize.
- df – gradient of the function to optimize.
- f_df – returns both the function to optimize and its gradient.
-
-
GPyOpt.optimization.optimizer.
apply_optimizer
(optimizer, x0, f=None, df=None, f_df=None, duplicate_manager=None, context_manager=None, space=None)¶ Parameters: - x0 – initial point for a local optimizer (x0 can be defined with or without the context included).
- f – function to optimize.
- df – gradient of the function to optimize.
- f_df – returns both the function to optimize and its gradient.
- duplicate_manager – logic to check for duplicate (always operates in the full space, context included)
- context_manager – If provided, x0 (and the optimizer) operates in the space without the context
- space – GPyOpt class design space.
-
GPyOpt.optimization.optimizer.
choose_optimizer
(optimizer_name, bounds)¶ Selects the type of local optimizer