qpots.utils.utils
This module contains utility functions for multi-objective Bayesian optimization.
Functions
- qpots.utils.utils.unstandardize(Y: Tensor, train_y: Tensor) Tensor[source]
Reverse the standardization of output Y using the mean and standard deviation computed from the training data.
- Parameters:
Y (torch.Tensor) – The standardized output tensor.
train_y (torch.Tensor) – The training output data used to compute the mean and standard deviation.
- Returns:
The unstandardized output tensor.
- Return type:
torch.Tensor
- qpots.utils.utils.expected_hypervolume(gps: ModelObject, ref_point: Tensor = tensor([-300., -18.]), min: bool = False) Tuple[float, Tensor][source]
Compute the expected hypervolume and Pareto front based on GP model predictions.
- Parameters:
gps (ModelObject) – The multi-objective GP models.
ref_point (torch.Tensor, optional) – Reference point for hypervolume calculation.
min (bool, optional) – If True, minimizes the objectives instead of maximizing them.
- Returns:
hypervolume_value (float): The computed hypervolume.
pareto_front (torch.Tensor): The Pareto front tensor.
- Return type:
tuple
- qpots.utils.utils.gen_filtered_cands(gps: ModelObject, cands: Tensor, ref_point: Tensor = tensor([0., 0.]), kernel_bandwidth: float = 0.05) Tensor[source]
Generate filtered candidate points based on the current Pareto front using Kernel Density Estimation (KDE).
- Parameters:
gps (ModelObject) – The multi-objective GP models.
cands (torch.Tensor) – Candidate points to filter.
ref_point (torch.Tensor, optional) – Reference point for the Pareto front.
kernel_bandwidth (float, optional) – Bandwidth for the KDE filter.
- Returns:
Filtered candidate points.
- Return type:
torch.Tensor
- qpots.utils.utils.select_candidates(gps: ModelObject, pareto_set: ndarray, device: device, q: int = 1, seed: int | None = None) Tensor[source]
Select candidates from the Pareto-optimal set.
- Parameters:
gps (ModelObject) – Gaussian Process models.
pareto_set (numpy.ndarray) – Pareto-optimal set of solutions.
device (torch.device) – Device to store the selected candidates.
q (int, optional) – Number of candidates to select. Defaults to 1.
seed (int, optional) – Random seed for sampling.
- Returns:
Selected candidate points.
- Return type:
torch.Tensor
- qpots.utils.utils.arg_parser()[source]
Parses command-line arguments for the multi-objective Bayesian optimization script.
This function provides default values for each argument, allowing customization for different optimization setups, including high-performance computing (HPC) environments.
- Returns:
Parsed command-line arguments.
- Return type:
argparse.Namespace