skeltorch.Experiment

class skeltorch.Experiment(configuration, data, logger)

Skeltorch execution class.

An experiment object stores the information related to an experiment and is in charge of handling the files belonging to it. It provides an easy interface to create and load experiments, log project information and restore object states.

Read our tutorial “File structure of an experiment” to get details about the files and folders stored inside an experiment.

configuration

Configuration object.

Type:skeltorch.Configuration
data

Data object of the experiment.

Type:skeltorhc.Data
logger

Logger object.

Type:logging.Logger
tbx

TensorBoard logging helper.

Type:tensorboardX.SummaryWriter
experiment_name

Name of the experiment.

Type:str
paths

Dictionary containing absolute paths to the files and folders of the experiment.

Type:dict
checkpoint_load(self, epoch, device)

Loads the checkpoint associated to epoch.

Parameters:
  • epoch (int) – Epoch number used to identify the checkpoint.
  • device (str) – Device where the checkpoint is loaded.
Returns:

Dictionary containing the states stored inside the checkpoint.

Return type:

dict

checkpoint_save(self, checkpoint_data, epoch)

Saves a checkpoint associated to epoch.

Parameters:
  • checkpoint_data (dict) – Dictionary containing the states to store inside the checkpoint.
  • epoch (int) – Epoch number used to identify the checkpoint.
checkpoints_get(self)

Returns a list with available checkpoints.

Returns:List containing the epochs with available checkpoint.
Return type:list
create(self, data_path, config_path, config_schema_path, seed, verbose)

Creates an experiment named experiment_name.

Creates the experiment and its associated files and folders. It also creates and saves its dependencies, that is, its skeltorch.Configuration and skeltorch.Data objects.

Parameters:
  • data_path (str) – --data-path command argument.
  • config_path (str) – --config-path command argument.
  • config_schema_path (str) – --config-schema-path command argument.
init(self, experiment_name, experiments_path)

Lazy-loading of skeltorch.Experiment attributes.

Parameters:
  • experiment_name (str) – --experiment-name command argument.
  • experiments_path (str) – --experiments-path command argument.
load(self, data_path, num_workers, verbose)

Loads the experiment named experiment_name.

Loads the experiment and its dependencies, that is, its skeltorch.Configuration and skeltorch.Data objects. It also initializes the loggers.

Parameters:
  • data_path (str) – --data-path command argument.
  • num_workers (int) – --num-workers command argument.
run_tensorboard(self, port, dev, compare, experiments_path)

Runs TensorBoard using experiment files.

Parameters:
  • port (int) – --port command argument.
  • dev (bool) – --dev command argument.
  • compare (bool) – --compare command argument.