(self, domain, acquisition, optimizer=None, initial=None, scaling=True, hyper_draws=None,
                 callback=jitchol_callback, verbose=False)
:param Domain domain: The optimization space.
        :param Acquisition acquisition: The acquisition function to optimize over the domain.
        :param Optimizer optimizer: (optional) optimization approach for the acquisition function.
            If not specified, :class:`~.optim.SciPyOptimizer` is used.
            This optimizer will run on the same domain as the :class:`.BayesianOptimizer` object.
        :param Design initial: (optional) The initial design of candidates to evaluate
            before the optimization loop runs. Note that if the underlying model contains already some data from
            an initial design, it is augmented with the evaluations obtained by evaluating
            the points as specified by the design.
        :param bool scaling: (boolean, default true) if set to true, the outputs are normalized, and the inputs are
            scaled to a unit cube. This only affects model training: calls to acquisition.data, as well as
            returned optima are unscaled (see :class:`~.DataScaler` for more details.). Note, the models contained by
            acquisition are modified directly, and so the references to the model outside of BayesianOptimizer now point
            to scaled models.
        :param int hyper_draws: (optional) Enable marginalization of model hyperparameters. By default, point estimates are
            used. If this parameter set to n, n hyperparameter draws from the likelihood distribution
            are obtained using Hamiltonian MC.
            (see `GPflow documentation <https://gpflow.readthedocs.io/en/latest//>`_ for details) for each model.
            The acquisition score is computed for each draw, and averaged.
        :param callable callback: (optional) this function or object will be called, after the
            data of all models has been updated with all models as retrieved by acquisition.models as argument without
            the wrapping model handling any scaling . This allows custom model optimization strategies to be implemented.
            All manipulations of GPflow models are permitted. Combined with the optimize_restarts parameter of
            :class:`~.Acquisition` this allows several scenarios: do the optimization manually from the callback
            (optimize_restarts equals 0), or choose the starting point + some random restarts (optimize_restarts > 0).
:param Domain domain: The optimization space.
        :param Acquisition acquisition: The acquisition function to optimize over the domain.
        :param Optimizer optimizer: (optional) optimization approach for the acquisition function.
            If not specified, :class:`~.optim.SciPyOptimizer` is used.
            This optimizer will run on the same domain as the :class:`.BayesianOptimizer` object.
        :param Design initial: (optional) The initial design of candidates to evaluate
            before the optimization loop runs. Note that if the underlying model contains already some data from
            an initial design, it is augmented with the evaluations obtained by evaluating
            the points as specified by the design.
        :param bool scaling: (boolean, default true) if set to true, the outputs are normalized, and the inputs are
            scaled to a unit cube. This only affects model training: calls to acquisition.data, as well as
            returned optima are unscaled (see :class:`~.DataScaler` for more details.). Note, the models contained by
            acquisition are modified directly, and so the references to the model outside of BayesianOptimizer now point
            to scaled models.
        :param int hyper_draws: (optional) Enable marginalization of model hyperparameters. By default, point estimates are
            used. If this parameter set to n, n hyperparameter draws from the likelihood distribution
            are obtained using Hamiltonian MC.
            (see `GPflow documentation <https://gpflow.readthedocs.io/en/latest//>`_ for details) for each model.
            The acquisition score is computed for each draw, and averaged.
        :param callable callback: (optional) this function or object will be called, after the
            data of all models has been updated with all models as retrieved by acquisition.models as argument without
            the wrapping model handling any scaling . This allows custom model optimization strategies to be implemented.
            All manipulations of GPflow models are permitted. Combined with the optimize_restarts parameter of
            :class:`~.Acquisition` this allows several scenarios: do the optimization manually from the callback
            (optimize_restarts equals 0), or choose the starting point + some random restarts (optimize_restarts > 0).
