Configure Lightning Loggers
Under the framework of PyTorch Lightning, metrics collected by Lightning Trainer are delievered to Lightning Logger objects to produce output, as shown in the Check the Results section.
The metrics can include training loss, validation loss, accuracy, etc. If you are not familiar with the metrics involved in continual learning, feel free to get some knowledge from my post A Summary of Continual Learning Metrics.
Each type of logger is designed for one type of output, such as CSV files (by CSVLogger
), TensorBoard logs (by TensorBoardLogger
). We can apply multiple loggers to produce different forms of output at the same time.
Unlike optimizer, there is just no point to assign distinct loggers to each task. We use uniform loggers setting across all tasks instead.
Configure Lightning Loggers
To configure the Lightning loggers for your experiment, link the /lightning_loggers
field in the experiment index config to a YAML file in lightning_loggers/ subfolder of your configs. That YAML file contains a defaults
list of different logger switch fields. For loggers not applied, set the corresponding fields as null
or simply delete it. If you want to enable a logger, link the corresponding field to a YAML file in <logger-name>/
subfolder in this lightning_loggers/ subfolder. The YAML file in <logger-name>/
subfolder should use _target_
field to link to the correct Lightning Logger class and specify its arguments (which are configs for that logger) in the following field. 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:
...
- /lightning_loggers: default.yaml
...
example_configs/lightning_loggers/default.yaml
defaults:
- csv: default.yaml
- tensorboard: default.yaml
- comet: null
- wandb: null
- neptune: null
- mlflow: null
example_configs/lightning_loggers/csv/default.yaml
_target_: lightning.pytorch.loggers.CSVLogger
save_dir: ${output_dir}
Supported Loggers
We fully support all built-in loggers defined in Lightning, including 6 type of loggers: CSVLogger
, TensorBoardLogger
, WandbLogger
, NeptuneLogger
, MLFlowLogger
, CometLogger
. Please refer to Lightning documentation to see the full list. Please also refer to PyTorch documentation of each logger class to learn its required arguments.