custom#
Custom objective function formulations
Classes
|
Represents a bounded target objective for multi-output and single-output acquisition objectives |
|
Objective function that computes the weighted quotient of other objectives |
|
Creates an objective function which creates a new outcome as a linear combination of input features. |
|
Dummy multi-output objective function that simply returns the input Y. |
|
Creates an objective function that returns the single-objective output from a multi-output model, at the specified index. |
|
Objective function that computes the weighted products of other objectives |
|
A custom objective for calculating the distance between an output response and a most-desirable, ideal/utopian point. |
- class obsidian.objectives.custom.Bounded_Target(bounds: list[tuple[float, float] | None], targets: Target | list[Target], tau: float = 0.001)[source]#
Bases:
Objective
Represents a bounded target objective for multi-output and single-output acquisition objectives
- Parameters:
- lb#
The lower bounds for the targets.
- Type:
torch.Tensor
- ub#
The upper bounds for the targets.
- Type:
torch.Tensor
- tau#
The temperature parameter for the sigmoid function.
- Type:
torch.Tensor
- ind#
The indices of the non-None bounds.
- Type:
torch.Tensor
- class obsidian.objectives.custom.Divide_Objective(ind_num: int, ind_denom: int, w_num: float | int = 1, w_denom: float | int = 1, const: float | int = 0, new_dim: bool = True)[source]#
Bases:
Objective
Objective function that computes the weighted quotient of other objectives
(w_num * samples[…, ind_num])/(w_denom * samples[…, ind_denom]) + const
- Parameters:
ind_num (int) – The index of the objective to be used in the numerator
w_num (float | int, optional) – The weight corresponding to numerator objective. Defaults to
1
.ind_denom (int) – The index of the objective to be used in the denominator
w_denom (float | int, optional) – The weight corresponding to denominator objective. Defaults to
1
.const (float | int) – A constant value that can be added to the quotient
new_dim (bool, optional) – Whether to create a new objective dimension from this quotient. Default is
False
. Setting toTrue
will make this the only output objective.
- class obsidian.objectives.custom.Feature_Objective(X_space: ParamSpace, ind: tuple[int], coeff: list[float | int])[source]#
Bases:
Objective
Creates an objective function which creates a new outcome as a linear combination of input features.
Always a multi-output objective.
- Parameters:
X_space (ParamSpace) – The parameter space.
ind (tuple[int]) – The indices of the parameters in the real space to be used as features.
coeff (list[float | int], optional) – The coefficients corresponding to each feature. Defaults to
[0]
.
- Raises:
ValueError – If the length of ind and coeff are not the same.
TypeError – If the indices for input objectives are not for continuous parameters.
- class obsidian.objectives.custom.Identity_Objective(mo: bool = False)[source]#
Bases:
Objective
Dummy multi-output objective function that simply returns the input Y.
- class obsidian.objectives.custom.Index_Objective(ind: int | tuple[int] = 0)[source]#
Bases:
Objective
Creates an objective function that returns the single-objective output from a multi-output model, at the specified index.
Single-objective when index is int; multi-objective if tuple.
- Parameters:
ind (int | tuple[int]) – The index of the value to be returned.
- class obsidian.objectives.custom.Product_Objective(ind: tuple[int], weights: list[float | int] | None = None, const: float | int = 0, new_dim: bool = True)[source]#
Bases:
Objective
Objective function that computes the weighted products of other objectives
- Parameters:
ind (tuple[int]) – The indices of objectives to be used in a product
weights (list[float | int], optional) – The weights corresponding to indexed objectives. Defaults to
(1,)*len(ind)
.const (float | int) – A constant value that can be added to the product
new_dim (bool, optional) – Whether to create a new objective dimension from this product. Default is
False
. Setting toTrue
will make this the only output objective.
- class obsidian.objectives.custom.Utopian_Distance(utopian: list[float | int], targets: Target | list[Target])[source]#
Bases:
Objective
A custom objective for calculating the distance between an output response and a most-desirable, ideal/utopian point.
- Parameters:
- u_t#
The utopian coordinates in transformed space
- Type:
Tensor
- Raises:
TypeError – If the input is not a list of Target objects.
ValueError – If the length of the utopian point and targets are not the same.