class_docstr: Callback that normalizes the image-level and pixel-level anomaly scores using min-max normalization.
class_docstr_tok: ["Callback","that","normalizes","the","image-level","and","pixel-level","anomaly","scores","using","min-max","normalization","."]
docstr: Called when the validation batch ends, update the min and max observed values.
docstr_tok: ["Called","when","the","validation","batch","ends",",","update","the","min","and","max","observed","values","."]
code: def on_validation_batch_end(
      self,
      trainer: pl.Trainer,
      pl_module: AnomalyModule,
      outputs: STEP_OUTPUT,
      batch: Any,
      batch_idx: int,
      dataloader_idx: int,
  ) -> None:
      """Called when the validation batch ends, update the min and max observed values."""
      del (
          trainer,
          batch,
          batch_idx,
          dataloader_idx,
      )  # These variables are not used.
  
      if "anomaly_maps" in outputs:
          pl_module.normalization_metrics(outputs["anomaly_maps"])
      elif "box_scores" in outputs:
          pl_module.normalization_metrics(
              torch.cat(outputs["box_scores"])
          )
      elif "pred_scores" in outputs:
          pl_module.normalization_metrics(outputs["pred_scores"])
      else:
          raise ValueError(
              "No values found for normalization, provide anomaly maps, bbox scores, or image scores"
          )
  
file_path: anomalib/src/anomalib/utils/callbacks/min_max_normalization.py
imports: from __future__ import annotations
  from typing import Any
  import pytorch_lightning
  import torch
  from pytorch_lightning import Callback
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from anomalib.models.components import AnomalyModule
  from anomalib.post_processing.normalization.min_max import normalize
  from anomalib.utils.metrics import MinMax
label_desc: Use image node_id 3 for calling the MinMaxNormalizationCallback obj's underlying member method code with example usage: obj.on_validation_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx) without return types