class_docstr: Callback that standardizes the image-level and pixel-level anomaly scores.
class_docstr_tok: ["Callback","that","standardizes","the","image-level","and","pixel-level","anomaly","scores","."]
docstr: Adds training_distribution metrics to normalization metrics.
docstr_tok: ["Adds","training_distribution","metrics","to","normalization","metrics","."]
code: def setup(
      self,
      trainer: pl.Trainer,
      pl_module: AnomalyModule,
      stage: str | None = None,
  ) -> None:
      """Adds training_distribution metrics to normalization metrics."""
      del trainer, stage  # These variabels are not used.
  
      if not hasattr(pl_module, "normalization_metrics"):
          pl_module.normalization_metrics = (
              AnomalyScoreDistribution().cpu()
          )
      elif not isinstance(
          pl_module.normalization_metrics, AnomalyScoreDistribution
      ):
          raise AttributeError(
              f"Expected normalization_metrics to be of type AnomalyScoreDistribution,"
              f" got {type(pl_module.normalization_metrics)}"
          )
  
imports: from __future__ import annotations
  import logging
  from typing import Any
  import pytorch_lightning
  from pytorch_lightning import Callback, Trainer
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from torch.distributions import LogNormal
  from anomalib.models import get_model
  from anomalib.models.components import AnomalyModule
  from anomalib.post_processing.normalization.cdf import normalize, standardize
  from anomalib.utils.metrics import AnomalyScoreDistribution
label_desc: Use image node_id 2 for calling the CdfNormalizationCallback obj's underlying member method code with example usage: obj.setup(trainer, pl_module, stage) without return types