nntool.experiment¶
Classes¶
Configuration class for setting up an experiment. |
Functions¶
get current time in this format: MMDDYYYY/HHMMSS |
|
Get output path based on environment variable OUTPUT_PATH and NNTOOL_OUTPUT_PATH. |
|
Read a toml file and return the content as a dictionary |
Descriptions¶
- class nntool.experiment.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_current_time()[source]¶
Return the current time for the experiment.
- Returns:
current time for the experiment
- Return type:
str
- get_output_path()[source]¶
Return the output path prepared for the experiment.
- Returns:
output path for the experiment
- Return type:
str
- nntool.experiment.get_current_time()[source]¶
get current time in this format: MMDDYYYY/HHMMSS
- Returns:
time in the format MMDDYYYY/HHMMSS
- Return type:
str
- nntool.experiment.get_output_path(output_path='./', append_date=True, cache_into_env=True)[source]¶
Get output path based on environment variable OUTPUT_PATH and NNTOOL_OUTPUT_PATH. The output path is appended with the current time if append_date is True (e.g. /OUTPUT_PATH/xxx/MMDDYYYY/HHMMSS).
- Parameters:
append_date (bool) – append a children folder with the date time, defaults to True
cache_into_env (bool) – whether cache the newly created path into env, defaults to True
- Returns:
(output path, current time)
- Return type:
tuple[str, str]