qpots.acquisition
- class qpots.acquisition.Acquisition(func: Function, gps: ModelListGP, cons: Callable | None = None, device: device = device(type='cpu'), q: int = 1, NUM_RESTARTS: int = 10, RAW_SAMPLES: int = 512)[source]
Bases:
objectA class providing various acquisition functions and methods for multi-objective optimization.
- __init__(func: Function, gps: ModelListGP, cons: Callable | None = None, device: device = device(type='cpu'), q: int = 1, NUM_RESTARTS: int = 10, RAW_SAMPLES: int = 512) None[source]
Initialize the multi-objective acquisition class.
This class provides various acquisition functions for multi-objective Bayesian optimization. It supports Gaussian Process models and handles inequality constraints if provided.
- Parameters:
func (Function) – The test function being optimized.
gps (ModelListGP) – A list of Gaussian Process models used for Bayesian optimization.
cons (Optional[Callable], optional) – A vector-valued function representing inequality constraints. If provided, the acquisition function will account for feasibility constraints.
device (torch.device, optional) – The computational device to use (CPU or GPU). Defaults to
torch.device("cpu").q (int, optional) – The number of candidate points to sample per iteration. Defaults to 1.
NUM_RESTARTS (int, optional) – The number of restarts for optimizing the acquisition function. A higher value can improve optimization quality. Defaults to 10.
RAW_SAMPLES (int, optional) – The number of raw samples used in acquisition optimization. Higher values increase exploration but may slow computation. Defaults to 512.
- jesmo() Tensor[source]
Perform Joint Entropy Search for Multi-Objective optimization (JESMO).
JESMO is an acquisition function that uses joint entropy search to efficiently explore the Pareto frontier in multi-objective Bayesian optimization.
- Returns:
A tensor containing the candidate points generated by JESMO.
- Return type:
Tensor
- mesmo() Tensor[source]
Perform Multi-Objective Max-Value Entropy Search (MESMO).
- Returns:
A tensor containing the candidate points selected by MESMO.
- Return type:
Tensor
- parego() Tensor[source]
Perform qParEGO optimization using random weights for scalarization.
- Returns:
A tensor containing the new candidate points selected based on qParEGO optimization.
- Return type:
Tensor
- pesmo() Tensor[source]
Perform Predictive Entropy Search for Multi-Objective optimization (PESMO).
- Returns:
A tensor containing the candidate points selected by PESMO.
- Return type:
Tensor
- qlogei(ref_point: Tensor = tensor([0., 0.])) Tensor[source]
Optimize the qLogEI acquisition function and return new candidate points.
- Parameters:
ref_point (Tensor, optional) – The reference point for hypervolume calculation, typically representing a baseline for performance. Defaults to
[0.0, 0.0].- Returns:
A tensor containing the new candidate points selected based on qLogEI optimization.
- Return type:
Tensor
- qlogparego() Tensor[source]
Perform qParEGO optimization using qNParEGO from BoTorch.
- Returns:
A tensor containing the candidate points selected based on qParEGO optimization.
- Return type:
Tensor
- qpots(bounds: Tensor, iteration: int, **kwargs) Tensor[source]
Perform Pareto Optimal Thompson Sampling (qPOTS).
- Parameters:
bounds (Tensor) – A tensor representing the lower and upper bounds for the optimization problem.
iteration (int) – The current iteration index, used for seeding randomness.
**kwargs (dict) –
Additional arguments for customization, including:
nystrom(int): Whether to use the Nystrom approximation (1 for yes, 0 for no).iters(int): Number of iterations for approximation.nychoice(str): Column selection method for the Nystrom approximation.dim(int): Dimensionality of the problem.ngen(int): Number of generations for NSGA-II optimization.q(int): Number of candidates to select.
- Returns:
A tensor containing the selected candidate points after Pareto Optimal Thompson Sampling.
- Return type:
Tensor
- sobol() Tensor[source]
Generate random Sobol sequence samples.
- Returns:
A tensor of randomly generated candidate points using the Sobol sequence.
- Return type:
Tensor
- tsemo(save_dir: str, iters: int, ref_point: Tensor, train_shape: int, rep: int = 0)[source]
Perform Thompson Sampling Efficient Multiobjective Optimization (TS-EMO).
- Parameters:
save_dir (str) – The directory to save the TS-EMO results.
iters (int) – How many iterations TS-EMO should run for.
ref_point (Tensor) – The reference point for the hypervolume calculation.
train_shape (int) – The shape for determining the size of bounds.
rep (int, optional) – The repetition of the experiment. Defaults to 0.
- Returns:
x (np.ndarray) – The inputs of the function chosen by TS-EMO.
y (np.ndarray) – The outputs of the function for each input.
times (np.ndarray) – The time that each iteration takes.
hv (list) – The list of the hypervolume at each iteration.
pf (Tensor) – The Pareto frontier determined by TS-EMO.