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:
objectControls the instantiation of your
BaseWrapperand 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) –
See also
- 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: Scheduler = None, wrapper: BaseWrapper = None) Scheduler[source]#
Run trials for scheduler
- Parameters
scheduler (Scheduler) – initialed scheduler or None, if None, defaults to
self.scheduler(the scheduler set up inController.initialize_scheduler()wrapper (BaseWrapper) – initialed wrapper or None, if None, defaults to
self.wrapper(the wrapper set up inController.initialize_wrapper()
- Returns
The scheduler after all trials have been run or the
experiment has been stopped for another reason.
- Return type