Skip to content

Base

gpjax.decision_making.utility_functions.base

SinglePointUtilityFunction = Callable[[Float[Array, 'N D']], Float[Array, 'N 1']] 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][N, D] and return the value of the utility function at each point in an array of shape [N,1][N, 1].

UtilityFunction = SinglePointUtilityFunction module-attribute

Type alias for all utility functions. Currently we only support SinglePointUtilityFunctions, but in future may support batched utility functions too. Note that UtilityFunctions are maximised in order to decide which point, or batch of points, to query next.

AbstractUtilityFunctionBuilder = AbstractSinglePointUtilityFunctionBuilder 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.

__init__() -> None
check_objective_present(posteriors: Mapping[str, AbstractPosterior], datasets: Mapping[str, Dataset]) -> None

Check that the objective posterior and dataset are present in the posteriors and datasets.

Parameters:

Name Type Description Default
posteriors Mapping[str, AbstractPosterior]

Dictionary of posteriors to be

required
datasets Mapping[str, Dataset]

Dictionary of datasets which may be used

required

Raises:

Type Description
ValueError

If the objective posterior or dataset are not present in the

build_utility_function(posteriors: Mapping[str, AbstractPosterior], datasets: Mapping[str, Dataset], key: KeyArray) -> SinglePointUtilityFunction abstractmethod

Build a UtilityFunction from a set of posteriors and datasets.

Parameters:

Name Type Description Default
posteriors Mapping[str, AbstractPosterior]

Dictionary of posteriors to be

required
datasets Mapping[str, Dataset]

Dictionary of datasets which may be used

required
key KeyArray

JAX PRNG key used for random number generation.

required

Returns:

Name Type Description
SinglePointUtilityFunction SinglePointUtilityFunction

Utility function to be maximised in order to

SinglePointUtilityFunction

decide which point to query next.