code: def cflow_head(
      condition_vector: int,
      coupling_blocks: int,
      clamp_alpha: float,
      n_features: int,
      permute_soft: bool = False,
  ) -> SequenceINN:
      """Create invertible decoder network.
  
      Args:
          condition_vector (int): length of the condition vector
          coupling_blocks (int): number of coupling blocks to build the decoder
          clamp_alpha (float): clamping value to avoid exploding values
          n_features (int): number of decoder features
          permute_soft (bool): Whether to sample the permutation matrix :math:`R` from :math:`SO(N)`,
              or to use hard permutations instead. Note, ``permute_soft=True`` is very slow
              when working with >512 dimensions.
  
      Returns:
          SequenceINN: decoder network block
      """
      coder = SequenceINN(n_features)
      logger.info("CNF coder: %d", n_features)
      for _ in range(coupling_blocks):
          coder.append(
              AllInOneBlock,
              cond=0,
              cond_shape=(condition_vector,),
              subnet_constructor=subnet_fc,
              affine_clamping=clamp_alpha,
              global_affine_type="SOFTPLUS",
              permute_soft=permute_soft,
          )
      return coder
  
file_path: anomalib/src/anomalib/models/cflow/utils.py
imports: from __future__ import annotations
  import logging
  import math
  import numpy
  import torch
  from FrEIA.framework import SequenceINN
  from torch import Tensor, nn
  from anomalib.models.components.flow import AllInOneBlock
label_desc: Use image node_id 4 for calling a global function with example usage: cflow_head(condition_vector, coupling_blocks, clamp_alpha, n_features, permute_soft) and returns: coder