class_docstr: Ganomaly Model.
  
  Args:
      input_size (tuple[int, int]): Input dimension.
      num_input_channels (int): Number of input channels.
      n_features (int): Number of features layers in the CNNs.
      latent_vec_size (int): Size of autoencoder latent vector.
      extra_layers (int, optional): Number of extra layers for encoder/decoder. Defaults to 0.
      add_final_conv_layer (bool, optional): Add convolution layer at the end. Defaults to True.
class_docstr_tok: ["Ganomaly","Model",".","Args",":","input_size","(","tuple","[","int",",","int","]",")",":","Input","dimension",".","num_input_channels","(","int",")",":","Number","of","input","channels",".","n_features","(","int",")",":","Number","of","features","layers","in","the","CNNs",".","latent_vec_size","(","int",")",":","Size","of","autoencoder","latent","vector",".","extra_layers","(","int",",","optional",")",":","Number","of","extra","layers","for","encoder\/decoder",".","Defaults","to","0.","add_final_conv_layer","(","bool",",","optional",")",":","Add","convolution","layer","at","the","end",".","Defaults","to","True","."]
code: def __init__(
      self,
      input_size: tuple[int, int],
      num_input_channels: int,
      n_features: int,
      latent_vec_size: int,
      extra_layers: int = 0,
      add_final_conv_layer: bool = True,
  ) -> None:
      super().__init__()
      self.generator: Generator = Generator(
          input_size=input_size,
          latent_vec_size=latent_vec_size,
          num_input_channels=num_input_channels,
          n_features=n_features,
          extra_layers=extra_layers,
          add_final_conv_layer=add_final_conv_layer,
      )
      self.discriminator: Discriminator = Discriminator(
          input_size=input_size,
          num_input_channels=num_input_channels,
          n_features=n_features,
          extra_layers=extra_layers,
      )
      self.weights_init(self.generator)
      self.weights_init(self.discriminator)
  
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 GanomalyModel object from inherited base classes: nn with example: obj = GanomalyModel(input_size, num_input_channels, n_features, latent_vec_size, extra_layers, add_final_conv_layer)