nntool.experiment.config¶

Classes

BaseExperimentConfig(config_name, output_folder)

Configuration class for setting up an experiment.

class nntool.experiment.config.BaseExperimentConfig(config_name, output_folder, experiment_name_key='EXP_NAME', env_toml_path='env.toml', append_date_to_path=True, existing_output_path_ok=False)[source]¶

Configuration class for setting up an experiment.

Parameters:
  • config_name (str) – The name of the configuration.

  • output_folder (str) – The folder path where the outputs will be saved.

  • experiment_name_key (str) – Key for experiment name in the environment variable, default is ‘EXP_NAME’.

  • env_toml_path (str) – Path to the env.toml file, default is ‘env.toml’.

  • append_date_to_path (bool) – If True, the current date and time will be appended to the output path, default is True.

  • existing_output_path_ok (bool) – If True, the existing output path is ok to be reused, default is False.

get_output_path()[source]¶

Return the output path prepared for the experiment.

Returns:

output path for the experiment

Return type:

str

get_current_time()[source]¶

Return the current time for the experiment.

Returns:

current time for the experiment

Return type:

str

set_up_stateful_fields()[source]¶

Post configuration steps for stateful fields such as output_path in the derived class. This method should be overridden in the derived class.

start()[source]¶

Start the experimen. This will - cache NNTOOL_OUTPUT_PATH and NNTOOL_OUTPUT_PATH_DATE into environment variables, which means the later launched processes would inherit these variables. - create the output path if it does not exist.