Base
SinglePointUtilityFunction
module-attribute
Type alias for utility functions which don't support batching, and instead characterise the utility of querying a single point, rather than a batch of points. They take an array of points of shape \([N, D]\) and return the value of the utility function at each point in an array of shape \([N, 1]\).
UtilityFunction
module-attribute
Type alias for all utility functions. Currently we only support
SinglePointUtilityFunction
s, but in future may support batched utility functions too.
Note that UtilityFunction
s are maximised in order to decide which point, or batch of points, to query next.
AbstractUtilityFunctionBuilder
module-attribute
Type alias for utility function builders. For now this only include single point utility function builders, but in the future we may support batched utility function builders.
AbstractSinglePointUtilityFunctionBuilder
dataclass
Bases: ABC
Abstract class for building utility functions which don't support batches. As such, they characterise the utility of querying a single point next.
check_objective_present
Check that the objective posterior and dataset are present in the posteriors and datasets.
Parameters:
-
posteriors
(Mapping[str, AbstractPosterior]
) βdictionary of posteriors to be used to form the utility function.
-
datasets
(Mapping[str, Dataset]
) βdictionary of datasets which may be used to form the utility function.
Raises:
-
ValueError
βIf the objective posterior or dataset are not present in the posteriors or datasets.
build_utility_function
abstractmethod
Build a UtilityFunction
from a set of posteriors and datasets.
Parameters:
-
posteriors
(Mapping[str, AbstractPosterior]
) βdictionary of posteriors to be used to form the utility function.
-
datasets
(Mapping[str, Dataset]
) βdictionary of datasets which may be used to form the utility function.
-
key
(KeyArray
) βJAX PRNG key used for random number generation.
Returns:
-
SinglePointUtilityFunction
(SinglePointUtilityFunction
) βUtility function to be maximised in order to decide which point to query next.