class_docstr: Metric estimator for enhancement training.
  
  Consists of:
   * four 2d conv layers
   * channel averaging
   * three linear layers
  
  Arguments
  ---------
  kernel_size : tuple
      The dimensions of the 2-d kernel used for convolution.
  base_channels : int
      Number of channels used in each conv layer.
  lin_dim1: int
      Dimensionality of the first linear layer.
  lin_dim2: int
      Dimensionality of the second linear layer.
  
  
  Example
  -------
  >>> inputs = torch.rand([1, 1, 100, 257])
  >>> model = MetricDiscriminator()
  >>> outputs = model(inputs)
  >>> outputs.shape
  torch.Size([1, 1])
class_docstr_tok: ["Metric","estimator","for","enhancement","training",".","Consists","of",":","*","four","2d","conv","layers","*","channel","averaging","*","three","linear","layers","Arguments","--","--","--","--","-","kernel_size",":","tuple","The","dimensions","of","the","2-d","kernel","used","for","convolution",".","base_channels",":","int","Number","of","channels","used","in","each","conv","layer",".","lin_dim1",":","int","Dimensionality","of","the","first","linear","layer",".","lin_dim2",":","int","Dimensionality","of","the","second","linear","layer",".","Example","--","--","--","-",">",">",">","inputs","=","torch.rand","(","[","1",",","1",",","100",",","257","]",")",">",">",">","model","=","MetricDiscriminator","(",")",">",">",">","outputs","=","model","(","inputs",")",">",">",">","outputs.shape","torch.Size","(","[","1",",","1","]",")"]
code: def __init__(
      self,
      kernel_size=(5, 5),
      base_channels=15,
      activation=nn.LeakyReLU,
      lin_dim1=50,
      lin_dim2=10,
  ):
      super().__init__()
  
      self.activation = activation(negative_slope=0.3)
  
      self.BN = nn.BatchNorm2d(num_features=1, momentum=0.01)
  
      self.conv1 = xavier_init_layer(
          1,
          base_channels,
          layer_type=nn.Conv2d,
          kernel_size=kernel_size,
      )
      self.conv2 = xavier_init_layer(
          base_channels, layer_type=nn.Conv2d, kernel_size=kernel_size
      )
      self.conv3 = xavier_init_layer(
          base_channels, layer_type=nn.Conv2d, kernel_size=kernel_size
      )
      self.conv4 = xavier_init_layer(
          base_channels, layer_type=nn.Conv2d, kernel_size=kernel_size
      )
  
      self.Linear1 = xavier_init_layer(base_channels, out_size=lin_dim1)
      self.Linear2 = xavier_init_layer(
          in_size=lin_dim1, out_size=lin_dim2
      )
      self.Linear3 = xavier_init_layer(in_size=lin_dim2, out_size=1)
  
file_path: speechbrain/speechbrain/lobes/models/MetricGAN_U.py
imports: import torch
  import speechbrain
  from torch import nn
  from torch.nn.utils import spectral_norm
label_desc: Use image node_id 1 to create a new MetricDiscriminator object from inherited base classes: nn with example: obj = MetricDiscriminator(kernel_size, base_channels, activation, lin_dim1, lin_dim2)