def _extract_weight_decay(self, param_group: dict[str, Any], name: str) -> dict[str, Any]:
        """Extracts the weight decay statistics from a parameter group."""
        if not self.log_weight_decay:
            return {}

        weight_decay = param_group["weight_decay"]
        self.last_weight_decay_values[name] = weight_decay
        return {name: weight_decay}
Extracts the weight decay statistics from a parameter group.
src/lightning/pytorch/callbacks/lr_monitor.py