sub_model_summary
- class SubModelSummary(max_depth: int = 1, path_in_model: str = None, **summarize_kwargs: Any)[source]
Generates a summary of all layers in a submodule of a
LightningModule.- __init__(max_depth: int = 1, path_in_model: str = None, **summarize_kwargs: Any) None[source]
Generates a summary of all layers in a submodule of a
LightningModule.- Parameters:
max_depth – The maximum depth of layer nesting that the summary will include. A value of 0 turns the layer summary off.
path_in_model – The path to the submodule of interest. Defaults to None, which will summarize the entire model.
**summarize_kwargs – Additional arguments to pass to the summarize method.
Example:
>>> from lightning.pytorch import Trainer >>> from lightning.pytorch.callbacks import ModelSummary >>> trainer = Trainer(callbacks=[SubModelSummary(max_depth=1, path_in_model="net.submodule_of_interest")]) This will summarize ``pl_module.net.submodule_of_interest``.
- summarize(summary_data: List[Tuple[str, List[str]]], total_parameters: int, trainable_parameters: int, model_size: float, total_training_modes: Dict[str, int] = None, **summarize_kwargs: Any) None[source]
Adapted summarize method which filters the summary_data to only include rows in
self.path_in_model.