class_docstr: Simple LSTM for enhancement with custom initialization.
  
  Arguments
  ---------
  input_size : int
      Size of the input tensor's last dimension.
  hidden_size : int
      Number of neurons to use in the LSTM layers.
  num_layers : int
      Number of layers to use in the LSTM.
  lin_dim: int
      Number of neurons in the last two linear layers.
  dropout : int
      Fraction of neurons to drop during training.
  
  Example
  -------
  >>> inputs = torch.rand([10, 100, 40])
  >>> model = EnhancementGenerator(input_size=40, hidden_size=50)
  >>> outputs = model(inputs, lengths=torch.ones([10]))
  >>> outputs.shape
  torch.Size([10, 100, 40])
class_docstr_tok: ["Simple","LSTM","for","enhancement","with","custom","initialization",".","Arguments","--","--","--","--","-","input_size",":","int","Size","of","the","input","tensor","'s","last","dimension",".","hidden_size",":","int","Number","of","neurons","to","use","in","the","LSTM","layers",".","num_layers",":","int","Number","of","layers","to","use","in","the","LSTM",".","lin_dim",":","int","Number","of","neurons","in","the","last","two","linear","layers",".","dropout",":","int","Fraction","of","neurons","to","drop","during","training",".","Example","--","--","--","-",">",">",">","inputs","=","torch.rand","(","[","10",",","100",",","40","]",")",">",">",">","model","=","EnhancementGenerator","(","input_size=40",",","hidden_size=50",")",">",">",">","outputs","=","model","(","inputs",",","lengths=torch.ones","(","[","10","]",")",")",">",">",">","outputs.shape","torch.Size","(","[","10",",","100",",","40","]",")"]
code: def __init__(
      self,
      input_size=257,
      hidden_size=200,
      num_layers=2,
      lin_dim=300,
      dropout=0,
  ):
      super().__init__()
      self.activation = nn.LeakyReLU(negative_slope=0.3)
  
      self.blstm = sb.nnet.RNN.LSTM(
          input_size=input_size,
          hidden_size=hidden_size,
          num_layers=num_layers,
          dropout=dropout,
          bidirectional=True,
      )
      """
          Use orthogonal init for recurrent layers, xavier uniform for input layers
          Bias is 0
          """
      for name, param in self.blstm.named_parameters():
          if "bias" in name:
              nn.init.zeros_(param)
          elif "weight_ih" in name:
              nn.init.xavier_uniform_(param)
          elif "weight_hh" in name:
              nn.init.orthogonal_(param)
  
      self.linear1 = xavier_init_layer(
          hidden_size * 2, lin_dim, spec_norm=False
      )
      self.linear2 = xavier_init_layer(
          lin_dim, input_size, spec_norm=False
      )
  
      self.sigmoid = nn.Sigmoid()
  
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 EnhancementGenerator object from inherited base classes: nn with example: obj = EnhancementGenerator(input_size, hidden_size, num_layers, lin_dim, dropout)