Skip to content

Validation

class Validation

Configuration for performing validation during model training.

Arguments:

  • data - A RelationalData object containing the validation data.
  • lr_schedule - A LrSchedule object. Leave to None for a constant learning rate.
  • early_stop - An EarlyStop object, an EarlyStopMode object, or a string representing an EarlyStopMode. If None, early stop will not be performed.
  • save_best - A path to save the best model checkpoint. If None, the best model will not be saved.
  • tensorboard - A path to a TensorBoard log directory. If None, TensorBoard data will not be recorded.
  • each - The validation frequency.
  • trigger - The event triggering validation. Can be a HookEvent object or a string representing a HookEvent.

class EarlyStopMode

Enumeration class representing different early stop modes. Supported modes are: PRECISE, NORMAL and QUICK.

class EarlyStop

Early stop configuration.

Arguments:

  • delta - The smallest variation which is considered an improvement: if the relative improvement of the monitored quantity is less than this value, the early stopping will be triggered.
  • patience - The number of consecutive times that the early stopping criterion must be triggered before actually failing.

class LrSchedule

Learning rate scheduler that reduces the learning rate of a given factor when the monitored quantity reaches a plateau.

Arguments:

  • factor - The factor by which the learning rate will be reduced, must be between 0 and 1.
  • patience - The number of steps for which the condition must be triggered before actually reducing the learning rate.
  • threshold - The threshold for measuring the new optimum, to only focus on significant changes.
  • cooldown - The number of steps to wait before resuming normal operation after the learning rate has been reduced.
  • lr_min_ratio - The ratio to compute the minimal learning rate, i.e. lr * self.lr_min_ratio. The learning rate will never go below such value.