Skip to content

Data Stats Callback

Source

Data statistics callback.

DataStatsCallback

Bases: Callback

Callback to update model's data statistics from datamodule.

This callback ensures that the model has access to the data statistics (mean, std) calculated by the datamodule before training starts.

setup(trainer, module, stage)

Called when trainer is setting up.

Parameters:

  • trainer (Trainer) –

    PyTorch Lightning trainer.

  • module (LightningModule) –

    Lightning module.

  • stage (str) –

    Current stage (fit, validate, test, or predict).