log_gradient_norm
- parameter_norm(module: Module, norm_type: float | int | str, group_separator: str = '/', learnable_only=True) Dict[str, float][source]
Compute each parameter’s norm and their overall norm.
The overall norm is computed over all parameters together, as if they were concatenated into a single vector.
Based on
lightning.pytorch.utilities.grad_norm.- Parameters:
module –
torch.nn.Moduleto inspect.norm_type – The type of the used p-norm, cast to float if necessary. Can be
'inf'for infinity norm.group_separator – The separator string used by the logger to group the parameter norms in their own subfolder instead of the logs one.
learnable_only – Whether to only consider parameters that have a gradient.
- Returns:
- The dictionary of p-norms of each parameter and
a special entry for the total p-norm of the parameters viewed as a single vector.
- Return type:
norms