Controller#
The Controller class controls the optimization.
- class boa.controller.Controller(wrapper: Type[BaseWrapper] | BaseWrapper | PathLike, config_path: PathLike = None, config: dict = 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 (dict) –
See also
- classmethod from_scheduler_path(scheduler_path, wrapper: BaseWrapper | Type[BaseWrapper] | PathLike = None, **kwargs)[source]#
- Parameters:
wrapper (BaseWrapper | Type[BaseWrapper] | PathLike) –
- 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:
scheduler (Optional[Scheduler]) – initialed scheduler or None, if None, defaults to
self.scheduler(the scheduler set up inController.initialize_scheduler()wrapper (Optional[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: