class_docstr: PL Lightning Module for the CFLOW algorithm.
class_docstr_tok: ["PL","Lightning","Module","for","the","CFLOW","algorithm","."]
code: def __init__(
      self,
      input_size: tuple[int, int],
      backbone: str,
      layers: list[str],
      pre_trained: bool = True,
      fiber_batch_size: int = 64,
      decoder: str = "freia-cflow",
      condition_vector: int = 128,
      coupling_blocks: int = 8,
      clamp_alpha: float = 1.9,
      permute_soft: bool = False,
      lr: float = 0.0001,
  ) -> None:
      super().__init__()
  
      self.model: CflowModel = CflowModel(
          input_size=input_size,
          backbone=backbone,
          pre_trained=pre_trained,
          layers=layers,
          fiber_batch_size=fiber_batch_size,
          decoder=decoder,
          condition_vector=condition_vector,
          coupling_blocks=coupling_blocks,
          clamp_alpha=clamp_alpha,
          permute_soft=permute_soft,
      )
      self.automatic_optimization = False
      # TODO: LR should be part of optimizer in config.yaml! Since cflow has custom
      #   optimizer this is to be addressed later.
      self.learning_rate = lr
  
imports: from __future__ import annotations
  import einops
  import torch
  import torch.nn.functional
  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 torch.optim import Optimizer
  from anomalib.models.cflow.torch_model import CflowModel
  from anomalib.models.cflow.utils import get_logp, positional_encoding_2d
  from anomalib.models.components import AnomalyModule
label_desc: Use image node_id 1 to create a new Cflow object from inherited base classes: AnomalyModule with example: obj = Cflow(input_size, backbone, layers, pre_trained, fiber_batch_size, decoder, condition_vector, coupling_blocks, clamp_alpha, permute_soft, lr)