Shortcuts

ModelSummary

class pytorch_lightning.callbacks.ModelSummary(max_depth=1)[source]

Bases: pytorch_lightning.callbacks.base.Callback

Generates a summary of all layers in a LightningModule.

Parameters

max_depth (int) – The maximum depth of layer nesting that the summary will include. A value of 0 turns the layer summary off.

Example:

>>> from pytorch_lightning import Trainer
>>> from pytorch_lightning.callbacks import ModelSummary
>>> trainer = Trainer(callbacks=[ModelSummary(max_depth=1)])
on_pretrain_routine_start(trainer, pl_module)[source]

Called when the pretrain routine begins.

Return type

None