class_docstr: CFLOW: Conditional Normalizing Flows.
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,
  ) -> None:
      super().__init__()
  
      self.backbone = backbone
      self.fiber_batch_size = fiber_batch_size
      self.condition_vector: int = condition_vector
      self.dec_arch = decoder
      self.pool_layers = layers
  
      self.encoder = FeatureExtractor(
          backbone=self.backbone,
          layers=self.pool_layers,
          pre_trained=pre_trained,
      )
      self.pool_dims = self.encoder.out_dims
      self.decoders = nn.ModuleList(
          [
              cflow_head(
                  condition_vector=self.condition_vector,
                  coupling_blocks=coupling_blocks,
                  clamp_alpha=clamp_alpha,
                  n_features=pool_dim,
                  permute_soft=permute_soft,
              )
              for pool_dim in self.pool_dims
          ]
      )
  
      # encoder model is fixed
      for parameters in self.encoder.parameters():
          parameters.requires_grad = False
  
      self.anomaly_map_generator = AnomalyMapGenerator(
          image_size=input_size, pool_layers=self.pool_layers
      )
  
file_path: anomalib/src/anomalib/models/cflow/torch_model.py
imports: from __future__ import annotations
  from typing import Any
  import einops
  import torch
  from torch import nn
  from anomalib.models.cflow.anomaly_map import AnomalyMapGenerator
  from anomalib.models.cflow.utils import cflow_head, get_logp, positional_encoding_2d
  from anomalib.models.components import FeatureExtractor
label_desc: Use image node_id 1 to create a new CflowModel object from inherited base classes: nn with example: obj = CflowModel(input_size, backbone, layers, pre_trained, fiber_batch_size, decoder, condition_vector, coupling_blocks, clamp_alpha, permute_soft)