class_docstr: NN module creating a fixed size prosody embedding from a spectrogram.
  
  inputs: mel spectrograms [batch_size, num_spec_frames, num_mel]
  outputs: [batch_size, embedding_dim]
class_docstr_tok: ["NN","module","creating","a","fixed","size","prosody","embedding","from","a","spectrogram",".","inputs",":","mel","spectrograms","[","batch_size",",","num_spec_frames",",","num_mel","]","outputs",":","[","batch_size",",","embedding_dim","]"]
code: def __init__(self, num_mel, embedding_dim):
      super().__init__()
      self.num_mel = num_mel
      filters = [1] + [32, 32, 64, 64, 128, 128]
      num_layers = len(filters) - 1
      convs = [
          nn.Conv2d(
              in_channels=filters[i],
              out_channels=filters[i + 1],
              kernel_size=(3, 3),
              stride=(2, 2),
              padding=(1, 1),
          )
          for i in range(num_layers)
      ]
      self.convs = nn.ModuleList(convs)
      self.bns = nn.ModuleList(
          [
              nn.BatchNorm2d(num_features=filter_size)
              for filter_size in filters[1:]
          ]
      )
  
      post_conv_height = self.calculate_post_conv_height(
          num_mel, 3, 2, 1, num_layers
      )
      self.recurrence = nn.GRU(
          input_size=filters[-1] * post_conv_height,
          hidden_size=embedding_dim // 2,
          batch_first=True,
      )
  
file_path: TTS/TTS/tts/layers/gst_layers.py
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new ReferenceEncoder object from inherited base classes: nn with example: obj = ReferenceEncoder(num_mel, embedding_dim)