vp_suite.defaults
This module contains the Settings class, which contains constants; and pre-set program configurations, such as default run config parameters.
- DEFAULT_RUN_CONFIG = {'batch_size': 32, 'context_frames': 10, 'epochs': 1000000, 'losses_and_scales': {'mse': 1.0}, 'lr': 0.0001, 'max_training_hours': 48, 'metrics': ['mse', 'lpips', 'psnr', 'ssim'], 'n_vis': 5, 'no_train': False, 'no_val': False, 'no_vis': False, 'no_wandb': False, 'out_dir': None, 'pred_frames': 10, 'seed': 42, 'seq_step': 1, 'use_actions': False, 'val_rec_criterion': 'mse', 'vis_compare': False, 'vis_context_frame_idx': None, 'vis_every': 10, 'vis_mode': 'gif'}
A dictionary containing the default run configuration specified in the
DefaultRunConfig
class.
- class DefaultRunConfig
Bases:
object
This class holds the default run configuration parameters, specifying behaviour during training and testing. All parameters can be overridden by supplementing keyword args in the corresponding training/testing call.
- context_frames: int = 10
The number of context frames given to the prediction models. Also used in determining the needed sequence length for dataset usage.
- epochs: int = 1000000
Number of epochs the model is trained before finalizing the training procedure. By default, this is set to a large number to let the training run terminate by time-outing.
- losses_and_scales: dict = {'mse': 1.0}
A dictionary where the keys denote all losses that should be calculated and logged during training, and their corresponding values denote the factor with which to multiply and add these losses to the overall loss used for backpropagation.
- max_training_hours: float = 48
Maximum number of training hours before finalizing the training procedure. When the training time is exceeded, the current training iteration is continued but becomes the last training iteration.
- metrics = ['mse', 'lpips', 'psnr', 'ssim']
A list of the metrics used for testing. If instead of a list, “all” is specified, all mavailable metrics are calculated.
- no_val: bool = False
If set to True, the validation loop is skipped during the training procedure. Instead the best model is saved after every epoch.
- out_dir = None
A file path for the output directory of the model. If none is specified, creates a suitable directory at runtime.
- pred_frames: int = 10
The number of frames the prediction model shall predict. Also used in determining the needed sequence length for dataset usage.
- seed: int = 42
The seed for all random number generators (python, numpy, pytorch) used throughout training/testing.
- seq_step: int = 1
Sequences taken from the dataset use every Nth frame, where N is this value (Default value is 1, meaning that every frame is taken for the sequence).
- use_actions: bool = False
If set to True, and the model supports actions, and the dataset contains actions, these actions will be used by the model for prediction.
- val_rec_criterion: str = 'mse'
The measure that is used to determine the model quality during validation. Every time the resulting measurement is improved, the current model snapshot is saved as the current ‘best model’.
- vis_compare: bool = False
If set to True, during testing, also generate visualization figures where the predicted frames of all tested models are laid out side-by-side.
- vis_context_frame_idx = None
If not None, during testing, this parameter specifies which context frame to include in the visualization figure that lays out the predictions of all models.
- SETTINGS = <vp_suite.defaults._PackageSettings object>
A settings instance that can be imported by other modules. It contains program-internal settings such as save paths (for the default values please see the source code).