class_docstr: HiFi-GAN multi-scale + multi-period discriminator module.
docstr: Initilize HiFiGAN multi-scale + multi-period discriminator module.
  
  Args:
      scales (int): Number of multi-scales.
      scale_downsample_pooling (str): Pooling module name for downsampling of the
          inputs.
      scale_downsample_pooling_params (dict): Parameters for the above pooling
          module.
      scale_discriminator_params (dict): Parameters for hifi-gan scale
          discriminator module.
      follow_official_norm (bool): Whether to follow the norm setting of the
          official implementaion. The first discriminator uses spectral norm and
          the other discriminators use weight norm.
      periods (list): List of periods.
      period_discriminator_params (dict): Parameters for hifi-gan period
          discriminator module. The period parameter will be overwritten.
docstr_tok: ["Initilize","HiFiGAN","multi-scale","+","multi-period","discriminator","module",".","Args",":","scales","(","int",")",":","Number","of","multi-scales",".","scale_downsample_pooling","(","str",")",":","Pooling","module","name","for","downsampling","of","the","inputs",".","scale_downsample_pooling_params","(","dict",")",":","Parameters","for","the","above","pooling","module",".","scale_discriminator_params","(","dict",")",":","Parameters","for","hifi-gan","scale","discriminator","module",".","follow_official_norm","(","bool",")",":","Whether","to","follow","the","norm","setting","of","the","official","implementaion",".","The","first","discriminator","uses","spectral","norm","and","the","other","discriminators","use","weight","norm",".","periods","(","list",")",":","List","of","periods",".","period_discriminator_params","(","dict",")",":","Parameters","for","hifi-gan","period","discriminator","module",".","The","period","parameter","will","be","overwritten","."]
code: def __init__(
      self,
      # Multi-scale discriminator related
      scales: int = 3,
      scale_downsample_pooling: str = "AvgPool1d",
      scale_downsample_pooling_params: Dict[str, Any] = {
          "kernel_size": 4,
          "stride": 2,
          "padding": 2,
      },
      scale_discriminator_params: Dict[str, Any] = {
          "in_channels": 1,
          "out_channels": 1,
          "kernel_sizes": [15, 41, 5, 3],
          "channels": 128,
          "max_downsample_channels": 1024,
          "max_groups": 16,
          "bias": True,
          "downsample_scales": [2, 2, 4, 4, 1],
          "nonlinear_activation": "LeakyReLU",
          "nonlinear_activation_params": {"negative_slope": 0.1},
      },
      follow_official_norm: bool = True,
      # Multi-period discriminator related
      periods: List[int] = [2, 3, 5, 7, 11],
      period_discriminator_params: Dict[str, Any] = {
          "in_channels": 1,
          "out_channels": 1,
          "kernel_sizes": [5, 3],
          "channels": 32,
          "downsample_scales": [3, 3, 3, 3, 1],
          "max_downsample_channels": 1024,
          "bias": True,
          "nonlinear_activation": "LeakyReLU",
          "nonlinear_activation_params": {"negative_slope": 0.1},
          "use_weight_norm": True,
          "use_spectral_norm": False,
      },
  ):
      """Initilize HiFiGAN multi-scale + multi-period discriminator module.
  
      Args:
          scales (int): Number of multi-scales.
          scale_downsample_pooling (str): Pooling module name for downsampling of the
              inputs.
          scale_downsample_pooling_params (dict): Parameters for the above pooling
              module.
          scale_discriminator_params (dict): Parameters for hifi-gan scale
              discriminator module.
          follow_official_norm (bool): Whether to follow the norm setting of the
              official implementaion. The first discriminator uses spectral norm and
              the other discriminators use weight norm.
          periods (list): List of periods.
          period_discriminator_params (dict): Parameters for hifi-gan period
              discriminator module. The period parameter will be overwritten.
  
      """
      super().__init__()
      self.msd = HiFiGANMultiScaleDiscriminator(
          scales=scales,
          downsample_pooling=scale_downsample_pooling,
          downsample_pooling_params=scale_downsample_pooling_params,
          discriminator_params=scale_discriminator_params,
          follow_official_norm=follow_official_norm,
      )
      self.mpd = HiFiGANMultiPeriodDiscriminator(
          periods=periods,
          discriminator_params=period_discriminator_params,
      )
  
imports: import copy
  import logging
  from typing import Any, Dict, List, Optional
  import numpy
  import torch
  import torch.nn.functional
  from espnet2.gan_tts.hifigan.residual_block import ResidualBlock
label_desc: Use image node_id 1 to create a new HiFiGANMultiScaleMultiPeriodDiscriminator object from inherited base classes: torch.nn with example: obj = HiFiGANMultiScaleMultiPeriodDiscriminator(scales, scale_downsample_pooling, scale_downsample_pooling_params, scale_discriminator_params, follow_official_norm, periods, period_discriminator_params)