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_: Optional[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_ (Optional[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

Scheduler

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.

Returns

A JSON-safe dict representation of this Scheduler.

Parameters
Return type

Dict[str, Any]

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, **kwargs) Scheduler[source]#

Recreate an Scheduler from a JSON snapshot.

Parameters
Return type

Scheduler

boa.storage.recursive_deserialize(obj, **kwargs)[source]#
boa.storage.exp_opt_to_csv(experiment, opt_path: PathLike = 'optimization.csv', dir_: Optional[PathLike] = None, **kwargs)[source]#
Parameters
  • opt_path (PathLike) –

  • dir_ (Optional[PathLike]) –

boa.storage.scheduler_opt_to_csv(scheduler, **kwargs)[source]#
boa.storage.dump_scheduler_data(scheduler, **kwargs)[source]#