local_results_save

class aitoolbox.experiment.local_save.local_results_save.AbstractLocalResultsSaver[source]

Bases: ABC

abstract save_experiment_results(result_package, training_history, project_name, experiment_name, experiment_timestamp=None, save_true_pred_labels=False, protect_existing_folder=True)[source]

Single file results saving method which all the result savers have to implement to give an expected API

Parameters:
Returns:

list of list with this format: [[results_file_name, results_file_local_path], … [ , ]] Each file should be a new list specifying the file name and its full path

The first file path should be pointing to the main experiment results file.

Return type:

list

abstract save_experiment_results_separate_files(result_package, training_history, project_name, experiment_name, experiment_timestamp, save_true_pred_labels=False, protect_existing_folder=True)[source]

Separate file results saving method which all the result savers have to implement to give an expected API

Parameters:
Returns:

list of list with this format: [[results_file_name, results_file_local_path], … [ , ]] Each file should be a new list specifying the file name and its full path

The first file path should be pointing to the main experiment results file.

Return type:

list

class aitoolbox.experiment.local_save.local_results_save.BaseLocalResultsSaver(local_model_result_folder_path='~/project/model_result', file_format='pickle')[source]

Bases: object

Base functionality for all the local results savers

Parameters:
  • local_model_result_folder_path (str) – root local path where project folder will be created

  • file_format (str) – pickle or json

create_experiment_local_folder_structure(project_name, experiment_name, experiment_timestamp)[source]

Creates experiment local results folder hierarchy

Parameters:
  • project_name (str) – root name of the project

  • experiment_name (str) – name of the particular experiment

  • experiment_timestamp (str) – time stamp at the start of training

Returns:

experiment folder path

Return type:

str

static create_experiment_local_results_folder(project_name, experiment_name, experiment_timestamp, local_model_result_folder_path)[source]

Creates experiment local results folder hierarchy

Parameters:
  • project_name (str) – root name of the project

  • experiment_name (str) – name of the particular experiment

  • experiment_timestamp (str) – time stamp at the start of training

  • local_model_result_folder_path (str) – root local path where project folder will be created

Returns:

experiment results folder path (inside the experiment folder)

Return type:

str

static get_experiment_local_results_folder_paths(project_name, experiment_name, experiment_timestamp, local_model_result_folder_path)[source]

Generates experiment local results folder hierarchy paths

Parameters:
  • project_name (str) – root name of the project

  • experiment_name (str) – name of the particular experiment

  • experiment_timestamp (str) – time stamp at the start of training

  • local_model_result_folder_path (str) – root local path where project folder will be created

Returns:

project_dir_path, experiment_dir_path, experiment_results_dir_path

Return type:

str, str, str

save_file(result_dict, file_name_w_type, file_local_path_w_type)[source]

Saves dict to file in desired format

Parameters:
  • result_dict (dict) – results dict

  • file_name_w_type (str) – filename without the file extension at the end

  • file_local_path_w_type (str) – file path without the file extension at the end

Returns:

saved file name, saved file path

Return type:

str, str

class aitoolbox.experiment.local_save.local_results_save.LocalResultsSaver(local_model_result_folder_path='~/project/model_result', file_format='pickle')[source]

Bases: AbstractLocalResultsSaver, BaseLocalResultsSaver

Local model training results saver to local drive

Parameters:
  • local_model_result_folder_path (str) – root local path where project folder will be created

  • file_format (str) – file format of the results file

save_experiment_results(result_package, training_history, project_name, experiment_name, experiment_timestamp=None, save_true_pred_labels=False, protect_existing_folder=True)[source]

Saves all the experiment results into single local file

Parameters:
Returns:

list of list with this format: [[results_file_path_inside_results_dir, results_file_local_path], … [ , ]]

Each file should be a new list specifying the file name and its full path.

The first file path should be pointing to the main experiment results file.

Return type:

list

save_experiment_results_separate_files(result_package, training_history, project_name, experiment_name, experiment_timestamp=None, save_true_pred_labels=False, protect_existing_folder=True)[source]

Saves the experiment results into separate local files

Parameters:
Returns:

list of list with this format: [[results_file_path_inside_results_dir, results_file_local_path], … [ , ]] Each file should be a new list specifying the file name and its full path.

The first file path should be pointing to the main experiment results file.

Return type:

list