class_docstr: Duration_Encoder module of Spectrogram prediction network.
  
  This is a module of encoder of Spectrogram prediction network in Singing-Tacotron,
  This is the encoder which converts the sequence
  of durations and tempo features into a transition token.
  
  .. _`SINGING-TACOTRON: GLOBAL DURATION CONTROL ATTENTION AND DYNAMIC FILTER FOR
  END-TO-END SINGING VOICE SYNTHESIS`:
     https://arxiv.org/abs/2202.07907
class_docstr_tok: ["Duration_Encoder","module","of","Spectrogram","prediction","network",".","This","is","a","module","of","encoder","of","Spectrogram","prediction","network","in","Singing-Tacotron",",","This","is","the","encoder","which","converts","the","sequence","of","durations","and","tempo","features","into","a","transition","token",".","..","_","`","SINGING-TACOTRON",":","GLOBAL","DURATION","CONTROL","ATTENTION","AND","DYNAMIC","FILTER","FOR","END-TO-END","SINGING","VOICE","SYNTHESIS","`",":","https",":","\/\/arxiv.org\/abs\/2202.07907"]
docstr: Initialize Singing-Tacotron encoder module.
  
  Args:
      idim (int) Dimension of the inputs.
      embed_dim (int, optional) Dimension of character embedding.
      dropout_rate (float, optional) Dropout rate.
docstr_tok: ["Initialize","Singing-Tacotron","encoder","module",".","Args",":","idim","(","int",")","Dimension","of","the","inputs",".","embed_dim","(","int",",","optional",")","Dimension","of","character","embedding",".","dropout_rate","(","float",",","optional",")","Dropout","rate","."]
code: def __init__(
      self,
      idim,
      embed_dim=512,
      dropout_rate=0.5,
      padding_idx=0,
  ):
      """Initialize Singing-Tacotron encoder module.
  
      Args:
          idim (int) Dimension of the inputs.
          embed_dim (int, optional) Dimension of character embedding.
          dropout_rate (float, optional) Dropout rate.
  
      """
      super(Duration_Encoder, self).__init__()
      # store the hyperparameters
      self.idim = idim
  
      # define network layer modules
      self.dense24 = torch.nn.Linear(idim, 24)
      self.convs = torch.nn.Sequential(
          torch.nn.ReLU(),
          torch.nn.Conv1d(
              24,
              32,
              3,
              stride=1,
              bias=False,
              padding=2 // 2,
          ),
          torch.nn.ReLU(),
          torch.nn.Conv1d(
              32,
              32,
              3,
              stride=1,
              bias=False,
              padding=2 // 2,
          ),
          torch.nn.ReLU(),
      )
      self.dense1 = torch.nn.Linear(32, 1)
      self.nntanh = torch.nn.Tanh()
  
      # initialize
      self.apply(encoder_init)
  
file_path: espnet/espnet2/svs/singing_tacotron/encoder.py
imports: import torch
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
label_desc: Use image node_id 1 to create a new Duration_Encoder object from inherited base classes: torch.nn with example: obj = Duration_Encoder(idim, embed_dim, dropout_rate, padding_idx)