code: def __init__(
      self,
      idim: int,
      # WPE options
      use_wpe: bool = False,
      wtype: str = "blstmp",
      wlayers: int = 3,
      wunits: int = 300,
      wprojs: int = 320,
      wdropout_rate: float = 0.0,
      taps: int = 5,
      delay: int = 3,
      use_dnn_mask_for_wpe: bool = True,
      # Beamformer options
      use_beamformer: bool = False,
      btype: str = "blstmp",
      blayers: int = 3,
      bunits: int = 300,
      bprojs: int = 320,
      bnmask: int = 2,
      badim: int = 320,
      ref_channel: int = -1,
      bdropout_rate=0.0,
  ):
      super().__init__()
  
      self.use_beamformer = use_beamformer
      self.use_wpe = use_wpe
      self.use_dnn_mask_for_wpe = use_dnn_mask_for_wpe
      # use frontend for all the data,
      # e.g. in the case of multi-speaker speech separation
      self.use_frontend_for_all = bnmask > 2
  
      if self.use_wpe:
          if self.use_dnn_mask_for_wpe:
              # Use DNN for power estimation
              # (Not observed significant gains)
              iterations = 1
          else:
              # Performing as conventional WPE, without DNN Estimator
              iterations = 2
  
          self.wpe = DNN_WPE(
              wtype=wtype,
              widim=idim,
              wunits=wunits,
              wprojs=wprojs,
              wlayers=wlayers,
              taps=taps,
              delay=delay,
              dropout_rate=wdropout_rate,
              iterations=iterations,
              use_dnn_mask=use_dnn_mask_for_wpe,
          )
      else:
          self.wpe = None
  
      if self.use_beamformer:
          self.beamformer = DNN_Beamformer(
              btype=btype,
              bidim=idim,
              bunits=bunits,
              bprojs=bprojs,
              blayers=blayers,
              num_spk=max(bnmask - 1, 1),
              use_noise_mask=(bnmask > 1),
              dropout_rate=bdropout_rate,
              badim=badim,
              ref_channel=ref_channel,
          )
      else:
          self.beamformer = None
  
file_path: espnet/espnet/nets/pytorch_backend/frontends/frontend.py
imports: from typing import List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.nn
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.layers.dnn_beamformer import DNN_Beamformer
  from espnet2.enh.layers.dnn_wpe import DNN_WPE
label_desc: Use image node_id 1 to create a new Frontend object from inherited base classes: nn with example: obj = Frontend(idim, use_wpe, wtype, wlayers, wunits, wprojs, wdropout_rate, taps, delay, use_dnn_mask_for_wpe, use_beamformer, btype, blayers, bunits, bprojs, bnmask, badim, ref_channel, bdropout_rate)