base#
Base class for obsidian objective functions
Classes
|
An objective function which is calculated from the model output(s) and input(s). |
- class obsidian.objectives.base.Objective(mo: bool = False)[source]#
Bases:
MCMultiOutputObjective
,MCAcquisitionObjective
An objective function which is calculated from the model output(s) and input(s).
- _is_mo#
A flag indicating whether the final output is multi-output.
- Type:
bool
- abstract forward(samples: Tensor, X: Tensor | None = None) Tensor [source]#
Evaluate the multi-output objective on the samples.
- Parameters:
samples – A sample_shape x batch_shape x q x m-dim Tensors of samples from a model posterior.
X – A batch_shape x q x d-dim Tensors of inputs.
- Returns:
A sample_shape x batch_shape x q x m’-dim Tensor of objective values with m’ the output dimension. This assumes maximization in each output dimension).
This method is usually not called directly, but via the objectives.
Example
>>> # `__call__` method: >>> samples = sampler(posterior) >>> outcomes = multi_obj(samples)