class_docstr: PWGAN discriminator as in https://arxiv.org/abs/1910.11480.
  It classifies each audio window real/fake and returns a sequence
  of predictions.
      It is a stack of convolutional blocks with dilation.
code: def __init__(
      self,
      in_channels=1,
      out_channels=1,
      kernel_size=3,
      num_layers=10,
      conv_channels=64,
      dilation_factor=1,
      nonlinear_activation="LeakyReLU",
      nonlinear_activation_params={"negative_slope": 0.2},
      bias=True,
  ):
      super(ParallelWaveganDiscriminator, self).__init__()
      assert (
          kernel_size - 1
      ) % 2 == 0, " [!] does not support even number kernel size."
      assert dilation_factor > 0, " [!] dilation factor must be > 0."
      self.conv_layers = nn.ModuleList()
      conv_in_channels = in_channels
      for i in range(num_layers - 1):
          if i == 0:
              dilation = 1
          else:
              dilation = (
                  i if dilation_factor == 1 else dilation_factor**i
              )
              conv_in_channels = conv_channels
          padding = (kernel_size - 1) // 2 * dilation
          conv_layer = [
              nn.Conv1d(
                  conv_in_channels,
                  conv_channels,
                  kernel_size=kernel_size,
                  padding=padding,
                  dilation=dilation,
                  bias=bias,
              ),
              getattr(nn, nonlinear_activation)(
                  inplace=True, **nonlinear_activation_params
              ),
          ]
          self.conv_layers += conv_layer
      padding = (kernel_size - 1) // 2
      last_conv_layer = nn.Conv1d(
          conv_in_channels,
          out_channels,
          kernel_size=kernel_size,
          padding=padding,
          bias=bias,
      )
      self.conv_layers += [last_conv_layer]
      self.apply_weight_norm()
  
file_path: TTS/TTS/vocoder/models/parallel_wavegan_discriminator.py
imports: import math
  import torch
  from torch import nn
  from TTS.vocoder.layers.parallel_wavegan import ResidualBlock
label_desc: Use image node_id 1 to create a new ParallelWaveganDiscriminator object from inherited base classes: nn with example: obj = ParallelWaveganDiscriminator(in_channels, out_channels, kernel_size, num_layers, conv_channels, dilation_factor, nonlinear_activation, nonlinear_activation_params, bias)