Controller#

The Controller class controls the optimization.

class boa.controller.Controller(wrapper: Union[Type[BaseWrapper], BaseWrapper, PathLike], config_path: Optional[PathLike] = None, config: Optional[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(**kwargs) tuple[boa.scheduler.Scheduler, boa.wrappers.base_wrapper.BaseWrapper][source]#

Sets experiment and scheduler

Parameters

kwargs – kwargs to pass to get_experiment and 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: Optional[Scheduler] = None, wrapper: Optional[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