class_docstr: Random Window Discriminator as described in
  http://arxiv.org/abs/1909.11646
code: def __init__(
      self,
      cond_channels,
      hop_length,
      uncond_disc_donwsample_factors=(8, 4),
      cond_disc_downsample_factors=(
          (8, 4, 2, 2, 2),
          (8, 4, 2, 2),
          (8, 4, 2),
          (8, 4),
          (4, 2, 2),
      ),
      cond_disc_out_channels=(
          (128, 128, 256, 256),
          (128, 256, 256),
          (128, 256),
          (256,),
          (128, 256),
      ),
      window_sizes=(512, 1024, 2048, 4096, 8192),
  ):
      super(RandomWindowDiscriminator, self).__init__()
      self.cond_channels = cond_channels
      self.window_sizes = window_sizes
      self.hop_length = hop_length
      self.base_window_size = self.hop_length * 2
      self.ks = [ws // self.base_window_size for ws in window_sizes]
  
      # check arguments
      assert (
          len(cond_disc_downsample_factors)
          == len(cond_disc_out_channels)
          == len(window_sizes)
      )
      for ws in window_sizes:
          assert ws % hop_length == 0
  
      for idx, cf in enumerate(cond_disc_downsample_factors):
          assert np.prod(cf) == hop_length // self.ks[idx]
  
      # define layers
      self.unconditional_discriminators = nn.ModuleList([])
      for k in self.ks:
          layer = UnconditionalDiscriminator(
              in_channels=k,
              base_channels=64,
              downsample_factors=uncond_disc_donwsample_factors,
          )
          self.unconditional_discriminators.append(layer)
  
      self.conditional_discriminators = nn.ModuleList([])
      for idx, k in enumerate(self.ks):
          layer = ConditionalDiscriminator(
              in_channels=k,
              cond_channels=cond_channels,
              downsample_factors=cond_disc_downsample_factors[idx],
              out_channels=cond_disc_out_channels[idx],
          )
          self.conditional_discriminators.append(layer)
  
imports: import numpy
  from torch import nn
label_desc: Use image node_id 1 to create a new RandomWindowDiscriminator object from inherited base classes: nn with example: obj = RandomWindowDiscriminator(cond_channels, hop_length, uncond_disc_donwsample_factors, cond_disc_downsample_factors, cond_disc_out_channels, window_sizes)