class_docstr: PL Lightning Module for the UFLOW algorithm.
class_docstr_tok: ["PL","Lightning","Module","for","the","UFLOW","algorithm","."]
docstr: Args:
      input_size (tuple[int, int]): Input image size.
      backbone (str): Backbone name.
      flow_steps (int): Number of flow steps.
      affine_clamp (float): Affine clamp.
      affine_subnet_channels_ratio (float): Affine subnet channels ratio.
      permute_soft (bool): Whether to use soft permutation.
docstr_tok: ["Args",":","input_size","(","tuple","[","int",",","int","]",")",":","Input","image","size",".","backbone","(","str",")",":","Backbone","name",".","flow_steps","(","int",")",":","Number","of","flow","steps",".","affine_clamp","(","float",")",":","Affine","clamp",".","affine_subnet_channels_ratio","(","float",")",":","Affine","subnet","channels","ratio",".","permute_soft","(","bool",")",":","Whether","to","use","soft","permutation","."]
code: def __init__(
      self,
      input_size: tuple[int, int],
      backbone: str,
      flow_steps: int = 4,
      affine_clamp: float = 2.0,
      affine_subnet_channels_ratio: float = 1.0,
      permute_soft: bool = False,
  ) -> None:
      """
      Args:
          input_size (tuple[int, int]): Input image size.
          backbone (str): Backbone name.
          flow_steps (int): Number of flow steps.
          affine_clamp (float): Affine clamp.
          affine_subnet_channels_ratio (float): Affine subnet channels ratio.
          permute_soft (bool): Whether to use soft permutation.
      """
      super().__init__()
      self.model: UflowModel = UflowModel(
          input_size=input_size,
          backbone=backbone,
          flow_steps=flow_steps,
          affine_clamp=affine_clamp,
          affine_subnet_channels_ratio=affine_subnet_channels_ratio,
          permute_soft=permute_soft,
      )
      self.loss = UFlowLoss()
  
file_path: anomalib/src/anomalib/models/uflow/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
  from anomalib.models.components import AnomalyModule
  from anomalib.models.uflow.loss import UFlowLoss
  from anomalib.models.uflow.torch_model import UflowModel
label_desc: Use image node_id 1 to create a new Uflow object from inherited base classes: AnomalyModule with example: obj = Uflow(input_size, backbone, flow_steps, affine_clamp, affine_subnet_channels_ratio, permute_soft)