class_docstr: PL Lightning Module for the GANomaly Algorithm.
  
  Args:
      batch_size (int): Batch size.
      input_size (tuple[int, int]): Input dimension.
      n_features (int): Number of features layers in the CNNs.
      latent_vec_size (int): Size of autoencoder latent vector.
      extra_layers (int, optional): Number of extra layers for encoder/decoder. Defaults to 0.
      add_final_conv_layer (bool, optional): Add convolution layer at the end. Defaults to True.
      wadv (int, optional): Weight for adversarial loss. Defaults to 1.
      wcon (int, optional): Image regeneration weight. Defaults to 50.
      wenc (int, optional): Latent vector encoder weight. Defaults to 1.
class_docstr_tok: ["PL","Lightning","Module","for","the","GANomaly","Algorithm",".","Args",":","batch_size","(","int",")",":","Batch","size",".","input_size","(","tuple","[","int",",","int","]",")",":","Input","dimension",".","n_features","(","int",")",":","Number","of","features","layers","in","the","CNNs",".","latent_vec_size","(","int",")",":","Size","of","autoencoder","latent","vector",".","extra_layers","(","int",",","optional",")",":","Number","of","extra","layers","for","encoder\/decoder",".","Defaults","to","0.","add_final_conv_layer","(","bool",",","optional",")",":","Add","convolution","layer","at","the","end",".","Defaults","to","True",".","wadv","(","int",",","optional",")",":","Weight","for","adversarial","loss",".","Defaults","to","1.","wcon","(","int",",","optional",")",":","Image","regeneration","weight",".","Defaults","to","50.","wenc","(","int",",","optional",")",":","Latent","vector","encoder","weight",".","Defaults","to","1","."]
docstr: Update min and max scores from the current step.
  
  Args:
      batch (dict[str, str | Tensor]): Predicted difference between z and z_hat.
  
  Returns:
      (STEP_OUTPUT): Output predictions.
docstr_tok: ["Update","min","and","max","scores","from","the","current","step",".","Args",":","batch","(","dict","[","str",",","str","|","Tensor","]",")",":","Predicted","difference","between","z","and","z_hat",".","Returns",":","(","STEP_OUTPUT",")",":","Output","predictions","."]
code: def validation_step(
      self, batch: dict[str, str | Tensor], *args, **kwargs
  ) -> STEP_OUTPUT:
      """Update min and max scores from the current step.
  
      Args:
          batch (dict[str, str | Tensor]): Predicted difference between z and z_hat.
  
      Returns:
          (STEP_OUTPUT): Output predictions.
      """
      batch["pred_scores"] = self.model(batch["image"])
      self.max_scores = max(
          self.max_scores, torch.max(batch["pred_scores"])
      )
      self.min_scores = min(
          self.min_scores, torch.min(batch["pred_scores"])
      )
      return batch
  
imports: from __future__ import annotations
  import logging
  import torch
  from omegaconf import DictConfig, ListConfig
  from pytorch_lightning.callbacks import Callback, EarlyStopping
  from pytorch_lightning.utilities.types import EPOCH_OUTPUT, STEP_OUTPUT
  from torch import Tensor, optim
  from anomalib.models.components import AnomalyModule
  from anomalib.models.ganomaly.loss import DiscriminatorLoss, GeneratorLoss
  from .torch_model import GanomalyModel
label_desc: Use image node_id 6 for calling the Ganomaly obj's underlying member method code with example usage: obj.validation_step(batch) and returns: batch