Shawn’s Blog
  • πŸ—‚οΈ Collections
    • πŸ–₯️ Slides Gallery
    • πŸ§‘β€πŸ³οΈ Cooking Ideas
    • 🍱 Cookbook
    • πŸ’¬ Language Learning
    • 🎼 Songbook
  • βš™οΈ Projects
    • βš› Continual Learning Arena
  • πŸ“„ Papers
    • AdaHAT
    • FG-AdaHAT
  • πŸŽ“ CV
    • CV (English)
    • CV (Mandarin)
  • About
  1. Continual Learning (CL)
  2. Configure CL Main Experiment
  3. Lightning Loggers
  • Welcome to CLArena
  • Get Started
  • Continual Learning (CL)
    • Configure CL Main Experiment
      • Experiment Index Config
      • CL Algorithm
      • CL Dataset
      • Backbone Network
      • Optimizer
      • Learning Rate Scheduler
      • Trainer
      • Metrics
      • Lightning Loggers
      • Callbacks
      • Other Configs
    • Save and Evaluate Model
    • Full Experiment
    • Output Results
  • Continual Unlearning (CUL)
    • Configure CUL Main Experiment
      • Experiment Index Config
      • Unlearning Algorithm
      • Callbacks
    • Full Experiment
    • Output Results
  • Multi-Task Learning (MTL)
    • Configure MTL Experiment
      • Experiment Index Config
      • MTL Algorithm
      • MTL Dataset
      • Backbone Network
      • Optimizer
      • Learning Rate Scheduler
      • Trainer
      • Metrics
      • Callbacks
    • Save and Evaluate Model
    • Output Results
  • Single-Task Learning (STL)
    • Configure STL Experiment
      • Experiment Index Config
      • STL Dataset
      • Backbone Network
      • Optimizer
      • Learning Rate Scheduler
      • Trainer
      • Metrics
      • Callbacks
    • Save and Evaluate Model
    • Output Results
  • Implement Your Modules (TBC)
  • API Reference
  1. Continual Learning (CL)
  2. Configure CL Main Experiment
  3. Lightning Loggers

Configure Lightning Loggers

Modified

August 16, 2025

Under the framework of PyTorch Lightning, metrics collected by Lightning Trainer are delivered to Lightning Logger objects to produce output, as shown in the Output Results (CL) 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 article 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. There are 6 types of built-in loggers in Lightning: CSVLogger, TensorBoardLogger, WandbLogger, NeptuneLogger, MLFlowLogger, and CometLogger.

Lightning loggers is a sub-config under the experiment index config (CL Main). To configure custom loggers, you need to create a YAML file in lightning_loggers/ folder. Unlike optimizer, there is no point to assign distinct loggers to each task. We use uniform loggers setting across all tasks instead. Below shows examples of the Lightning loggers config.

Example

configs
β”œβ”€β”€ __init__.py
β”œβ”€β”€ entrance.yaml
β”œβ”€β”€ experiment
β”‚   β”œβ”€β”€ example_clmain_train.yaml
β”‚   └── ...
β”œβ”€β”€ lightning_loggers
β”‚   β”œβ”€β”€ default.yaml
β”‚   β”œβ”€β”€ csv
β”‚   β”‚   └── default.yaml
β”‚   β”œβ”€β”€ tensorboard
β”‚   β”‚   └── default.yaml
...
configs/experiment/example_clmain_train.yaml
defaults:
  ...
  - /lightning_loggers: default.yaml
  ...

The Lightning loggers config maintain a β€œmaster panel” that controls which loggers are applied and which are not. When a logger is not applied, its corresponding field in the master panel is set to null, or simply remove this field:

configs/lightning_loggers/default.yaml
defaults:
  - csv: default.yaml
  - tensorboard: default.yaml
  - comet: null # or simply remove this field
  - wandb: null # or simply remove this field
  - neptune: null # or simply remove this field
  - mlflow: null # or simply remove this field

Each logger is defined in its own sub-config:

configs/lightning_loggers/csv/default.yaml
_target_: lightning.pytorch.loggers.CSVLogger
save_dir: ${output_dir}

Supported Lightning Loggers & Required Config Fields

All Lightning built-in loggers are supported, including:

  • CSV Logger: CSVLogger
  • TensorBoard Logger: TensorBoardLogger
  • WandB Logger: WandbLogger
  • Neptune Logger: NeptuneLogger
  • MLFlow Logger: MLFlowLogger
  • Comet Logger: CometLogger

The _target_ field of each logger must be assigned to the corresponding class name, such as lightning.pytorch.loggers.CSVLogger for CSVLogger. Each logger has its own required fields, which are the same as the arguments of the class specified by _target_. The arguments of each logger class can be found in PyTorch Lightning documentation.

PyTorch Lightning Documentation (Built-In Loggers)

Note that some loggers also need additional setup, such as installing softwares, setting API keys. Please follow the instructions in the PyTorch Lightning documentation for each logger.

Back to top
Metrics
Callbacks
 
 

©️ 2025 Pengxiang Wang. All rights reserved.