Skip to content

Base

SinglePointUtilityFunction module-attribute

SinglePointUtilityFunction = Callable[[Float[Array, 'N D']], Float[Array, 'N 1']]

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

UtilityFunction = SinglePointUtilityFunction

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 module-attribute

AbstractUtilityFunctionBuilder = AbstractSinglePointUtilityFunctionBuilder

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

AbstractSinglePointUtilityFunctionBuilder()

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_objective_present(posteriors, datasets)

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_utility_function(posteriors, datasets, key)

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.