Parsing Output

OptiLog provides support for parsing the best configurations of the automatic configurators.

class optilog.tuning.configurators.utils.GGAParser(input_file)

Instantiates the parser of the configuration

Parameters

input_file (str) – Output of the master process of GGA.

get_config(raise_if_incomplete=True)

Get the best config from the output of GGA.

Parameters

raise_if_incomplete (bool) – Wether to raise an exception if no config is found

Return type

Dict[str, Any]

Returns

A dictionary with the best configuration

get_configs(raise_if_incomplete=True)

Get the best config from the output of GGA. Note that GGA provides a single winner configuration.

Parameters

raise_if_incomplete (bool) – Wether to raise an exception if no config is found

Return type

Dict[str, Dict[str, Any]]

Returns

A dictionary with the best configuration

save_configs(output_path, scenario_path, name)

Save the best configurations in a json file and an executable wrapper.

Parameters
  • output_path (str) – The directory where the files will be written to

  • scenario_path (str) – The path to the configuration scenario

  • name (str) – Name for the configuration that will be used in the generated files

Return type

None

class optilog.tuning.configurators.utils.SMACParser(input_path)

Instantiates the parser of the configuration

Parameters

input_path (str) – Path to the logs of the workers of SMAC

get_configs(raise_if_incomplete=True)

Get the best config from the output of the SMAC workers. Note that SMAC provides a configuration for each worker.

Parameters

raise_if_incomplete (bool) – Wether to raise an exception if no config is found

Return type

Dict[str, Dict[str, Any]]

Returns

A dictionary with the best configuration

save_configs(output_path, scenario_path, name)

Save the best configurations in a json file and an executable wrapper.

Parameters
  • output_path (str) – The directory where the files will be written to

  • scenario_path (str) – The path to the configuration scenario

  • name (str) – Name for the configuration that will be used in the generated files

1from optilog.tuning.configurators.utils import GGAParser
2
3parser = GGAParser("./DGGA.o9327508")
4parser.save_configs("./configs", "./gga_scenario", name="best")