Controller#

The Controller class controls the optimization.

class boa.controller.Controller(wrapper: Union[Type[BaseWrapper], BaseWrapper, PathLike], config_path: PathLike = None, config: BOAConfig = None, **kwargs)[source]#

Bases: object

Controls the instantiation of your BaseWrapper and the necessary Ax objects to start your Experiment and control the BOA scheduler. Once the Controller sets up your Experiment, it starts the scheduler, which runs your trials. It then saves the scheduler to a json file.

Parameters:
  • config_path (PathLike) – Path to configuration yaml or json file

  • wrapper (Type[BaseWrapper] | BaseWrapper | PathLike) – Your Wrapper subclass of BaseWrapper to be instantiated

  • config (BOAConfig) –

classmethod from_scheduler(scheduler, working_dir=None, **kwargs)[source]#
static initialize_wrapper(*args, **kwargs)[source]#
start_logger()[source]#
initialize_scheduler(get_exp_kw=None, get_scheduler_kw=None) tuple[boa.scheduler.Scheduler, boa.wrappers.base_wrapper.BaseWrapper][source]#

Sets experiment and scheduler

Parameters:
  • get_exp_kw – keyword arguments for get_experiment()

  • get_scheduler_kw – keyword arguments for get_scheduler()

Returns:

  • returns a tuple with the first element being the scheduler

  • and the second element being your wrapper (both initialized

  • and ready to go)

Return type:

tuple[boa.scheduler.Scheduler, boa.wrappers.base_wrapper.BaseWrapper]

run(scheduler: Scheduler = None, wrapper: BaseWrapper = None) Scheduler[source]#

Run trials for scheduler

Parameters:
Returns:

  • The scheduler after all trials have been run or the

  • experiment has been stopped for another reason.

Return type:

Scheduler