GPyOpt.util package

Submodules

GPyOpt.util.arguments_manager module

class GPyOpt.util.arguments_manager.ArgumentsManager(kwargs)

Bases: object

Class to handle extra configurations in the definition of the BayesianOptimization class

acquisition_creator(acquisition_type, model, space, acquisition_optimizer, cost_withGradients)

Acquisition chooser from the available options. Extra parameters can be passed via **kwargs.

evaluator_creator(evaluator_type, acquisition, batch_size, model_type, model, space, acquisition_optimizer)

Acquisition chooser from the available options. Guide the optimization through sequential or parallel evalutions of the objective.

model_creator(model_type, exact_feval, space)

Model chooser from the available options. Extra parameters can be passed via **kwargs.

GPyOpt.util.duplicate_manager module

class GPyOpt.util.duplicate_manager.DuplicateManager(space, zipped_X, pending_zipped_X=None, ignored_zipped_X=None)

Bases: object

Class to manage potential duplicates in the suggested candidates.

Parameters:
  • space – object managing all the logic related the domain of the optimization
  • zipped_X – matrix of evaluated configurations
  • pending_zipped_X – matrix of configurations in the pending state
  • ignored_zipped_X – matrix of configurations that the user desires to ignore (e.g., because they may have led to failures)
is_unzipped_x_duplicate(unzipped_x)

param: unzipped_x: configuration assumed to be unzipped

is_zipped_x_duplicate(zipped_x)

param: zipped_x: configuration assumed to be zipped

GPyOpt.util.general module

GPyOpt.util.general.best_guess(f, X)

Gets the best current guess from a vector. :param f: function to evaluate. :param X: locations.

GPyOpt.util.general.best_value(Y, sign=1)

Returns a vector whose components i are the minimum (default) or maximum of Y[:i]

GPyOpt.util.general.compute_integrated_acquisition(acquisition, x)

Used to compute the acquisition function when samples of the hyper-parameters have been generated (used in GP_MCMC model).

Parameters:
  • acquisition – acquisition function with GpyOpt model type GP_MCMC.
  • x – location where the acquisition is evaluated.
GPyOpt.util.general.compute_integrated_acquisition_withGradients(acquisition, x)

Used to compute the acquisition function with gradients when samples of the hyper-parameters have been generated (used in GP_MCMC model).

Parameters:
  • acquisition – acquisition function with GpyOpt model type GP_MCMC.
  • x – location where the acquisition is evaluated.
GPyOpt.util.general.evaluate_function(f, X)

Returns the evaluation of a function f and the time per evaluation

GPyOpt.util.general.get_d_moments(model, x)

Gradients with respect to x of the moments (mean and sdev.) of the GP :param model: GPy model. :param x: location where the gradients are evaluated.

GPyOpt.util.general.get_moments(model, x)

Moments (mean and sdev.) of a GP model at x

GPyOpt.util.general.get_quantiles(acquisition_par, fmin, m, s)

Quantiles of the Gaussian distribution useful to determine the acquisition function values :param acquisition_par: parameter of the acquisition function :param fmin: current minimum. :param m: vector of means. :param s: vector of standard deviations.

GPyOpt.util.general.merge_values(values1, values2)

Merges two numpy arrays by calculating all possible combinations of rows

GPyOpt.util.general.normalize(Y, normalization_type='stats')

Normalize the vector Y using statistics or its range.

Parameters:
  • Y – Row or column vector that you want to normalize.
  • normalization_type – String specifying the kind of normalization

to use. Options are ‘stats’ to use mean and standard deviation, or ‘maxmin’ to use the range of function values. :return Y_normalized: The normalized vector.

GPyOpt.util.general.reshape(x, input_dim)

Reshapes x into a matrix with input_dim columns

GPyOpt.util.general.samples_multidimensional_uniform(bounds, num_data)

Generates a multidimensional grid uniformly distributed. :param bounds: tuple defining the box constraints. :num_data: number of data points to generate.

GPyOpt.util.general.spawn(f)

Function for parallel evaluation of the acquisition function

GPyOpt.util.general.values_to_array(input_values)

Transforms a values of int, float and tuples to a column vector numpy array

GPyOpt.util.io module

GPyOpt.util.io.gen_datestr()

Returns a string with the yy/mm/dd and hh/mm/ss

GPyOpt.util.stats module

Module contents