### Install Emukit from Source Step-by-Step Source: https://emukit.readthedocs.io/en/latest/installation.html Clone the Emukit repository, navigate to the directory, install dependencies, and then install Emukit in development mode. This provides more control over the installation process. ```bash git clone https://github.com/emukit/emukit.git cd Emukit pip install -r requirements/requirements.txt python setup.py develop ``` -------------------------------- ### Install Emukit from GitHub using pip Source: https://emukit.readthedocs.io/en/latest/installation.html Install Emukit directly from its GitHub repository. This is useful for getting the latest development version. ```bash pip install git+https://github.com/emukit/emukit.git ``` -------------------------------- ### Install Emukit using pip Source: https://emukit.readthedocs.io/en/latest/installation.html Use this command to install the Emukit package directly from PyPI. Ensure Python 3.5+ and NumPy are installed. ```bash pip install emukit ``` -------------------------------- ### Enable Emukit Logging Source: https://emukit.readthedocs.io/en/latest/usage.html Use this code to enable logging before calling Emukit functions to monitor progress. Basic configuration is shown; refer to Python documentation for advanced setups. ```python import logging logging.basicConfig(level=logging.INFO) ``` -------------------------------- ### Set up Emukit parameter space and experimental design loop Source: https://emukit.readthedocs.io/en/latest/notebooks/Emukit-tutorial-custom-model.html Defines the parameter space for the optimization and initializes the `ExperimentalDesignLoop` with the custom Emukit model. The loop is then run to collect data by optimizing the acquisition function. ```python p = ContinuousParameter('c', x_min, x_max) space = ParameterSpace([p]) loop = ExperimentalDesignLoop(space, emukit_model) loop.run_loop(np.sin, 50) ``` -------------------------------- ### get Source: https://emukit.readthedocs.io/en/latest/genindex.html Retrieves an item, likely from an AnchorPointsGenerator. ```APIDOC ## Method: get ### Description Retrieves an item. This method is part of the AnchorPointsGenerator class. ### Class emukit.core.optimization.anchor_points_generator.AnchorPointsGenerator ``` -------------------------------- ### QuadratureProductKernel Methods Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Methods available for QuadratureProductKernel. ```APIDOC ## QuadratureProductKernel.qK() ### Description Calculates the kernel. ### Method N/A (Method call) ### Endpoint N/A ### Parameters None explicitly documented. ### Request Example N/A ### Response N/A ## QuadratureProductKernel.qKq() ### Description Calculates the kernel with a second input. ### Method N/A (Method call) ### Endpoint N/A ### Parameters None explicitly documented. ### Request Example N/A ### Response N/A ## QuadratureProductKernel.dqK_dx() ### Description Calculates the gradient of the kernel with respect to the first input. ### Method N/A (Method call) ### Endpoint N/A ### Parameters None explicitly documented. ### Request Example N/A ### Response N/A ``` -------------------------------- ### AnchorPointsGenerator.get Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Gets anchor points using AnchorPointsGenerator. ```APIDOC ## AnchorPointsGenerator.get() ### Description Gets anchor points using AnchorPointsGenerator. ### Method Not specified (assumed to be a method call within a Python context). ### Parameters None explicitly defined in the source. ### Request Example ```python anchor_points_generator_instance.get() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### emukit.core.initial_designs Source: https://emukit.readthedocs.io/en/latest/api/emukit.core.html Provides strategies for generating initial sample points for Bayesian optimization. ```APIDOC ## InitialDesignBase ### Description Base class for initial design strategies. ### Methods - `get_samples()`: Generates initial samples. ``` ```APIDOC ## RandomDesign ### Description Generates initial samples randomly within the search space. ### Methods - `get_samples()`: Generates random samples. ``` -------------------------------- ### IDifferentiable.get_prediction_gradients Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Gets the prediction gradients from the IDifferentiable interface. ```APIDOC ## IDifferentiable.get_prediction_gradients() ### Description Gets the prediction gradients from the IDifferentiable interface. ### Method Not specified (assumed to be a method call within a Python context). ### Parameters None explicitly defined in the source. ### Request Example ```python idifferentiable_instance.get_prediction_gradients() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### emukit.model_wrappers.ProductMatern32GPy Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Product Matern 3/2 kernel for GPy models. ```APIDOC ## ProductMatern32GPy ### Description Represents a product of Matern 3/2 kernels for GPy models. ### Methods - `K(X1, X2)`: Computes the kernel matrix between points `X1` and `X2`. - `dK_dx1(X)`: Computes the gradient of the kernel matrix with respect to the first input. ### Properties - `lengthscales`: The lengthscales of the Matern kernels. - `variance`: The variance of the Matern kernels. ``` -------------------------------- ### ObjectiveAnchorPointsGenerator.get_anchor_point_scores Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Gets anchor point scores using ObjectiveAnchorPointsGenerator. ```APIDOC ## ObjectiveAnchorPointsGenerator.get_anchor_point_scores() ### Description Gets anchor point scores using ObjectiveAnchorPointsGenerator. ### Method Not specified (assumed to be a method call within a Python context). ### Parameters None explicitly defined in the source. ### Request Example ```python objective_anchor_points_generator_instance.get_anchor_point_scores() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### OuterLoop.get_next_points Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Gets the next points to evaluate using OuterLoop. ```APIDOC ## OuterLoop.get_next_points() ### Description Gets the next points to evaluate using OuterLoop. ### Method Not specified (assumed to be a method call within a Python context). ### Parameters None explicitly defined in the source. ### Request Example ```python outer_loop_instance.get_next_points() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### emukit.model_wrappers.ProductMatern12GPy Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Product Matern 1/2 kernel for GPy models. ```APIDOC ## ProductMatern12GPy ### Description Represents a product of Matern 1/2 kernels for GPy models. ### Methods - `K(X1, X2)`: Computes the kernel matrix between points `X1` and `X2`. - `dK_dx1(X)`: Computes the gradient of the kernel matrix with respect to the first input. ### Properties - `lengthscales`: The lengthscales of the Matern kernels. - `variance`: The variance of the Matern kernels. ``` -------------------------------- ### InitialDesignBase.get_samples Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Retrieves samples from the InitialDesignBase. ```APIDOC ## InitialDesignBase.get_samples() ### Description Retrieves samples from the InitialDesignBase. ### Method Not specified (assumed to be a method call within a Python context). ### Parameters None explicitly defined in the source. ### Request Example ```python initial_design_base_instance.get_samples() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### IJointlyDifferentiable.get_joint_prediction_gradients Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Gets the joint prediction gradients from the IJointlyDifferentiable interface. ```APIDOC ## IJointlyDifferentiable.get_joint_prediction_gradients() ### Description Gets the joint prediction gradients from the IJointlyDifferentiable interface. ### Method Not specified (assumed to be a method call within a Python context). ### Parameters None explicitly defined in the source. ### Request Example ```python i_jointly_differentiable_instance.get_joint_prediction_gradients() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### QuadratureProductKernel Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.html Product kernel function for quadrature. ```APIDOC ## QuadratureProductKernel ### Description Product kernel function for quadrature. ### Methods - `qK()`: Computes the quadrature kernel. - `qKq()`: Computes the quadrature kernel with query points. - `dqK_dx()`: Computes the gradient of the quadrature kernel. ``` -------------------------------- ### EntropySearch Source: https://emukit.readthedocs.io/en/latest/api/emukit.bayesian_optimization.acquisitions.html The EntropySearch acquisition function aims to maximize the information gain about the location of the optimum. It approximates the distribution of the global optimum and uses this to guide the search. ```APIDOC ## class _emukit.bayesian_optimization.acquisitions.entropy_search.EntropySearch(_model_ , _space_ , _sampler =None_, _num_samples =100_, _num_representer_points =50_, _proposal_function =None_, _burn_in_steps =50_) ### Description Bases: `Acquisition` ### Methods #### update_parameters() Updates p_min parameter Return type: `None` #### update_pmin() Approximates the distribution of the global optimum p(x=x_star|D) by doing the following steps: * discretizing the input space by representer points sampled from a proposal measure (default EI) * predicting mean and the covariance matrix of these representer points * uses EPMGP algorithm to compute the probability of each representer point being the minimum Return type: `ndarray` #### evaluate(_x_) Computes the information gain, i.e the change in entropy of p_min if we would evaluate x. Parameters: * **x** (`ndarray`) – points where the acquisition is evaluated. Return type: `ndarray` ### Properties #### _has_gradients Returns that this acquisition has gradients ``` -------------------------------- ### WSABILLoop Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.loop.html The loop for WSABI-L. ```APIDOC ## WSABILLoop ### Description The loop for WSABI-L. ### Parameters * **model** (WSABIL) - The WSABI-L model. * **model_updater** (Optional[ModelUpdater]) - Defines how and when the quadrature model is updated if new data arrives. Defaults to updating hyper-parameters every iteration. * **acquisition_optimizer** (Optional[AcquisitionOptimizerBase]) - Optimizer selecting next evaluation points by maximizing acquisition. Gradient based optimizer is used if None. Defaults to None. ``` -------------------------------- ### Import necessary Emukit and utility libraries Source: https://emukit.readthedocs.io/en/latest/notebooks/Emukit-tutorial-custom-model.html Imports core Emukit components for experimental design and parameter spaces, along with NumPy for numerical operations. ```python import numpy as np from emukit.experimental_design import ExperimentalDesignLoop from emukit.core import ParameterSpace, ContinuousParameter from emukit.core.loop import UserFunctionWrapper ``` -------------------------------- ### QuadratureKernel Methods Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Methods for the QuadratureKernel class, used in quadrature methods. ```APIDOC ## QuadratureKernel ### Description A kernel designed for use in quadrature methods. ### Methods #### `K(X1, X2)` Computes the kernel matrix between two sets of points `X1` and `X2`. #### `qK(X)` Computes the kernel matrix between a set of points `X` and the quadrature points. #### `Kq(X)` Computes the kernel matrix between the quadrature points and a set of points `X`. #### `qKq()` Computes the kernel matrix between the quadrature points. #### `dK_dx1(X1, X2)` Computes the gradient of the kernel matrix with respect to the first set of points `X1`. #### `dK_dx2(X1, X2)` Computes the gradient of the kernel matrix with respect to the second set of points `X2`. #### `dKdiag_dx(X)` Computes the gradient of the diagonal of the kernel matrix with respect to the input points `X`. #### `dqK_dx(X)` Computes the gradient of `qK` with respect to the input points `X`. #### `dKq_dx(X)` Computes the gradient of `Kq` with respect to the input points `X`. ``` -------------------------------- ### Initialize and train scikit-learn GP model Source: https://emukit.readthedocs.io/en/latest/notebooks/Emukit-tutorial-custom-model.html Generates sample data and trains a scikit-learn GaussianProcessRegressor on it. This model will later be wrapped for Emukit. ```python x_min = -30.0 x_max = 30.0 X = np.random.uniform(x_min, x_max, (10, 1)) Y = np.sin(X) + np.random.randn(10, 1) * 0.05 sklearn_gp = GaussianProcessRegressor(); sklearn_gp.fit(X, Y); ``` -------------------------------- ### IBaseGaussianProcess Interface Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.html Interface for base Gaussian Process models used in quadrature. ```APIDOC ## IBaseGaussianProcess ### Description Interface for base Gaussian Process models. ### Methods - `observation_noise_variance`: The observation noise variance. - `predict_with_full_covariance()`: Predicts the mean and full covariance. - `solve_linear()`: Solves a linear system. - `graminv_residual()`: Computes the residual of the Gram matrix inverse. - `get_prediction_gradients()`: Computes gradients of the prediction. ``` -------------------------------- ### ProductMatern32GPy Source: https://emukit.readthedocs.io/en/latest/api/emukit.model_wrappers.html Wrapper for GPy's Matern32 product kernel. This class is designed for EmuKit quadrature methods and supports initialization with either a GPy kernel object or by specifying lengthscales and variance. It provides methods for kernel evaluation and gradient calculation. ```APIDOC ## class emukit.model_wrappers.gpy_quadrature_wrappers.ProductMatern32GPy ### Description Wrapper of the GPy Matern32 product kernel as required for some EmuKit quadrature methods. The product kernel is of the form k(x,x′)=σ2∏i=1dki(x,x′) where ki(x,x′)=(1+3ri)e−3ri. d is the input dimensionality, ri:=|xi−xi′|λi, σ2 is the `variance` property and λi is the i th element of the `lengthscales` property. ### Parameters * **gpy_matern** (`Union`[`Matern32`, `Prod`, `None`]) – A Matern32 product kernel from GPy. For d=1 this is equivalent to a Matern32 kernel. For d>1, this is _not_ a d-dimensional Matern32 kernel but a product of d 1-dimensional Matern32 kernels with differing active dimensions constructed as k1 * k2 * … . Make sure to unlink all variances except the variance of the first kernel k1 in the product as the variance of k1 will be used to represent σ2. If you are unsure what to do, use the `lengthscales` and `variance` parameter instead. If `gpy_matern` is not given, the `lengthscales` argument is used. * **lengthscales** (`Optional`[`ndarray`]) – If `gpy_matern` is not given, a product Matern32 kernel will be constructed with the given lengthscales. The number of elements need to be equal to the dimensionality d. If `gpy_matern` is given, this input is disregarded. * **variance** (`Optional`[`float`]) – The variance of the product kernel. Only used if `gpy_matern` is not given. Defaults to 1. ### Properties * **lengthscales** (`ndarray`) – The lengthscales λ of the kernel. * **variance** (`float`) – The scale σ2 of the kernel. ### Methods #### K(x1, x2) Evaluates the kernel k(x1, x2) at x1 and x2. Parameters: * **x1** (`ndarray`) – First argument of the kernel, shape (n_points N, input_dim) * **x2** (`ndarray`) – Second argument of the kernel, shape (n_points M, input_dim) Returns: `ndarray` – Kernel evaluated at x1, x2, shape (N, M). #### dK_dx1(x1, x2) Computes the gradient of the kernel with respect to x1 evaluated at pair x1, x2. Parameters: * **x1** (`ndarray`) – First argument of the kernel, shape (n_points N, input_dim) * **x2** (`ndarray`) – Second argument of the kernel, shape (n_points M, input_dim) Returns: `ndarray` – The gradient of the kernel wrt x1 evaluated at (x1, x2), shape (input_dim, N, M). ``` -------------------------------- ### emukit.core.optimization Source: https://emukit.readthedocs.io/en/latest/api/emukit.core.html Provides algorithms and utilities for optimizing acquisition functions. ```APIDOC ## AcquisitionOptimizerBase ### Description Base class for acquisition function optimizers. ### Methods - `optimize()`: Optimizes the acquisition function. ``` ```APIDOC ## AnchorPointsGenerator ### Description Generates anchor points for optimization. ### Methods - `get_anchor_point_scores()`: Computes scores for anchor points. - `get()`: Retrieves anchor points. ``` ```APIDOC ## ObjectiveAnchorPointsGenerator ### Description Generates anchor points based on objective function values. ### Methods - `get_anchor_point_scores()`: Computes scores for anchor points. ``` ```APIDOC ## ContextManager ### Description Manages context for optimization. ### Methods - `expand_vector()`: Expands a vector with context. ``` ```APIDOC ## GradientAcquisitionOptimizer ### Description Optimizer that uses gradients to find the maximum of the acquisition function. ``` ```APIDOC ## LocalSearchAcquisitionOptimizer ### Description Performs local search to optimize the acquisition function. ``` ```APIDOC ## MultiSourceAcquisitionOptimizer ### Description Optimizes acquisition functions from multiple sources. ### Methods - `optimize()`: Optimizes the acquisition function. ``` ```APIDOC ## Optimizer ### Description Generic optimizer class. ### Methods - `optimize()`: Optimizes a function. ``` ```APIDOC ## OptLbfgs ### Description L-BFGS optimizer. ### Methods - `optimize()`: Optimizes a function using L-BFGS. ``` ```APIDOC ## apply_optimizer() ### Description Applies a specified optimizer to a function. ``` ```APIDOC ## OptimizationWithContext ### Description Handles optimization with contextual information. ### Methods - `f_no_context()`: Objective function without context. - `df_no_context()`: Gradient of the objective function without context. - `f_df_no_context()`: Objective function and its gradient without context. ``` ```APIDOC ## OptTrustRegionConstrained ### Description Trust region constrained optimizer. ### Methods - `optimize()`: Optimizes a function with trust region constraints. ``` ```APIDOC ## RandomSearchAcquisitionOptimizer ### Description Performs random search to optimize the acquisition function. ``` -------------------------------- ### emukit.model_wrappers.ProductMatern52GPy Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Product Matern 5/2 kernel for GPy models. ```APIDOC ## ProductMatern52GPy ### Description Represents a product of Matern 5/2 kernels for GPy models. ### Properties - `lengthscales`: The lengthscales of the Matern kernels. - `variance`: The variance of the Matern kernels. ``` -------------------------------- ### get_samples Source: https://emukit.readthedocs.io/en/latest/genindex.html Retrieves samples from an initial design or sampler. ```APIDOC ## Method: get_samples ### Description Retrieves samples. This method is part of the InitialDesignBase class and is also implemented in RandomDesign, AffineInvariantEnsembleSampler, and McmcSampler. ### Class emukit.core.initial_designs.base.InitialDesignBase ### Implementations - emukit.core.initial_designs.random_design.RandomDesign - emukit.samplers.mcmc_sampler.AffineInvariantEnsembleSampler - emukit.samplers.mcmc_sampler.McmcSampler ``` -------------------------------- ### IBaseGaussianProcess Interface Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Interface for base Gaussian process models. ```APIDOC ## IBaseGaussianProcess ### Description Interface defining the essential methods for a Gaussian process model. ### Properties #### `observation_noise_variance` The variance of the observation noise. ### Methods #### `predict_with_full_covariance(X)` Predicts the mean and full covariance of the output for given input points `X`. #### `solve_linear(A, b)` Solves a linear system `Ax = b`. #### `graminv_residual()` Computes the Gram matrix inverse residual. #### `get_prediction_gradients(X)` Computes the gradients of the predictions with respect to the input points `X`. ``` -------------------------------- ### SimpleGaussianProcessModel Methods Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Methods available for the SimpleGaussianProcessModel class, used for interacting with Gaussian process models. ```APIDOC ## SimpleGaussianProcessModel ### Description Represents a simple Gaussian Process model. ### Methods #### `optimize()` Optimizes the hyperparameters of the Gaussian process model. #### `predict(X)` Predicts the output values and their variances for given input points `X`. #### `set_data(X, Y)` Sets the training data for the Gaussian process model. ### Attributes #### `X` Training input data. #### `Y` Training output data. ``` -------------------------------- ### emukit.model_wrappers.GPyMultiOutputWrapper Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Wrapper for multi-output GPy models. ```APIDOC ## GPyMultiOutputWrapper ### Description A wrapper class for multi-output GPy models. ### Methods - `calculate_variance_reduction()`: Calculates the variance reduction. - `get_prediction_gradients(X)`: Computes the gradients of the prediction. - `predict(X)`: Predicts the output mean and variance. - `set_data(X, Y)`: Sets the training data. - `optimize()`: Optimizes the model hyperparameters. - `predict_covariance(X)`: Predicts the covariance matrix. - `get_covariance_between_points(X1, X2)`: Computes the covariance between two sets of points. - `generate_hyperparameters_samples()`: Generates samples from the hyperparameter posterior. - `fix_model_hyperparameters()`: Fixes the current model hyperparameters. ### Properties - `X`: Training inputs. - `Y`: Training outputs. ``` -------------------------------- ### MultiSourceAcquisitionOptimizer.optimize Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Optimizes the acquisition function using MultiSourceAcquisitionOptimizer. ```APIDOC ## MultiSourceAcquisitionOptimizer.optimize() ### Description Optimizes the acquisition function using MultiSourceAcquisitionOptimizer. ### Method Not specified (assumed to be a method call within a Python context). ### Parameters None explicitly defined in the source. ### Request Example ```python multi_source_acquisition_optimizer_instance.optimize() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### Product Methods Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Methods available for the Product class. ```APIDOC ## Product ### Methods - `evaluate()` - `evaluate_with_gradients()` - `has_gradients` ``` -------------------------------- ### VanillaBayesianQuadrature Methods Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.html Documentation for the VanillaBayesianQuadrature class, a standard implementation of Bayesian Quadrature. ```APIDOC ## VanillaBayesianQuadrature ### Description A standard implementation of Bayesian Quadrature without specific warping. ### Methods - **`predict_base(X)`** - Description: Predicts the mean of the function at the given points using the base model. - Parameters: - `X` (array-like): Points at which to predict. - Returns: Mean prediction. - **`predict_base_with_full_covariance(X)`** - Description: Predicts the mean and full covariance of the function at the given points using the base model. - Parameters: - `X` (array-like): Points at which to predict. - Returns: Mean and full covariance prediction. - **`integrate()`** - Description: Computes the integral of the function using the Bayesian Quadrature model. - Returns: The estimated integral value. - **`get_prediction_gradients(X)`** - Description: Computes the gradients of the prediction at the given points. - Parameters: - `X` (array-like): Points at which to compute gradients. - Returns: Prediction gradients. ``` -------------------------------- ### WSABILLoop Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.html Implements the WSA-BI loop for Bayesian quadrature. ```APIDOC ## WSABILLoop ### Description WSA-BI loop for Bayesian quadrature. ``` -------------------------------- ### create_emukit_model_from_gpy_model Source: https://emukit.readthedocs.io/en/latest/api/emukit.model_wrappers.html Wraps a GPy model to create an EmuKit quadrature model, facilitating integration with EmuKit's quadrature methods. ```APIDOC ## emukit.model_wrappers.gpy_quadrature_wrappers.create_emukit_model_from_gpy_model ### Description Wraps a GPy model and returns an EmuKit quadrature model. ### Parameters - **gpy_model** (GPy Model) - The GPy model to wrap. - **integral_bounds** (Optional[Tuple[float, float]]) - The bounds for the integral. - **measure** (Optional[Measure]) - The measure for the integral. - **integral_name** (str) - The name of the integral. Defaults to ''. ``` -------------------------------- ### ProductMatern12GPy Source: https://emukit.readthedocs.io/en/latest/api/emukit.model_wrappers.html Wrapper for the GPy Exponential (Matern12) product kernel, used in EmuKit quadrature methods. ```APIDOC ## class _emukit.model_wrappers.gpy_quadrature_wrappers.ProductMatern12GPy(_gpy_matern =None_, _lengthscales =None_, _variance =None_) ### Description Wrapper of the GPy Exponential (a.k.a Matern12) product kernel as required for some EmuKit quadrature methods. The product kernel is of the form k(x,x′)=σ2∏i=1dki(x,x′) where ki(x,x′)=e−ri. d is the input dimensionality, ri:=|xi−xi′|λi, σ2 is the `variance` property and λi is the i th element of the `lengthscales` property. ### Parameters * **gpy_matern** (`Union`[`Exponential`, `Prod`, `None`]) – An Exponential (a.k.a. Matern12) product kernel from GPy. For d=1 this is equivalent to an Exponential kernel. For d>1, this is _not_ a d-dimensional Exponential kernel but a product of d 1-dimensional Exponential kernels with differing active dimensions constructed as k1 * k2 * … . Make sure to unlink all variances except the variance of the first kernel k1 in the product as the variance of k1 will be used to represent σ2. If you are unsure what to do, use the `lengthscales` and `variance` parameter instead. If `gpy_matern` is not given, the `lengthscales` argument is used. ``` -------------------------------- ### InitialDesignBase.get_samples Source: https://emukit.readthedocs.io/en/latest/api/emukit.core.initial_designs.html Generates a specified number of sample points within the parameter space. This is a base method intended to be implemented by subclasses. ```APIDOC ## InitialDesignBase.get_samples ### Description Generates requested amount of points. ### Parameters #### Path Parameters - **point_count** (int) - Required - Number of points required. ### Response #### Success Response (200) - **samples** (ndarray) - A numpy array of generated samples, shape (point_count x space_dim) ``` -------------------------------- ### QuadratureProductMatern32 Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.html Product of Matern 3/2 kernels for quadrature. ```APIDOC ## QuadratureProductMatern32 ### Description Product of Matern 3/2 kernels for quadrature. ### Methods - `nu`: The smoothness parameter nu. - `lengthscales`: The lengthscales of the Matern 3/2 kernel. - `variance`: The variance of the Matern 3/2 kernel. ``` -------------------------------- ### ProductMatern52GPy Source: https://emukit.readthedocs.io/en/latest/api/emukit.model_wrappers.html Wrapper for GPy's Matern52 product kernel. This class is designed for EmuKit quadrature methods and supports initialization with either a GPy kernel object or by specifying lengthscales and variance. It provides methods for kernel evaluation and gradient calculation. ```APIDOC ## class emukit.model_wrappers.gpy_quadrature_wrappers.ProductMatern52GPy ### Description Wrapper of the GPy Matern52 product kernel as required for some EmuKit quadrature methods. The product kernel is of the form k(x,x′)=σ2∏i=1dki(x,x′) where ki(x,x′)=(1+5ri+53ri2)exp⁡(−5ri). d is the input dimensionality, ri:=|xi−xi′|λi, σ2 is the `variance` property and λi is the i th element of the `lengthscales` property. ### Parameters * **gpy_matern** (`Union`[`Matern52`, `Prod`, `None`]) – A Matern52 product kernel from GPy. For d=1 this is equivalent to a Matern52 kernel. For d>1, this is _not_ a d-dimensional Matern52 kernel but a product of d 1-dimensional Matern52 kernels with differing active dimensions constructed as k1 * k2 * … . Make sure to unlink all variances except the variance of the first kernel k1 in the product as the variance of k1 will be used to represent σ2. If you are unsure what to do, use the `lengthscales` and `variance` parameter instead. If `gpy_matern` is not given, the `lengthscales` argument is used. * **lengthscales** (`Optional`[`ndarray`]) – If `gpy_matern` is not given, a product Matern52 kernel will be constructed with the given lengthscales. The number of elements need to be equal to the dimensionality d. If `gpy_matern` is given, this input is disregarded. * **variance** (`Optional`[`float`]) – The variance of the product kernel. Only used if `gpy_matern` is not given. Defaults to 1. ### Properties * **lengthscales** (`ndarray`) – The lengthscales λ of the kernel. * **variance** (`float`) – The scale σ2 of the kernel. ### Methods #### K(x1, x2) Evaluates the kernel k(x1, x2) at x1 and x2. Parameters: * **x1** (`ndarray`) – First argument of the kernel, shape (n_points N, input_dim) * **x2** (`ndarray`) – Second argument of the kernel, shape (n_points M, input_dim) Returns: `ndarray` – Kernel evaluated at x1, x2, shape (N, M). #### dK_dx1(x1, x2) Computes the gradient of the kernel with respect to x1 evaluated at pair x1, x2. Parameters: * **x1** (`ndarray`) – First argument of the kernel, shape (n_points N, input_dim) * **x2** (`ndarray`) – Second argument of the kernel, shape (n_points M, input_dim) Returns: `ndarray` – The gradient of the kernel wrt x1 evaluated at (x1, x2), shape (input_dim, N, M). ``` -------------------------------- ### AcquisitionOptimizerBase.optimize Source: https://emukit.readthedocs.io/en/latest/api/emukit.core.optimization.html Abstract method to optimize the acquisition function. Subclasses must implement the specific optimization logic. ```APIDOC ## optimize ### Description Optimizes the acquisition function. ### Parameters * **acquisition** (Acquisition) – The acquisition function to be optimized * **context** (Optional[Dict[str, Any]]) – Optimization context. Determines whether any variable values should be fixed during the optimization ### Returns Tuple of (location of maximum, acquisition value at maximizer) ``` -------------------------------- ### QuadratureKernel Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.html Kernel function for quadrature. ```APIDOC ## QuadratureKernel ### Description Kernel function for quadrature. ### Methods - `K()`: Computes the kernel matrix. - `qK()`: Computes the quadrature kernel. - `Kq()`: Computes the kernel matrix with a query point. - `qKq()`: Computes the quadrature kernel with query points. - `dK_dx1()`: Computes the gradient of the kernel with respect to the first input. - `dK_dx2()`: Computes the gradient of the kernel with respect to the second input. - `dKdiag_dx()`: Computes the gradient of the diagonal of the kernel matrix. - `dqK_dx()`: Computes the gradient of the quadrature kernel. - `dKq_dx()`: Computes the gradient of the kernel with respect to the query point. ``` -------------------------------- ### OptimizationWithContext Class Source: https://emukit.readthedocs.io/en/latest/api/emukit.core.optimization.html Handles optimization objectives that involve context variables, providing wrappers to manage context addition. ```APIDOC ## class emukit.core.optimization.optimizer.OptimizationWithContext(x0, f_, df=None, f_df=None, context_manager=None) ### Description Handles optimization objectives that involve context variables. ### Methods #### f_no_context(x) ##### Parameters * **x** (`ndarray`) – Input without context variables ##### Return type `ndarray` #### df_no_context(x) ##### Parameters * **x** (`ndarray`) – Input without context variables ##### Return type `ndarray` #### f_df_no_context(x) ##### Parameters * **x** (`ndarray`) – Input without context variables ##### Return type `Tuple`[`ndarray`, `ndarray`] ``` -------------------------------- ### emukit.core.acquisition Source: https://emukit.readthedocs.io/en/latest/api/emukit.core.html Provides base classes and implementations for acquisition functions used in Bayesian optimization. ```APIDOC ## Acquisition ### Description Base class for acquisition functions. ### Methods - `evaluate()`: Evaluates the acquisition function. - `evaluate_with_gradients()`: Evaluates the acquisition function and its gradients. - `update_parameters()`: Updates the parameters of the acquisition function. ### Properties - `has_gradients` (bool): Whether the acquisition function provides gradients. ``` ```APIDOC ## Quotient ### Description Acquisition function that computes the quotient of two other acquisition functions. ### Methods - `evaluate()`: Evaluates the acquisition function. - `evaluate_with_gradients()`: Evaluates the acquisition function and its gradients. - `update_parameters()`: Updates the parameters of the acquisition function. ### Properties - `has_gradients` (bool): Whether the acquisition function provides gradients. ``` ```APIDOC ## Product ### Description Acquisition function that computes the product of two other acquisition functions. ### Methods - `evaluate()`: Evaluates the acquisition function. - `evaluate_with_gradients()`: Evaluates the acquisition function and its gradients. - `update_parameters()`: Updates the parameters of the acquisition function. ### Properties - `has_gradients` (bool): Whether the acquisition function provides gradients. ``` ```APIDOC ## Sum ### Description Acquisition function that computes the sum of two other acquisition functions. ### Methods - `evaluate()`: Evaluates the acquisition function. - `evaluate_with_gradients()`: Evaluates the acquisition function and its gradients. - `update_parameters()`: Updates the parameters of the acquisition function. ### Properties - `has_gradients` (bool): Whether the acquisition function provides gradients. ``` ```APIDOC ## acquisition_per_expected_cost() ### Description Calculates the acquisition per expected cost. ``` ```APIDOC ## CostAcquisition ### Description Base class for acquisition functions that consider cost. ### Methods - `evaluate()`: Evaluates the acquisition function. - `evaluate_with_gradients()`: Evaluates the acquisition function and its gradients. ### Properties - `has_gradients` (bool): Whether the acquisition function provides gradients. ``` ```APIDOC ## IntegratedHyperParameterAcquisition ### Description Acquisition function that integrates over hyperparameter distributions. ### Methods - `evaluate()`: Evaluates the acquisition function. - `evaluate_with_gradients()`: Evaluates the acquisition function and its gradients. - `update_parameters()`: Updates the parameters of the acquisition function. - `update_batches()`: Updates the batches for hyperparameter integration. ### Properties - `has_gradients` (bool): Whether the acquisition function provides gradients. ``` -------------------------------- ### emukit.core.ParameterSpace Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Defines a space of parameters for experiments. ```APIDOC ## ParameterSpace ### Description Represents a space of parameters, defining the search domain for experiments. ### Methods - `find_parameter_index_in_model(parameter_name)`: Finds the index of a parameter in the model. - `get_parameter_by_name(parameter_name)`: Retrieves a parameter object by its name. - `get_bounds()`: Returns the bounds of all parameters. - `round(X)`: Rounds the given points `X` to the nearest valid values within the parameter space. - `check_points_in_domain(X)`: Checks if the given points `X` are within the domain of the parameter space. - `sample_uniform(num_samples)`: Samples uniformly from the parameter space. ### Properties - `dimensionality`: The total number of dimensions in the parameter space. - `parameters`: A list of parameter objects in the space. - `parameter_names`: A list of names of the parameters. ``` -------------------------------- ### LocalPenalizationPointCalculator Methods Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Methods available for the LocalPenalizationPointCalculator class. ```APIDOC ## LocalPenalizationPointCalculator ### Methods - `compute_next_points()` ``` -------------------------------- ### AcquisitionOptimizerBase.optimize Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Optimizes the acquisition function using AcquisitionOptimizerBase. ```APIDOC ## AcquisitionOptimizerBase.optimize() ### Description Optimizes the acquisition function using AcquisitionOptimizerBase. ### Method Not specified (assumed to be a method call within a Python context). ### Parameters None explicitly defined in the source. ### Request Example ```python acquisition_optimizer_base_instance.optimize() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### QuadratureKernel Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.kernels.html Abstract base class for a kernel augmented with integrability. Specific implementations require a standard kernel inheriting from IStandardKernel and an IntegrationMeasure. ```APIDOC ## Class QuadratureKernel ### Description Abstract class for a kernel augmented with integrability. Each specific implementation of this class must go with a specific standard kernel as input which inherits from `IStandardKernel`. This is because we both want the `QuadratureKernel` to be backend agnostic but at the same time `QuadratureKernel` needs access to specifics of the standard kernel. For example a specific pair of `QuadratureKernel` and `IStandardKernel` is `QuadratureRBF` and `IRBF`. The kernel embeddings are implemented w.r.t. a specific integration measure, for example the `LebesgueMeasure`. ### Parameters * **kern** (`IStandardKernel`) – Standard EmuKit kernel. * **measure** (`IntegrationMeasure`) – The integration measure. * **variable_names** (`str`) – The (variable) name(s) of the integral. ### Methods #### K(x1, x2) The kernel k(x1, x2) evaluated at x1 and x2. Parameters: * **x1** (`ndarray`) – First argument of the kernel. * **x2** (`ndarray`) – Second argument of the kernel. Returns: * `ndarray` – The kernel at x1, x2. #### qK(x2) The kernel with the first argument integrated out (kernel mean) evaluated at x2. Parameters: * **x2** (`ndarray`) – The locations where the kernel mean is evaluated, shape (n_points, input_dim). Returns: * `ndarray` – The kernel mean at x2, shape (1, n_points). #### Kq(x1) The kernel with the second argument integrated out (kernel mean) evaluated at x1. Parameters: * **x1** (`ndarray`) – The locations where the kernel mean is evaluated, shape (n_points, input_dim). Returns: * `ndarray` – The kernel mean at x1, shape (n_points, 1). #### qKq() The kernel integrated over both arguments x1 and x2. Returns: * `float` – Double integrated kernel. #### dK_dx1(x1, x2) The gradient of the kernel wrt x1 evaluated at pair x1, x2. Parameters: * **x1** (`ndarray`) – First argument of the kernel, shape (n_points N, input_dim). * **x2** (`ndarray`) – Second argument of the kernel, shape (n_points M, input_dim). Returns: * `ndarray` – The gradient at (x1, x2), shape (input_dim, N, M). #### dK_dx2(x1, x2) The gradient of the kernel wrt x2 evaluated at pair x1, x2. Note that this is equal to the transposed gradient of the kernel wrt x1 evaluated at x2 and x1 (swapped arguments). Parameters: * **x1** (`ndarray`) – First argument of the kernel, shape (n_points N, N, input_dim). * **x2** (`ndarray`) – Second argument of the kernel, shape (n_points N, M, input_dim). Returns: * `ndarray` – The gradient at (x1, x2), shape (input_dim, N, M). #### dKdiag_dx(x) The gradient of the diagonal of the kernel v(x):=k(x,x) evaluated at x. Parameters: * **x** (`ndarray`) – The locations where the gradient is evaluated, shape = (n_points M, input_dim). Returns: * `ndarray` – The gradient at x, shape (input_dim, M). #### dqK_dx(x2) The gradient of the kernel mean (integrated in first argument) evaluated at x2. Parameters: * **x2** (`ndarray`) – The locations where the gradient is evaluated, shape (n_points N, N, input_dim). Returns: * `ndarray` – The gradient at x2, shape (input_dim, N). #### dKq_dx(x1) The gradient of the kernel mean (integrated in second argument) evaluated at x1. Parameters: * **x1** (`ndarray`) – The locations where the gradient is evaluated, shape (n_points N, N, input_dim). Returns: * `ndarray` – The gradient with shape (N, input_dim). ``` -------------------------------- ### IStandardKernel Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.interfaces.html Interface for a standard kernel k(x, x') that in principle can be integrated. ```APIDOC ## class emukit.quadrature.interfaces.IStandardKernel ### Description Interface for a standard kernel k(x, x’) that in principle can be integrated. See also * `emukit.quadrature.interfaces.IRBF` * `emukit.quadrature.interfaces.IProductMatern52` * `emukit.quadrature.interfaces.IProductMatern32` * `emukit.quadrature.interfaces.IProductBrownian` ### Methods #### K The kernel k(x1, x2) evaluated at x1 and x2. Parameters: * **x1** (`ndarray`) – First argument of the kernel, shape (n_points N, input_dim) * **x2** (`ndarray`) – Second argument of the kernel, shape (n_points M, input_dim) Returns: `ndarray` – Kernel evaluated at x1, x2, shape (N, M). #### dK_dx1 Gradient of the kernel wrt x1 evaluated at pair x1, x2. Parameters: * **x1** (`ndarray`) – First argument of the kernel, shape (n_points N, input_dim) * **x2** (`ndarray`) – Second argument of the kernel, shape (n_points M, input_dim) Returns: `ndarray` – The gradient of the kernel wrt x1 evaluated at (x1, x2), shape (input_dim, N, M). #### dKdiag_dx The gradient of the diagonal of the kernel (the variance) v(x):=k(x, x) evaluated at x. Parameters: * **x** (`ndarray`) – The locations where the gradient is evaluated, shape (n_points, input_dim). Returns: `ndarray` – The gradient of the diagonal of the kernel evaluated at x, shape (input_dim, n_points). ``` -------------------------------- ### WSABIL Methods Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.html Documentation for the WSABIL class, likely related to warping and Bayesian integration. ```APIDOC ## WSABIL ### Description Class related to Warping and Bayesian Integration, potentially for specific algorithms. ### Methods - **`compute_warping_params()`** - Description: Computes the parameters for the warping transformation. ``` -------------------------------- ### QuadratureProductMatern32 Source: https://emukit.readthedocs.io/en/latest/api/emukit.quadrature.kernels.html Represents a product Matern32 kernel augmented with integrability. This class is compatible with the standard kernel IProductMatern32 and embeds the kernel with respect to a specific integration measure. ```APIDOC ## Class: QuadratureProductMatern32 ### Description Base class for a product Matern32 kernel augmented with integrability. The kernel is of the form k(x,x′)=σ2∏i=1dki(x,x′) where ki(x,x′)=(1+3ri)e−3ri. Above, d is the input dimensionality, ri=|xi−xi′|λi, is the scaled distance, σ2 is the `variance` property and λi is the i th element of the `lengthscales` property. ### Parameters * **matern_kernel** (`IProductMatern32`) – The standard EmuKit product Matern32 kernel. * **measure** (`IntegrationMeasure`) – The integration measure. * **variable_names** (`str`) – The (variable) name(s) of the integral. ### Properties * **nu** (`float`) – The smoothness parameter of the kernel. * **lengthscales** (`ndarray`) – The lengthscales λ of the kernel. * **variance** (`float`) – The scale σ2 of the kernel. ``` -------------------------------- ### emukit.core.Parameter Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Base class for parameters. ```APIDOC ## Parameter ### Description Base class for defining parameters in a parameter space. ### Methods - `round(x)`: Rounds a value `x` to a valid representation for this parameter. - `check_in_domain(x)`: Checks if a value `x` is within the domain of this parameter. - `sample_uniform(num_samples)`: Samples uniformly from the domain of this parameter. ### Properties - `dimension`: The dimensionality of the parameter. - `model_parameters`: Parameters relevant to the model. - `bounds`: The bounds of the parameter. ``` -------------------------------- ### IStandardKernel Interface Source: https://emukit.readthedocs.io/en/latest/api/emukit.html Interface for standard kernels. ```APIDOC ## IStandardKernel ### Description Interface for standard kernel functions. ### Methods #### `K(X1, X2)` Computes the kernel matrix between two sets of points `X1` and `X2`. #### `dK_dx1(X1, X2)` Computes the gradient of the kernel matrix with respect to the first set of points `X1`. #### `dKdiag_dx(X)` Computes the gradient of the diagonal of the kernel matrix with respect to the input points `X`. ``` -------------------------------- ### IConstraint Source: https://emukit.readthedocs.io/en/latest/api/emukit.core.html Abstract base class for constraints. Subclasses must implement the evaluate method. ```APIDOC ## class emukit.core.constraints.IConstraint ### Description Abstract base class for constraints. Subclasses must implement the evaluate method. ### Methods - **evaluate(x)**: Evaluates the constraint at given input locations. ### Parameters - **x** (ndarray): Array of shape (n_points x n_dims) containing input locations to evaluate constraint at. ```