class_docstr: Discriminator.
  
      Made of only one encoder layer which takes x and x_hat to produce a score.
  
  Args:
      input_size (tuple[int, int]): Input image size.
      num_input_channels (int): Number of image channels.
      n_features (int): Number of feature maps in each convolution layer.
      extra_layers (int, optional): Add extra intermediate layers. Defaults to 0.
class_docstr_tok: ["Discriminator",".","Made","of","only","one","encoder","layer","which","takes","x","and","x_hat","to","produce","a","score",".","Args",":","input_size","(","tuple","[","int",",","int","]",")",":","Input","image","size",".","num_input_channels","(","int",")",":","Number","of","image","channels",".","n_features","(","int",")",":","Number","of","feature","maps","in","each","convolution","layer",".","extra_layers","(","int",",","optional",")",":","Add","extra","intermediate","layers",".","Defaults","to","0","."]
code: def __init__(
      self,
      input_size: tuple[int, int],
      num_input_channels: int,
      n_features: int,
      extra_layers: int = 0,
  ) -> None:
      super().__init__()
      encoder = Encoder(
          input_size, 1, num_input_channels, n_features, extra_layers
      )
      layers = []
      for block in encoder.children():
          if isinstance(block, nn.Sequential):
              layers.extend(list(block.children()))
          else:
              layers.append(block)
  
      self.features = nn.Sequential(*layers[:-1])
      self.classifier = nn.Sequential(layers[-1])
      self.classifier.add_module("Sigmoid", nn.Sigmoid())
  
imports: from __future__ import annotations
  import math
  import torch
  from torch import Tensor, nn
  from anomalib.data.utils.image import pad_nextpow2
label_desc: Use image node_id 1 to create a new Discriminator object from inherited base classes: nn with example: obj = Discriminator(input_size, num_input_channels, n_features, extra_layers)