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","."]
code: def __init__(
      self,
      input_size: tuple[int, int],
      backbone: str,
      pre_trained: bool = True,
      flow_steps: int = 8,
      conv3x3_only: bool = False,
      hidden_ratio: float = 1.0,
  ) -> None:
      super().__init__()
  
      self.model = FastflowModel(
          input_size=input_size,
          backbone=backbone,
          pre_trained=pre_trained,
          flow_steps=flow_steps,
          conv3x3_only=conv3x3_only,
          hidden_ratio=hidden_ratio,
      )
      self.loss = FastflowLoss()
  
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 1 to create a new Fastflow object from inherited base classes: AnomalyModule with example: obj = Fastflow(input_size, backbone, pre_trained, flow_steps, conv3x3_only, hidden_ratio)