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

Configure Lightning Loggers

Modified

October 9, 2025

Under the PyTorch Lightning framework, metrics collected by the 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 learn more from my article: A Summary of Continual Learning Metrics.

Each logger type is designed for a specific output, such as CSV files (by CSVLogger) or TensorBoard logs (by TensorBoardLogger). We can apply multiple loggers to produce different forms of output at the same time. Lightning provides the following built-in loggers: CSVLogger, TensorBoardLogger, WandbLogger, NeptuneLogger, MLFlowLogger, and CometLogger.

Lightning loggers are a sub-config under the index config of:

  • Continual learning main experiment and evaluation
  • Continual learning full experiment and the reference experiments
  • Continual unlearning main experiment and evaluation
  • Continual unlearning full experiment, the reference experiments and evaluation
  • Multi-task learning experiment and evaluation
  • Single-task learning experiment and evaluation

To configure custom loggers, create a YAML file in the lightning_loggers/ folder. Note that lightning loggers are shared in different continual learning tasks. Below is an example of the Lightning loggers config.

Example

configs
β”œβ”€β”€ __init__.py
β”œβ”€β”€ entrance.yaml
β”œβ”€β”€ index
β”‚   β”œβ”€β”€ example_cl_main_expr.yaml
β”‚   └── ...
β”œβ”€β”€ lightning_loggers
β”‚   β”œβ”€β”€ default.yaml
β”‚   β”œβ”€β”€ csv
β”‚   β”‚   └── default.yaml
β”‚   β”œβ”€β”€ tensorboard
β”‚   β”‚   └── default.yaml
β”‚   β”œβ”€β”€ wandb
β”‚   β”‚   └── default.yaml
...
example_configs/index/example_cl_main_expr.yaml
defaults:
  ...
  - /lightning_loggers: default.yaml
  ...

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

example_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:

example_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

To choose a logger, assign the _target_ field to the corresponding class name, such as lightning.pytorch.loggers.CSVLogger for CSVLogger. Each logger has its own hyperparameters and configurations, which means it has its own required fields. The required fields are the same as the arguments of the class specified by _target_. The arguments for each logger class can be found in the PyTorch Lightning documentation.

PyTorch Lightning Documentation (Built-In Loggers)

Note that some loggers require additional setup, such as installing software or 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.