Configure Your Callbacks
Under the framework of PyTorch Lightning, we use callbacks to add extra functionality or action before, during, or after training, validating, or testing process. Each callback is designed for one kind of function, we cam apply multiple callbacks to do multiple kinds of actions together. Just like loggers, there is no point to assign distinct callbacks to each task. We use uniform callbacks across all tasks.
To configure the Callbacks for your experiment, link the callbacks
field in the main YAML file to sub-config file in the sub-directory defaults
of loggers you want to activate in the sub-config. Each item of the list correspoend one callback linked to the sub-sub-config in the sub-sub-directory where you specify the detailed settings for the callback there. Here is an example:
./clarena/example_configs
├── __init__.py
├── entrance.yaml
├── experiment
│ ├── example.yaml
│ └── ...
├── lightning_loggers
│ ├── default.yaml
│ ├── csv
│ │ └── default.yaml
│ ├── tensorboard
│ │ └── default.yaml
...
example_configs/experiment/example.yaml
defaults:
...
- /callbacks: default.yaml
...
example_configs/callbacks/default.yaml
defaults:
- pylogger_callback: default.yaml
- lightning_loggers_callback: default.yaml
- image_show_callback: default.yaml
- rich_progress_bar: default.yaml
- rich_model_summary: null # no need to turn on as RichProgressBar enables it
- device_stats_monitor: null
example_configs/callbacks/pylogger_callback/default.yaml
_target_: clarena.callbacks.PyloggerCallback
Supported Callbacks
We fully support all built-in callbacks defined in Lightning. Please refer to PyTorch Documentation to see the full list and what fields (arguments) are required for each class.
Other than this, we provided our customized callbacks for continual learning or general use:
Callback (Class Name) | Description |
---|---|
MetricsCallback | Provides class for logging monitored metrics to Lightning loggers and else. |
PyLoggerCallback | Provides additional logging for during continual learning progress. |
ImageShowCallback | Shows images and labels in the first batch of training data in different ways. |
CLRichProgressBar | Customised Rich Progress Bar for continual learning. |
Please refer to the documentation of each class to know what fields (arguments) are required for the class.