Shortcuts

fbresearch_logger#

FBResearch logger and its helper handlers.

Classes

FBResearchLogger

Logs training and validation metrics for research purposes.

class ignite.handlers.fbresearch_logger.FBResearchLogger(logger, delimiter='  ', show_output=False)[source]#

Logs training and validation metrics for research purposes.

This logger is designed to attach to an Ignite Engine and log various metrics and system stats at configurable intervals, including learning rates, iteration times, and GPU memory usage.

Parameters
  • logger (Any) – The logger to use for output.

  • delimiter (str) – The delimiter to use between metrics in the log output.

  • show_output (bool) – Flag to enable logging of the output from the engine’s process function.

Examples

import logging
from ignite.handlers.fbresearch_logger import *

logger = FBResearchLogger(logger=logging.Logger(__name__), show_output=True)
logger.attach(trainer, name="Train", every=10, optimizer=my_optimizer)
attach(engine, name, every=1, optimizer=None)[source]#

Attaches all the logging handlers to the given engine.

Parameters
  • engine (Engine) – The engine to attach the logging handlers to.

  • name (str) – The name of the engine (e.g., “Train”, “Validate”) to include in log messages.

  • every (int) – Frequency of iterations to log information. Logs are generated every ‘every’ iterations.

  • optimizer (Optional[Optimizer]) – The optimizer used during training to log current learning rates.

Return type

None

log_completed(engine, name)[source]#

Logs the completion of a run.

Parameters
  • engine (Engine) – The engine object representing the training/validation loop.

  • name (str) – The name of the run.

Return type

None

log_epoch_completed(engine, name)[source]#

Logs the completion of an epoch.

Parameters
  • engine (Engine) – The engine object that triggered the event.

  • name (str) – The name of the event.

Returns

None

Return type

None

log_epoch_started(engine, name)[source]#

Logs the start of an epoch.

Parameters
  • engine (Engine) – The engine object.

  • name (str) – The name of the epoch.

Return type

None

log_every(engine, optimizer=None)[source]#

Logs the training progress at regular intervals.

Parameters
  • engine (Engine) – The training engine.

  • optimizer (Optional[Optimizer]) – The optimizer used for training. Defaults to None.

Return type

None