TrainerBase¶

class TrainerBase¶

Bases: ABC

Base class for a surrogate/acquisiton function model trainer.

Methods

__init__

init_seed

Initialize with a random seed.

train

Train a surrogate model.

init_seed(seed: int) None¶

Initialize with a random seed.

Parameters:

seed (int) – A random seed.

abstract train(x_values: list[list[Any]], y_values: list[Any], logger: Logger | None) Any¶

Train a surrogate model.

Parameters:
  • x_values (list[list[Any]]) – Input value vectors to the model.

  • y_values (list[Any]) – Output values corresponding to the input value vectors.

  • logger (Logger | None) – A logger.

Returns:

A trained model.

Return type:

Any

__abstractmethods__ = frozenset({'train'})¶
__dict__ = mappingproxy({'__module__': 'amplify_bbopt.trainer', '__doc__': 'Base class for a surrogate/acquisiton function model trainer.', 'train': <function TrainerBase.train>, 'init_seed': <function TrainerBase.init_seed>, '__dict__': <attribute '__dict__' of 'TrainerBase' objects>, '__weakref__': <attribute '__weakref__' of 'TrainerBase' objects>, '__abstractmethods__': frozenset({'train'}), '_abc_impl': <_abc._abc_data object>, '__annotations__': {}})¶
__slots__ = ()¶
__weakref__¶

list of weak references to the object (if defined)