class_docstr: PL Lightning Module for the STFPM algorithm.
  
  Args:
      input_size (tuple[int, int]): Size of the model input.
      backbone (str): Backbone CNN network
      layers (list[str]): Layers to extract features from the backbone CNN
class_docstr_tok: ["PL","Lightning","Module","for","the","STFPM","algorithm",".","Args",":","input_size","(","tuple","[","int",",","int","]",")",":","Size","of","the","model","input",".","backbone","(","str",")",":","Backbone","CNN","network","layers","(","list","[","str","]",")",":","Layers","to","extract","features","from","the","backbone","CNN"]
docstr: Validation Step of STFPM.
  
  Similar to the training step, student/teacher features are extracted from the CNN for each batch, and
  anomaly map is computed.
  
  Args:
    batch (dict[str, str | Tensor]): Input batch
  
  Returns:
    Dictionary containing images, anomaly maps, true labels and masks.
    These are required in `validation_epoch_end` for feature concatenation.
docstr_tok: ["Validation","Step","of","STFPM",".","Similar","to","the","training","step",",","student\/teacher","features","are","extracted","from","the","CNN","for","each","batch",",","and","anomaly","map","is","computed",".","Args",":","batch","(","dict","[","str",",","str","|","Tensor","]",")",":","Input","batch","Returns",":","Dictionary","containing","images",",","anomaly","maps",",","true","labels","and","masks",".","These","are","required","in","`","validation_epoch_end","`","for","feature","concatenation","."]
code: def validation_step(
      self, batch: dict[str, str | Tensor], *args, **kwargs
  ) -> STEP_OUTPUT:
      """Validation Step of STFPM.
  
      Similar to the training step, student/teacher features are extracted from the CNN for each batch, and
      anomaly map is computed.
  
      Args:
        batch (dict[str, str | Tensor]): Input batch
  
      Returns:
        Dictionary containing images, anomaly maps, true labels and masks.
        These are required in `validation_epoch_end` for feature concatenation.
      """
      del args, kwargs  # These variables are not used.
  
      batch["anomaly_maps"] = self.model(batch["image"])
      return batch
  
file_path: anomalib/src/anomalib/models/stfpm/lightning_model.py
imports: from __future__ import annotations
  import torch
  from omegaconf import DictConfig, ListConfig
  from pytorch_lightning.callbacks import EarlyStopping
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from torch import Tensor, optim
  from anomalib.models.components import AnomalyModule
  from anomalib.models.stfpm.loss import STFPMLoss
  from anomalib.models.stfpm.torch_model import STFPMModel
label_desc: Use image node_id 3 for calling the Stfpm obj's underlying member method code with example usage: obj.validation_step(batch) and returns: batch