class_docstr: UnivNet Generator
  
  Originally from https://github.com/mindslab-ai/univnet/blob/master/model/generator.py.
class_docstr_tok: ["UnivNet","Generator","Originally","from","https",":","\/\/github.com\/mindslab-ai\/univnet\/blob\/master\/model\/generator.py","."]
code: def __init__(
      self,
      noise_dim=64,
      channel_size=32,
      dilations=[1, 3, 9, 27],
      strides=[8, 8, 4],
      lReLU_slope=0.2,
      kpnet_conv_size=3,
      # Below are MEL configurations options that this generator requires.
      hop_length=256,
      n_mel_channels=100,
  ):
      super(UnivNetGenerator, self).__init__()
      self.mel_channel = n_mel_channels
      self.noise_dim = noise_dim
      self.hop_length = hop_length
      channel_size = channel_size
      kpnet_conv_size = kpnet_conv_size
  
      self.res_stack = nn.ModuleList()
      hop_length = 1
      for stride in strides:
          hop_length = stride * hop_length
          self.res_stack.append(
              LVCBlock(
                  channel_size,
                  n_mel_channels,
                  stride=stride,
                  dilations=dilations,
                  lReLU_slope=lReLU_slope,
                  cond_hop_length=hop_length,
                  kpnet_conv_size=kpnet_conv_size,
              )
          )
  
      self.conv_pre = nn.utils.parametrizations.weight_norm(
          nn.Conv1d(
              noise_dim,
              channel_size,
              7,
              padding=3,
              padding_mode="reflect",
          )
      )
  
      self.conv_post = nn.Sequential(
          nn.LeakyReLU(lReLU_slope),
          nn.utils.parametrizations.weight_norm(
              nn.Conv1d(
                  channel_size, 1, 7, padding=3, padding_mode="reflect"
              )
          ),
          nn.Tanh(),
      )
  
imports: from dataclasses import dataclass
  from enum import Enum
  from typing import Callable, Optional
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.nn.utils.parametrize
label_desc: Use image node_id 1 to create a new UnivNetGenerator object from inherited base classes: nn with example: obj = UnivNetGenerator(noise_dim, channel_size, dilations, strides, lReLU_slope, kpnet_conv_size, hop_length, n_mel_channels)