class_docstr: This class implements the Cnn14 model from https://arxiv.org/abs/1912.10211
  
  Arguments
  ---------
  mel_bins : int
      Number of mel frequency bins in the input
  emb_dim : int
      The dimensionality of the output embeddings
  norm_type: str in ['bn', 'in', 'ln']
      The type of normalization
  return_reps: bool (default=False)
      If True the model returns intermediate representations as well for interpretation
  
  Example:
  --------
  >>> cnn14 = Cnn14(120, 256)
  >>> x = torch.rand(3, 400, 120)
  >>> h = cnn14.forward(x)
  >>> print(h.shape)
  torch.Size([3, 1, 256])
class_docstr_tok: ["This","class","implements","the","Cnn14","model","from","https",":","\/\/arxiv.org\/abs\/1912.10211","Arguments","--","--","--","--","-","mel_bins",":","int","Number","of","mel","frequency","bins","in","the","input","emb_dim",":","int","The","dimensionality","of","the","output","embeddings","norm_type",":","str","in","[","'bn","'",",","'in","'",",","'ln","'","]","The","type","of","normalization","return_reps",":","bool","(","default=False",")","If","True","the","model","returns","intermediate","representations","as","well","for","interpretation","Example",":","--","--","--","--",">",">",">","cnn14","=","Cnn14","(","120",",","256",")",">",">",">","x","=","torch.rand","(","3",",","400",",","120",")",">",">",">","h","=","cnn14.forward","(","x",")",">",">",">","print","(","h.shape",")","torch.Size","(","[","3",",","1",",","256","]",")"]
docstr: The forward pass for the CNN14 encoder
  
  Arguments:
  ----------
  x : torch.Tensor
      input tensor with shape B x C_in x D1 x D2
  where B = Batchsize
        C_in = Number of input channel
        D1 = Dimensionality of the first spatial dim
        D2 = Dimensionality of the second spatial dim
docstr_tok: ["The","forward","pass","for","the","CNN14","encoder","Arguments",":","--","--","--","--","--","x",":","torch.Tensor","input","tensor","with","shape","B","x","C_in","x","D1","x","D2","where","B","=","Batchsize","C_in","=","Number","of","input","channel","D1","=","Dimensionality","of","the","first","spatial","dim","D2","=","Dimensionality","of","the","second","spatial","dim"]
code: def forward(self, x):
      """
      The forward pass for the CNN14 encoder
  
      Arguments:
      ----------
      x : torch.Tensor
          input tensor with shape B x C_in x D1 x D2
      where B = Batchsize
            C_in = Number of input channel
            D1 = Dimensionality of the first spatial dim
            D2 = Dimensionality of the second spatial dim
      """
  
      if x.dim() == 3:
          x = x.unsqueeze(1)
      x = x.transpose(1, 3)
      x = self.norm0(x)
      x = x.transpose(1, 3)
  
      x = self.conv_block1(x, pool_size=(2, 2), pool_type="avg")
      x = F.dropout(x, p=0.2, training=self.training)
      x = self.conv_block2(x, pool_size=(2, 2), pool_type="avg")
      x = F.dropout(x, p=0.2, training=self.training)
      x = self.conv_block3(x, pool_size=(2, 2), pool_type="avg")
      x = F.dropout(x, p=0.2, training=self.training)
      x3_out = self.conv_block4(x, pool_size=(2, 2), pool_type="avg")
      x = F.dropout(x3_out, p=0.2, training=self.training)
      x2_out = self.conv_block5(x, pool_size=(2, 2), pool_type="avg")
      x = F.dropout(x2_out, p=0.2, training=self.training)
      x1_out = self.conv_block6(x, pool_size=(1, 1), pool_type="avg")
      x = F.dropout(x1_out, p=0.2, training=self.training)
      x = torch.mean(x, dim=3)
  
      (x1, _) = torch.max(x, dim=2)
      x2 = torch.mean(x, dim=2)
      x = x1 + x2
  
      # [B x 1 x emb_dim]
      if not self.return_reps:
          return x.unsqueeze(1)
  
      return x.unsqueeze(1), (x1_out, x2_out, x3_out)
  
file_path: speechbrain/speechbrain/lobes/models/Cnn14.py
imports: import torch.nn
  import torch.nn.functional
  import torch
label_desc: Use image node_id 3 for calling the Cnn14 obj's underlying member method code with example usage: obj.forward(x) and returns: x,  x1_out,  x2_out,  x3_out, x