trieste.acquisition.combination#

Module Contents#

class Reducer(*builders: trieste.acquisition.interface.AcquisitionFunctionBuilder[trieste.models.ProbabilisticModel])[source]#

Bases: trieste.acquisition.interface.AcquisitionFunctionBuilder[trieste.models.ProbabilisticModel]

A Reducer builds an AcquisitionFunction whose output is calculated from the outputs of a number of other AcquisitionFunctions. How these outputs are composed is defined by the method _reduce().

Parameters

*builders – Acquisition function builders. At least one must be provided.

Raises

InvalidArgumentError – If no builders are specified.

prepare_acquisition_function(self, models: collections.abc.Mapping[str, trieste.models.ProbabilisticModel], datasets: Optional[collections.abc.Mapping[str, trieste.data.Dataset]] = None)trieste.acquisition.interface.AcquisitionFunction[source]#

Return an acquisition function. This acquisition function is defined by first building acquisition functions from each of the AcquisitionFunctionBuilders specified at __init__(), then reducing, with _reduce(), the output of each of those acquisition functions.

Parameters
  • datasets – The data from the observer.

  • models – The models over each dataset in datasets.

Returns

The reduced acquisition function.

update_acquisition_function(self, function: trieste.acquisition.interface.AcquisitionFunction, models: collections.abc.Mapping[str, trieste.models.ProbabilisticModel], datasets: Optional[collections.abc.Mapping[str, trieste.data.Dataset]] = None)trieste.acquisition.interface.AcquisitionFunction[source]#
Parameters
  • function – The acquisition function to update.

  • models – The model.

  • datasets – Unused.

property acquisitions(self)collections.abc.Sequence[trieste.acquisition.interface.AcquisitionFunctionBuilder[trieste.models.ProbabilisticModel]][source]#

The acquisition function builders specified at class initialisation.

abstract _reduce(self, inputs: collections.abc.Sequence[trieste.types.TensorType])trieste.types.TensorType[source]#
Parameters

inputs – The output of each constituent acquisition function.

Returns

The output of the reduced acquisition function.

class Sum(*builders: trieste.acquisition.interface.AcquisitionFunctionBuilder[trieste.models.ProbabilisticModel])[source]#

Bases: Reducer

Reducer whose resulting acquisition function returns the element-wise sum of the outputs of constituent acquisition functions.

Parameters

*builders – Acquisition function builders. At least one must be provided.

Raises

InvalidArgumentError – If no builders are specified.

_reduce(self, inputs: collections.abc.Sequence[trieste.types.TensorType])trieste.types.TensorType[source]#
Parameters

inputs – The outputs of each acquisition function.

Returns

The element-wise sum of the inputs.

class Product(*builders: trieste.acquisition.interface.AcquisitionFunctionBuilder[trieste.models.ProbabilisticModel])[source]#

Bases: Reducer

Reducer whose resulting acquisition function returns the element-wise product of the outputs of constituent acquisition functions.

Parameters

*builders – Acquisition function builders. At least one must be provided.

Raises

InvalidArgumentError – If no builders are specified.

_reduce(self, inputs: collections.abc.Sequence[trieste.types.TensorType])trieste.types.TensorType[source]#
Parameters

inputs – The outputs of each acquisition function.

Returns

The element-wise product of the inputs.