Saving and Loading#
Functions for saving and loading your experiment to stop and restart.
- boa.storage.scheduler_to_json_file(scheduler, scheduler_filepath: PathLike = 'scheduler.json', dir_: PathLike = None, **kwargs) None[source]#
Save a JSON-serialized snapshot of this Scheduler’s settings and state to a .json file by the given path.
- Parameters:
scheduler_filepath (PathLike) –
dir_ (PathLike) –
- Return type:
None
- boa.storage.scheduler_from_json_file(filepath: PathLike = 'scheduler.json', wrapper=None, **kwargs) Scheduler[source]#
Restore an Scheduler and its state from a JSON-serialized snapshot, residing in a .json file by the given path.
- Parameters:
filepath (PathLike) –
- Return type:
- boa.storage.scheduler_to_json_snapshot(scheduler: Scheduler, encoder_registry: Optional[Dict[Type, Callable[[Any], Dict[str, Any]]]] = None, class_encoder_registry: Optional[Dict[Type, Callable[[Any], Dict[str, Any]]]] = None) Dict[str, Any][source]#
Serialize this Scheduler to JSON to be able to interrupt and restart optimization and save it to file by the provided path.
- boa.storage.scheduler_from_json_snapshot(serialized: Dict[str, Any], decoder_registry: Optional[Dict[str, Type]] = None, class_decoder_registry: Optional[Dict[str, Callable[[Dict[str, Any]], Any]]] = None, wrapper_path=None, filepath: PathLike = None, **kwargs) Scheduler[source]#
Recreate an Scheduler from a JSON snapshot.
- boa.storage.exp_opt_to_csv(experiment: Experiment, opt_filepath: PathLike = 'optimization.csv', dir_: PathLike = None, *, metrics_to_end: bool = False, ax_kwargs: Optional[Dict[str, Any]] = None, **kwargs) Path[source]#