class_docstr: PL Lightning Module for the FastFlow algorithm.
  
  Args:
      input_size (tuple[int, int]): Model input size.
      backbone (str): Backbone CNN network
      pre_trained (bool, optional): Boolean to check whether to use a pre_trained backbone.
      flow_steps (int, optional): Flow steps.
      conv3x3_only (bool, optinoal): Use only conv3x3 in fast_flow model. Defaults to False.
      hidden_ratio (float, optional): Ratio to calculate hidden var channels. Defaults to 1.0.
class_docstr_tok: ["PL","Lightning","Module","for","the","FastFlow","algorithm",".","Args",":","input_size","(","tuple","[","int",",","int","]",")",":","Model","input","size",".","backbone","(","str",")",":","Backbone","CNN","network","pre_trained","(","bool",",","optional",")",":","Boolean","to","check","whether","to","use","a","pre_trained","backbone",".","flow_steps","(","int",",","optional",")",":","Flow","steps",".","conv3x3_only","(","bool",",","optinoal",")",":","Use","only","conv3x3","in","fast_flow","model",".","Defaults","to","False",".","hidden_ratio","(","float",",","optional",")",":","Ratio","to","calculate","hidden","var","channels",".","Defaults","to","1.0","."]
docstr: Forward-pass input and return the loss.
  
  Args:
      batch (batch: dict[str, str | Tensor]): Input batch
      _batch_idx: Index of the batch.
  
  Returns:
      STEP_OUTPUT: Dictionary containing the loss value.
docstr_tok: ["Forward-pass","input","and","return","the","loss",".","Args",":","batch","(","batch",":","dict","[","str",",","str","|","Tensor","]",")",":","Input","batch","_batch_idx",":","Index","of","the","batch",".","Returns",":","STEP_OUTPUT",":","Dictionary","containing","the","loss","value","."]
code: def training_step(
      self, batch: dict[str, str | Tensor], *args, **kwargs
  ) -> STEP_OUTPUT:
      """Forward-pass input and return the loss.
  
      Args:
          batch (batch: dict[str, str | Tensor]): Input batch
          _batch_idx: Index of the batch.
  
      Returns:
          STEP_OUTPUT: Dictionary containing the loss value.
      """
      del args, kwargs  # These variables are not used.
  
      hidden_variables, jacobians = self.model(batch["image"])
      loss = self.loss(hidden_variables, jacobians)
      self.log(
          "train_loss",
          loss.item(),
          on_epoch=True,
          prog_bar=True,
          logger=True,
      )
      return {"loss": loss}
  
file_path: anomalib/src/anomalib/models/fastflow/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.fastflow.loss import FastflowLoss
  from anomalib.models.fastflow.torch_model import FastflowModel
label_desc: Use image node_id 2 for calling the Fastflow obj's underlying member method code with example usage: obj.training_step(batch) and returns: dict