docstr: RNN Separator
  
  Args:
      input_dim: input feature dimension
      rnn_type: string, select from 'blstm', 'lstm' etc.
      bidirectional: bool, whether the inter-chunk RNN layers are bidirectional.
      num_spk: number of speakers
      predict_noise: whether to output the estimated noise signal
      nonlinear: the nonlinear function for mask estimation,
                 select from 'relu', 'tanh', 'sigmoid'
      layer: int, number of stacked RNN layers. Default is 3.
      unit: int, dimension of the hidden state.
      dropout: float, dropout ratio. Default is 0.
docstr_tok: ["RNN","Separator","Args",":","input_dim",":","input","feature","dimension","rnn_type",":","string",",","select","from","'blstm","'",",","'lstm","'","etc",".","bidirectional",":","bool",",","whether","the","inter-chunk","RNN","layers","are","bidirectional",".","num_spk",":","number","of","speakers","predict_noise",":","whether","to","output","the","estimated","noise","signal","nonlinear",":","the","nonlinear","function","for","mask","estimation",",","select","from","'relu","'",",","'tanh","'",",","'sigmoid'","layer",":","int",",","number","of","stacked","RNN","layers",".","Default","is","3.","unit",":","int",",","dimension","of","the","hidden","state",".","dropout",":","float",",","dropout","ratio",".","Default","is","0","."]
code: def __init__(
      self,
      input_dim: int,
      rnn_type: str = "blstm",
      num_spk: int = 2,
      predict_noise: bool = False,
      nonlinear: str = "sigmoid",
      layer: int = 3,
      unit: int = 512,
      dropout: float = 0.0,
  ):
      """RNN Separator
  
      Args:
          input_dim: input feature dimension
          rnn_type: string, select from 'blstm', 'lstm' etc.
          bidirectional: bool, whether the inter-chunk RNN layers are bidirectional.
          num_spk: number of speakers
          predict_noise: whether to output the estimated noise signal
          nonlinear: the nonlinear function for mask estimation,
                     select from 'relu', 'tanh', 'sigmoid'
          layer: int, number of stacked RNN layers. Default is 3.
          unit: int, dimension of the hidden state.
          dropout: float, dropout ratio. Default is 0.
      """
      super().__init__()
  
      self._num_spk = num_spk
      self.predict_noise = predict_noise
  
      self.rnn = RNN(
          idim=input_dim,
          elayers=layer,
          cdim=unit,
          hdim=unit,
          dropout=dropout,
          typ=rnn_type,
      )
  
      num_outputs = (
          self.num_spk + 1 if self.predict_noise else self.num_spk
      )
      self.linear = torch.nn.ModuleList(
          [torch.nn.Linear(unit, input_dim) for _ in range(num_outputs)]
      )
  
      if nonlinear not in ("sigmoid", "relu", "tanh"):
          raise ValueError(
              "Not supporting nonlinear={}".format(nonlinear)
          )
  
      self.nonlinear = {
          "sigmoid": torch.nn.Sigmoid(),
          "relu": torch.nn.ReLU(),
          "tanh": torch.nn.Tanh(),
      }[nonlinear]
  
file_path: espnet/espnet2/enh/separator/rnn_separator.py
imports: from collections import OrderedDict
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.layers.complex_utils import is_complex
  from espnet2.enh.separator.abs_separator import AbsSeparator
  from espnet.nets.pytorch_backend.rnn.encoders import RNN
label_desc: Use image node_id 1 to create a new RNNSeparator object from inherited base classes: AbsSeparator with example: obj = RNNSeparator(input_dim, rnn_type, num_spk, predict_noise, nonlinear, layer, unit, dropout)