class_docstr: PatchcoreLightning Module to train PatchCore 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
      pre_trained (bool, optional): Boolean to check whether to use a pre_trained backbone.
      coreset_sampling_ratio (float, optional): Coreset sampling ratio to subsample embedding.
          Defaults to 0.1.
      num_neighbors (int, optional): Number of nearest neighbors. Defaults to 9.
class_docstr_tok: ["PatchcoreLightning","Module","to","train","PatchCore","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","pre_trained","(","bool",",","optional",")",":","Boolean","to","check","whether","to","use","a","pre_trained","backbone",".","coreset_sampling_ratio","(","float",",","optional",")",":","Coreset","sampling","ratio","to","subsample","embedding",".","Defaults","to","0.1.","num_neighbors","(","int",",","optional",")",":","Number","of","nearest","neighbors",".","Defaults","to","9","."]
docstr: Generate feature embedding of the batch.
  
  Args:
      batch (dict[str, str | Tensor]): Batch containing image filename, image, label and mask
  
  Returns:
      dict[str, np.ndarray]: Embedding Vector
docstr_tok: ["Generate","feature","embedding","of","the","batch",".","Args",":","batch","(","dict","[","str",",","str","|","Tensor","]",")",":","Batch","containing","image","filename",",","image",",","label","and","mask","Returns",":","dict","[","str",",","np.ndarray","]",":","Embedding","Vector"]
code: def training_step(
      self, batch: dict[str, str | Tensor], *args, **kwargs
  ) -> None:
      """Generate feature embedding of the batch.
  
      Args:
          batch (dict[str, str | Tensor]): Batch containing image filename, image, label and mask
  
      Returns:
          dict[str, np.ndarray]: Embedding Vector
      """
      del args, kwargs  # These variables are not used.
  
      self.model.feature_extractor.eval()
      embedding = self.model(batch["image"])
  
      # NOTE: `self.embedding` appends each batch embedding to
      #   store the training set embedding. We manually append these
      #   values mainly due to the new order of hooks introduced after PL v1.4.0
      #   https://github.com/PyTorchLightning/pytorch-lightning/pull/7357
      self.embeddings.append(embedding)
  
file_path: anomalib/src/anomalib/models/patchcore/lightning_model.py
imports: from __future__ import annotations
  import logging
  import torch
  from omegaconf import DictConfig, ListConfig
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from torch import Tensor
  from anomalib.models.components import AnomalyModule
  from anomalib.models.patchcore.torch_model import PatchcoreModel
label_desc: Use image node_id 3 for calling the Patchcore obj's underlying member method code with example usage: obj.training_step(batch) without return types