callbacks

The callbacks config group determines the lightning callbacks to be used by mml, whenever lightning is invoked (training, testing, predicting). Note that callbacks are mostly deactivated during tuning. Lightning provides comes with some builtin callbacks but special care has to taken since some callbacks are handled by mml itself internally. Callback creation is handled within create_trainer(), there

All other callbacks are coordinated through the callbacks config. Noteworthy though the yaml config files are within the callbacks folder the underlying config structure is cbs:{id:{**kwargs}}. This allows the following two features:

  • stacking callbacks: callbacks=[early,swa] - here adding both early stopping and stochastic weight averaging to the callbacks

  • modify callback kwargs: cbs.early.patience=5 - here setting the patience parameter of early stopping

The following callbacks configuration files are currently available:

default

cbs
lrm

early

cbs
early
monitor
default: val/loss
  • the monitor parameter controls the metric that is observed and required to improve to prevent stopping

  • may be set to any metric that is measured (see metrics), but the task name needs to be inserted (e.g. val/mml_fake_task/MulticlassAccuracy)

mode
default: min
  • either min or max

  • if adapting the monitor parameter it is important to also give the orientation of the metric

  • if “the bigger, the better” this mode should be max

patience
default: 10
  • controls the number of epochs awaiting improvement before training is stopped

  • note that trainer.min_epochs overrules stopping too early

  • if using lr_scheduler=plateau make sure EarlyStopping patience is larger than lr_scheduler.patience

none

cbs
  • this configuration file will clear any callback (except the ones handled internally by mml)

mixup

cbs
mixup

cutmix

cbs
cutmix

swa

cbs
swa
swa_lrs
default: 0.005
  • the SWA learning rate to use

stats

cbs
stats