class_docstr: Prenet module for decoder of Spectrogram prediction network.
  
  This is a module of Prenet in the decoder of Spectrogram prediction network,
  which described in `Natural TTS
  Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions`_.
  The Prenet preforms nonlinear conversion
  of inputs before input to auto-regressive lstm,
  which helps to learn diagonal attentions.
  
  Note:
      This module alway applies dropout even in evaluation.
      See the detail in `Natural TTS Synthesis by
      Conditioning WaveNet on Mel Spectrogram Predictions`_.
  
  .. _`Natural TTS Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions`:
     https://arxiv.org/abs/1712.05884
docstr: Initialize prenet module.
  
  Args:
      idim (int): Dimension of the inputs.
      odim (int): Dimension of the outputs.
      n_layers (int, optional): The number of prenet layers.
      n_units (int, optional): The number of prenet units.
docstr_tok: ["Initialize","prenet","module",".","Args",":","idim","(","int",")",":","Dimension","of","the","inputs",".","odim","(","int",")",":","Dimension","of","the","outputs",".","n_layers","(","int",",","optional",")",":","The","number","of","prenet","layers",".","n_units","(","int",",","optional",")",":","The","number","of","prenet","units","."]
code: def __init__(self, idim, n_layers=2, n_units=256, dropout_rate=0.5):
      """Initialize prenet module.
  
      Args:
          idim (int): Dimension of the inputs.
          odim (int): Dimension of the outputs.
          n_layers (int, optional): The number of prenet layers.
          n_units (int, optional): The number of prenet units.
  
      """
      super(Prenet, self).__init__()
      self.dropout_rate = dropout_rate
      self.prenet = torch.nn.ModuleList()
      for layer in range(n_layers):
          n_inputs = idim if layer == 0 else n_units
          self.prenet += [
              torch.nn.Sequential(
                  torch.nn.Linear(n_inputs, n_units), torch.nn.ReLU()
              )
          ]
  
imports: import torch
  import torch.nn.functional
  from espnet.nets.pytorch_backend.rnn.attentions import AttForwardTA
label_desc: Use image node_id 1 to create a new Prenet object from inherited base classes: torch.nn with example: obj = Prenet(idim, n_layers, n_units, dropout_rate)