: param Domain domain : The optimization space . : param Acquisition acquisition : The acquisition function to optimize over the domain . : param Optimizer optimizer : ( optional ) optimization approach for the acquisition function . If not specified : class : ~ . optim . SciPyOptimizer is used . This optimizer will run on the same domain as the : class : . BayesianOptimizer object . : param Design initial : ( optional ) The initial design of candidates to evaluate before the optimization loop runs . Note that if the underlying model contains already some data from an initial design it is augmented with the evaluations obtained by evaluating the points as specified by the design . : param bool scaling : ( boolean default true ) if set to true the outputs are normalized and the inputs are scaled to a unit cube . This only affects model training : calls to acquisition . data as well as returned optima are unscaled ( see : class : ~ . DataScaler for more details . ) . Note the models contained by acquisition are modified directly and so the references to the model outside of BayesianOptimizer now point to scaled models . : param int hyper_draws : ( optional ) Enable marginalization of model hyperparameters . By default point estimates are used . If this parameter set to n n hyperparameter draws from the likelihood distribution are obtained using Hamiltonian MC . ( see GPflow documentation <https : // gpflow . readthedocs . io / en / latest // > _ for details ) for each model . The acquisition score is computed for each draw and averaged . : param callable callback : ( optional ) this function or object will be called after the data of all models has been updated with all models as retrieved by acquisition . models as argument without the wrapping model handling any scaling . This allows custom model optimization strategies to be implemented . All manipulations of GPflow models are permitted . Combined with the optimize_restarts parameter of : class : ~ . Acquisition this allows several scenarios : do the optimization manually from the callback ( optimize_restarts equals 0 ) or choose the starting point + some random restarts ( optimize_restarts > 0 ) .
def __init__(self, domain, acquisition, optimizer=None, initial=None, scaling=True, hyper_draws=None,
                 callback=jitchol_callback, verbose=False):
        """
        :param Domain domain: The optimization space.
        :param Acquisition acquisition: The acquisition function to optimize over the domain.
        :param Optimizer optimizer: (optional) optimization approach for the acquisition function.
            If not specified, :class:`~.optim.SciPyOptimizer` is used.
            This optimizer will run on the same domain as the :class:`.BayesianOptimizer` object.
        :param Design initial: (optional) The initial design of candidates to evaluate
            before the optimization loop runs. Note that if the underlying model contains already some data from
            an initial design, it is augmented with the evaluations obtained by evaluating
            the points as specified by the design.
        :param bool scaling: (boolean, default true) if set to true, the outputs are normalized, and the inputs are
            scaled to a unit cube. This only affects model training: calls to acquisition.data, as well as
            returned optima are unscaled (see :class:`~.DataScaler` for more details.). Note, the models contained by
            acquisition are modified directly, and so the references to the model outside of BayesianOptimizer now point
            to scaled models.
        :param int hyper_draws: (optional) Enable marginalization of model hyperparameters. By default, point estimates are
            used. If this parameter set to n, n hyperparameter draws from the likelihood distribution
            are obtained using Hamiltonian MC.
            (see `GPflow documentation <https://gpflow.readthedocs.io/en/latest//>`_ for details) for each model.
            The acquisition score is computed for each draw, and averaged.
        :param callable callback: (optional) this function or object will be called, after the
            data of all models has been updated with all models as retrieved by acquisition.models as argument without
            the wrapping model handling any scaling . This allows custom model optimization strategies to be implemented.
            All manipulations of GPflow models are permitted. Combined with the optimize_restarts parameter of
            :class:`~.Acquisition` this allows several scenarios: do the optimization manually from the callback
            (optimize_restarts equals 0), or choose the starting point + some random restarts (optimize_restarts > 0).
        """
        assert isinstance(acquisition, Acquisition)
        assert hyper_draws is None or hyper_draws > 0
        assert optimizer is None or isinstance(optimizer, Optimizer)
        assert initial is None or isinstance(initial, Design)
        super(BayesianOptimizer, self).__init__(domain, exclude_gradient=True)

        self._scaling = scaling
        if self._scaling:
            acquisition.enable_scaling(domain)

        self.acquisition = acquisition if hyper_draws is None else MCMCAcquistion(acquisition, hyper_draws)

        self.optimizer = optimizer or SciPyOptimizer(domain)
        self.optimizer.domain = domain
        initial = initial or EmptyDesign(domain)
        self.set_initial(initial.generate())

        self._model_callback = callback
        self.verbose = verbose
def __init__ ( self , domain , acquisition , optimizer = None , initial = None , scaling = True , hyper_draws = None , callback = jitchol_callback , verbose = False ) : assert isinstance ( acquisition , Acquisition ) assert hyper_draws is None or hyper_draws > 0 assert optimizer is None or isinstance ( optimizer , Optimizer ) assert initial is None or isinstance ( initial , Design ) super ( BayesianOptimizer , self ) . __init__ ( domain , exclude_gradient = True ) self . _scaling = scaling if self . _scaling : acquisition . enable_scaling ( domain ) self . acquisition = acquisition if hyper_draws is None else MCMCAcquistion ( acquisition , hyper_draws ) self . optimizer = optimizer or SciPyOptimizer ( domain ) self . optimizer . domain = domain initial = initial or EmptyDesign ( domain ) self . set_initial ( initial . generate ( ) ) self . _model_callback = callback self . verbose = verbose