class_docstr: Skipping Memory (SkiM) Separator
  
  Args:
      input_dim: input feature dimension
      causal: bool, whether the system is causal.
      num_spk: number of target speakers.
      nonlinear: the nonlinear function for mask estimation,
          select from 'relu', 'tanh', 'sigmoid'
      layer: int, number of SkiM blocks. Default is 3.
      unit: int, dimension of the hidden state.
      segment_size: segmentation size for splitting long features
      dropout: float, dropout ratio. Default is 0.
      mem_type: 'hc', 'h', 'c', 'id' or None.
          It controls whether the hidden (or cell) state of
          SegLSTM will be processed by MemLSTM.
          In 'id' mode, both the hidden and cell states
          will be identically returned.
          When mem_type is None, the MemLSTM will be removed.
      seg_overlap: Bool, whether the segmentation will reserve 50%
          overlap for adjacent segments. Default is False.
class_docstr_tok: ["Skipping","Memory","(","SkiM",")","Separator","Args",":","input_dim",":","input","feature","dimension","causal",":","bool",",","whether","the","system","is","causal",".","num_spk",":","number","of","target","speakers",".","nonlinear",":","the","nonlinear","function","for","mask","estimation",",","select","from","'relu","'",",","'tanh","'",",","'sigmoid'","layer",":","int",",","number","of","SkiM","blocks",".","Default","is","3.","unit",":","int",",","dimension","of","the","hidden","state",".","segment_size",":","segmentation","size","for","splitting","long","features","dropout",":","float",",","dropout","ratio",".","Default","is","0.","mem_type",":","'hc","'",",","'","h","'",",","'","c","'",",","'id","'","or","None",".","It","controls","whether","the","hidden","(","or","cell",")","state","of","SegLSTM","will","be","processed","by","MemLSTM",".","In","'id","'","mode",",","both","the","hidden","and","cell","states","will","be","identically","returned",".","When","mem_type","is","None",",","the","MemLSTM","will","be","removed",".","seg_overlap",":","Bool",",","whether","the","segmentation","will","reserve","50","%","overlap","for","adjacent","segments",".","Default","is","False","."]
code: def __init__(
      self,
      input_dim: int,
      causal: bool = True,
      num_spk: int = 2,
      predict_noise: bool = False,
      nonlinear: str = "relu",
      layer: int = 3,
      unit: int = 512,
      segment_size: int = 20,
      dropout: float = 0.0,
      mem_type: str = "hc",
      seg_overlap: bool = False,
  ):
      super().__init__()
  
      self._num_spk = num_spk
      self.predict_noise = predict_noise
  
      self.segment_size = segment_size
  
      if mem_type not in ("hc", "h", "c", "id", None):
          raise ValueError(
              "Not supporting mem_type={}".format(mem_type)
          )
  
      self.num_outputs = (
          self.num_spk + 1 if self.predict_noise else self.num_spk
      )
      self.skim = SkiM(
          input_size=input_dim,
          hidden_size=unit,
          output_size=input_dim * self.num_outputs,
          dropout=dropout,
          num_blocks=layer,
          bidirectional=(not causal),
          norm_type="cLN" if causal else "gLN",
          segment_size=segment_size,
          seg_overlap=seg_overlap,
          mem_type=mem_type,
      )
  
      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/skim_separator.py
imports: from collections import OrderedDict
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.layers.complex_utils import is_complex
  from espnet2.enh.layers.skim import SkiM
  from espnet2.enh.separator.abs_separator import AbsSeparator
label_desc: Use image node_id 1 to create a new SkiMSeparator object from inherited base classes: AbsSeparator with example: obj = SkiMSeparator(input_dim, causal, num_spk, predict_noise, nonlinear, layer, unit, segment_size, dropout, mem_type, seg_overlap)