class_docstr: CFA: Coupled-hypersphere-based Feature Adaptation for Target-Oriented Anomaly Localization.
  
  Args:
      input_size (tuple[int, int]): Size of the model input.
      backbone (str): Backbone CNN network
      gamma_c (int, optional): gamma_c value from the paper. Defaults to 1.
      gamma_d (int, optional): gamma_d value from the paper. Defaults to 1.
      num_nearest_neighbors (int): Number of nearest neighbors.
      num_hard_negative_features (int): Number of hard negative features.
      radius (float): Radius of the hypersphere to search the soft boundary.
class_docstr_tok: ["CFA",":","Coupled-hypersphere-based","Feature","Adaptation","for","Target-Oriented","Anomaly","Localization",".","Args",":","input_size","(","tuple","[","int",",","int","]",")",":","Size","of","the","model","input",".","backbone","(","str",")",":","Backbone","CNN","network","gamma_c","(","int",",","optional",")",":","gamma_c","value","from","the","paper",".","Defaults","to","1.","gamma_d","(","int",",","optional",")",":","gamma_d","value","from","the","paper",".","Defaults","to","1.","num_nearest_neighbors","(","int",")",":","Number","of","nearest","neighbors",".","num_hard_negative_features","(","int",")",":","Number","of","hard","negative","features",".","radius","(","float",")",":","Radius","of","the","hypersphere","to","search","the","soft","boundary","."]
docstr: Validation step for the CFA model.
  
  Args:
      batch (dict[str, str | Tensor]): Input batch.
  
  Returns:
      dict: Anomaly map computed by the model.
docstr_tok: ["Validation","step","for","the","CFA","model",".","Args",":","batch","(","dict","[","str",",","str","|","Tensor","]",")",":","Input","batch",".","Returns",":","dict",":","Anomaly","map","computed","by","the","model","."]
code: def validation_step(
      self, batch: dict[str, str | Tensor], *args, **kwargs
  ) -> STEP_OUTPUT:
      """Validation step for the CFA model.
  
      Args:
          batch (dict[str, str | Tensor]): Input batch.
  
      Returns:
          dict: Anomaly map computed by the model.
      """
      del args, kwargs  # These variables are not used.
  
      batch["anomaly_maps"] = self.model(batch["image"])
      return batch
  
imports: from __future__ import annotations
  import logging
  import torch
  from omegaconf import DictConfig, ListConfig
  from pytorch_lightning import Callback
  from pytorch_lightning.callbacks import EarlyStopping
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from torch import Tensor
  from torch.optim.optimizer import Optimizer
  from anomalib.models.cfa.loss import CfaLoss
  from anomalib.models.cfa.torch_model import CfaModel
  from anomalib.models.components import AnomalyModule
label_desc: Use image node_id 4 for calling the Cfa obj's underlying member method code with example usage: obj.validation_step(batch) and returns: batch