trieste.acquisition.multi_objective#
This folder contains multi-objective optimization utilities.
Submodules#
Package Contents#
- non_dominated(observations: trieste.types.TensorType) tuple[trieste.types.TensorType, trieste.types.TensorType] [source]#
Computes the non-dominated set for a set of data points. Based on: https://stackoverflow.com/questions/32791911/fast-calculation-of-pareto-front-in-python
If there are duplicate point(s) in the non-dominated set, this function will return as it is without removing the duplicate.
- Parameters:
observations – set of points with shape [N,D]
- Returns:
tf.Tensor of the non-dominated set [P,D] and a non-dominated point mask [N], P is the number of points in pareto front, the mask specifies whether each data point is non-dominated or not.
- class Pareto(observations: trieste.types.TensorType, already_non_dominated: bool = False)[source]#
A
Pareto
constructs a Pareto set. Stores a Pareto set and calculates hypervolume of the Pareto set given a specified reference point- Parameters:
observations – The observations for all objectives, with shape [N, D].
already_non_dominated – Whether the observations are already non dominated
- Raises:
ValueError (or InvalidArgumentError) – If
observations
has an invalid shape.
- hypervolume_indicator(reference: trieste.types.TensorType) trieste.types.TensorType [source]#
Calculate the hypervolume indicator based on self.front and a reference point The hypervolume indicator is the volume of the dominated region.
- Parameters:
reference – a reference point to use, with shape [D]. Defines the upper bound of the hypervolume. Should be equal or bigger than the anti-ideal point of the Pareto set. For comparing results across runs, the same reference point must be used.
- Returns:
hypervolume indicator, if reference point is less than all of the front in any dimension, the hypervolume indicator will be zero.
- Raises:
ValueError (or tf.errors.InvalidArgumentError) – If
reference
has an invalid shape.ValueError (or tf.errors.InvalidArgumentError) – If
self.front
is empty (which can happen if the concentration point is too strict so no frontier exists after the screening)
- sample_diverse_subset(sample_size: int, allow_repeats: bool = True, bounds_delta_scale_factor: float = 0.2, bounds_min_delta: float = 1e-09) tuple[trieste.types.TensorType, trieste.types.TensorType] [source]#
Sample a set of diverse points from the Pareto set using Hypervolume Sharpe-Ratio Indicator
- Parameters:
sample_size – The number of points to sample from the Pareto front
allow_repeats – Whether the sample may contain repeats
bounds_delta_scale_factor – The factor by which to grow the distance between extrema when calculating lower and upper bounds
bounds_min_delta – The minimum value of the distance between extrema
- Returns:
sample: Tensor of query points selected in the sample and sample_ids: Tensor of indices of points selected from the Pareto set
- get_reference_point(observations: trieste.types.TensorType) trieste.types.TensorType [source]#
Default reference point calculation method that calculates the reference point according to a Pareto front extracted from set of observations.
- Parameters:
observations – observations referred to calculate the reference point, with shape […, N, D]
- Returns:
a reference point to use, with shape […, D].
- Raises:
ValueError – If
observations
is empty
- class DividedAndConquerNonDominated(front: trieste.types.TensorType, threshold: trieste.types.TensorType | float = 0)[source]#
Bases:
_BoundIndexPartition
branch and bound procedure algorithm. a divide and conquer method introduced in [CDD12].
- Parameters:
front – non-dominated pareto front.
threshold – a threshold used to screen out cells in partition : when its volume is below this threshold, its rejected directly in order to be more computationally efficient, if setting above 0, this partition strategy tends to return an approximated partition.
- class ExactPartition2dNonDominated(front: trieste.types.TensorType)[source]#
Bases:
_BoundIndexPartition
Exact partition of non-dominated space, used as a default option when the objective number equals 2.
- Parameters:
front – non-dominated pareto front.
- prepare_default_non_dominated_partition_bounds(reference: trieste.types.TensorType, observations: trieste.types.TensorType | None = None, anti_reference: trieste.types.TensorType | None = None) tuple[trieste.types.TensorType, trieste.types.TensorType] [source]#
Prepare the default non-dominated partition boundary for acquisition function usage. This functionality will trigger different partition according to objective numbers, if objective number is 2, an ExactPartition2dNonDominated will be used. If the objective number is larger than 2, a DividedAndConquerNonDominated will be used.
- Parameters:
observations – The observations for all objectives, with shape [N, D], if not specified or is an empty Tensor, a single non-dominated partition bounds constructed by reference and anti_reference point will be returned.
anti_reference – a worst point to use with shape [D]. Defines the lower bound of the hypercell. If not specified, will use a default value: -[1e10] * D.
reference – a reference point to use, with shape [D]. Defines the upper bound of the hypervolume. Should be equal to or bigger than the anti-ideal point of the Pareto set. For comparing results across runs, the same reference point must be used.
- Returns:
lower, upper bounds of the partitioned cell, each with shape [N, D]
- Raises:
ValueError (or tf.errors.InvalidArgumentError) – If
reference
has an invalid shape.ValueError (or tf.errors.InvalidArgumentError) – If
anti_reference
has an invalid shape.