vopy.acquisition
- class vopy.acquisition.AcquisitionStrategy
Abstract class for acquisition functions.
Acquisiton Strategies
SumVarianceAcquisition
- class vopy.acquisition.SumVarianceAcquisition(model: Model)
Acquisition function that returns the sum of variances of the objectives assuming independent objectives, i.e., trace of covariance matrix.
- Parameters:
model (Model) – Model to be used for predictions.
- forward(x: numpy.ndarray) numpy.ndarray
Compute the sum of variances of the objectives at the given points.
- Parameters:
x (np.ndarray) – Points to evaluate the acquisition function.
- Returns:
Trace of the covariance matrices at the given points.
- Return type:
np.ndarray
MaxDiagonalAcquisition
- class vopy.acquisition.MaxDiagonalAcquisition(design_space: DiscreteDesignSpace)
Calculates the length of the diagonals for each point given. Diagonal means the maximum distance inside the confidence region. It needs the design space to be a DiscreteDesignSpace in order to e confidence regions.
- Parameters:
design_space (DiscreteDesignSpace) – Design space to take confidence regions from.
- forward(x: numpy.ndarray) numpy.ndarray
Compute the diameter of the confidence region at the given points.
- Parameters:
x (np.ndarray) – Points to evaluate the acquisition function.
- Returns:
Length of the diagonals of the confidence regions at the given points.
- Return type:
np.ndarray
Decoupled Acquisiton Strategies
- class vopy.acquisition.DecoupledAcquisitionStrategy(output_dim: int, evaluation_index: int | None = None, costs: list | None = None)
Abstract class for decoupled settings. Acquisition values are inversely weighted by costs.
- Parameters:
output_dim (int) – Number of objectives.
evaluation_index (Optional[int]) – Index of the objective to be evaluated.
costs (Optional[list]) – Costs of evaluating each objective.
MaxVarianceDecoupledAcquisition
- class vopy.acquisition.MaxVarianceDecoupledAcquisition(model: ModelList, evaluation_index: int | None = None, costs: list | None = None)
Decoupled acquisition function that returns the maximum variance in a given objective.
- Parameters:
model (ModelList) – Model to be used for predictions.
evaluation_index (Optional[int]) – Index of the objective to be evaluated.
costs (Optional[list]) – Costs of evaluating each objective.
- forward(x: numpy.ndarray) numpy.ndarray
Compute the variance in a given objective at the given points.
- Parameters:
x (np.ndarray) – Points to evaluate the acquisition function.
- Returns:
Corresponding value of the diagonal of the covariance matrices at the given points.
- Return type:
np.ndarray
ThompsonEntropyDecoupledAcquisition
- class vopy.acquisition.ThompsonEntropyDecoupledAcquisition(model: ModelList, order: PolyhedralConeOrder, evaluation_index: int | None = None, costs: list | None = None, num_thompson_samples: int = 10)
A novel acquisition function that returns the expected entropy reduction of given points being in the Pareto set.
First, Thompson samples are drawn from the posterior distribution to identify the Pareto set. Then, the empirical frequencies of points being in the Pareto set are recorded to estimate the entropies. Finally, the mean empirical frequencies of points being in the Pareto set given their true value in the evaluation index are calculated to form the acquisition value.
Mathematically, the acquisition function is defined as:
\[\alpha_t^i (x) = \frac{H (X | \mathcal{D}_{t-1}) - \mathbb E_{y_i \sim GP^i_t(x)} [H (X | \mathcal{D}_{t-1}, y_i)]}{c_i},\]where
\[X = \mathbb{I} \{x \in P^*\}.\]- Parameters:
model (ModelList) – Model to be used for predictions.
order (Order) – Order object to be used for Pareto optimal calculation.
evaluation_index (Optional[int]) – Index of the objective to be evaluated.
costs (Optional[list]) – Costs of evaluating each objective.
num_thompson_samples (int) – Number of Thompson samples to draw.
- forward(x: numpy.ndarray) numpy.ndarray
Compute the expected entropy reduction of given points being in the Pareto set.
- Parameters:
x (np.ndarray) – Points to evaluate the acquisition function.
- Returns:
Expected entropy reductions of Pareto set caused by the given points.
- Return type:
np.ndarray
Utilities for Acquisiton Strategies
- vopy.acquisition.optimize_acqf_discrete(acq: AcquisitionStrategy, q: int, choices: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray]
Optimize the acquisition function over the given discrete choices.
- Parameters:
acq (AcquisitionStrategy) – Acquisition function to be optimized.
q (int) – Number of points to select, i.e., batch size.
choices (np.ndarray) – Choices to optimize the acquisition function over.
- Returns:
Tuple of selected points and their corresponding acquisition values.
- Return type:
Tuple[np.ndarray, np.ndarray]
- vopy.acquisition.optimize_decoupled_acqf_discrete(acq: DecoupledAcquisitionStrategy, q: int, choices: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray]
Optimize the decoupled acquisition function over the given discrete choices.
- Parameters:
acq (DecoupledAcquisitionStrategy) – Decoupled acquisition function to be optimized.
q (int) – Number of points to select, i.e., batch size.
choices (np.ndarray) – Choices to optimize the acquisition function over.
- Returns:
Tuple of selected points, their corresponding acquisition values and their corresponding objective indices to evaluate.