thelper.session package

Submodules

thelper.session.base module

class thelper.session.base.SessionRunner(session_name, session_dir, model, task, loaders, config, ckptdata=None)[source]

Bases: object

Abstract session runner interface that defines basic session i/o and setup operations.

This class offers the most basic methods that can be employed by more specialized training or inference sessions. By itself, it doesn’t actually run anything.

Variables:
  • checkpoint_dir – session checkpoint output directory (located within the ‘session directory’).
  • config – session configuration dictionary holding all original settings, including trainer configuration.
  • devices – list of (cuda) device IDs to upload the model/tensors to; can be empty if only the CPU is available.
  • epochs – number of epochs to train the model for.
  • logger – used to output debug/warning/error messages to session log.
  • model – reference to the model being trained or used for evaluation/prediction.
  • monitor – name of the training/validation metric that should be monitored for model improvement.
  • name – name of the session, used for printing and creating log folders.
  • optimization_config – dictionary of optim-related parameters, parsed at training time.
  • output_paths – map of session output paths where training/evaluation results should be saved.
  • save_freq – frequency of checkpoint saves while training (i.e. save every X epochs).
  • save_raw – specifies whether to save raw types or thelper objects in checkpoints.
  • skip_eval_iter – number of evaluation iterations to skip (useful for resuming a session).
  • skip_tbx_histograms – flag used to skip the generation of graph histograms in tbx (useful for large models).
  • task – reference to the object used to specialize the model and that holds task metainformation.
  • tbx_histogram_freq – frequency of tbx histogram saves while training (i.e. save every X epochs).
  • use_tbx – defines whether to use tensorboardX writers for logging or not.
  • writers – map of tbx writers used to save training/evaluation events.
__init__(session_name, session_dir, model, task, loaders, config, ckptdata=None)[source]

Receives the trainer configuration dictionary, parses it, and sets up the session.