class_docstr: Lightweight Sinc Convolutions.
  
  Instead of using precomputed features, end-to-end speech recognition
  can also be done directly from raw audio using sinc convolutions, as
  described in "Lightweight End-to-End Speech Recognition from Raw Audio
  Data Using Sinc-Convolutions" by Kürzinger et al.
  https://arxiv.org/abs/2010.07597
  
  To use Sinc convolutions in your model instead of the default f-bank
  frontend, set this module as your pre-encoder with `preencoder: sinc`
  and use the input of the sliding window frontend with
  `frontend: sliding_window` in your yaml configuration file.
  So that the process flow is:
  
  Frontend (SlidingWindow) -> SpecAug -> Normalization ->
  Pre-encoder (LightweightSincConvs) -> Encoder -> Decoder
  
  Note that this method also performs data augmentation in time domain
  (vs. in spectral domain in the default frontend).
  Use `plot_sinc_filters.py` to visualize the learned Sinc filters.
class_docstr_tok: ["Lightweight","Sinc","Convolutions",".","Instead","of","using","precomputed","features",",","end-to-end","speech","recognition","can","also","be","done","directly","from","raw","audio","using","sinc","convolutions",",","as","described","in","``","Lightweight","End-to-End","Speech","Recognition","from","Raw","Audio","Data","Using","Sinc-Convolutions","''","by","K\u00fcrzinger","et","al",".","https",":","\/\/arxiv.org\/abs\/2010.07597","To","use","Sinc","convolutions","in","your","model","instead","of","the","default","f-bank","frontend",",","set","this","module","as","your","pre-encoder","with","`","preencoder",":","sinc","`","and","use","the","input","of","the","sliding","window","frontend","with","`","frontend",":","sliding_window","`","in","your","yaml","configuration","file",".","So","that","the","process","flow","is",":","Frontend","(","SlidingWindow",")","-",">","SpecAug","-",">","Normalization","-",">","Pre-encoder","(","LightweightSincConvs",")","-",">","Encoder","-",">","Decoder","Note","that","this","method","also","performs","data","augmentation","in","time","domain","(","vs.","in","spectral","domain","in","the","default","frontend",")",".","Use","`","plot_sinc_filters.py","`","to","visualize","the","learned","Sinc","filters","."]
docstr: Initialize the module.
  
  Args:
      fs: Sample rate.
      in_channels: Number of input channels.
      out_channels: Number of output channels (for each input channel).
      activation_type: Choice of activation function.
      dropout_type: Choice of dropout function.
      windowing_type: Choice of windowing function.
      scale_type:  Choice of filter-bank initialization scale.
docstr_tok: ["Initialize","the","module",".","Args",":","fs",":","Sample","rate",".","in_channels",":","Number","of","input","channels",".","out_channels",":","Number","of","output","channels","(","for","each","input","channel",")",".","activation_type",":","Choice","of","activation","function",".","dropout_type",":","Choice","of","dropout","function",".","windowing_type",":","Choice","of","windowing","function",".","scale_type",":","Choice","of","filter-bank","initialization","scale","."]
code: def __init__(
      self,
      fs: Union[int, str, float] = 16000,
      in_channels: int = 1,
      out_channels: int = 256,
      activation_type: str = "leakyrelu",
      dropout_type: str = "dropout",
      windowing_type: str = "hamming",
      scale_type: str = "mel",
  ):
      """Initialize the module.
  
      Args:
          fs: Sample rate.
          in_channels: Number of input channels.
          out_channels: Number of output channels (for each input channel).
          activation_type: Choice of activation function.
          dropout_type: Choice of dropout function.
          windowing_type: Choice of windowing function.
          scale_type:  Choice of filter-bank initialization scale.
      """
      assert check_argument_types()
      super().__init__()
      if isinstance(fs, str):
          fs = humanfriendly.parse_size(fs)
      self.fs = fs
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.activation_type = activation_type
      self.dropout_type = dropout_type
      self.windowing_type = windowing_type
      self.scale_type = scale_type
  
      self.choices_dropout = {
          "dropout": torch.nn.Dropout,
          "spatial": SpatialDropout,
          "dropout2d": torch.nn.Dropout2d,
      }
      if dropout_type not in self.choices_dropout:
          raise NotImplementedError(
              f"Dropout type has to be one of "
              f"{list(self.choices_dropout.keys())}",
          )
  
      self.choices_activation = {
          "leakyrelu": torch.nn.LeakyReLU,
          "relu": torch.nn.ReLU,
      }
      if activation_type not in self.choices_activation:
          raise NotImplementedError(
              f"Activation type has to be one of "
              f"{list(self.choices_activation.keys())}",
          )
  
      # initialization
      self._create_sinc_convs()
      # Sinc filters require custom initialization
      self.espnet_initialization_fn()
  
file_path: espnet/espnet2/asr/preencoder/sinc.py
imports: from collections import OrderedDict
  from typing import Optional, Tuple, Union
  import humanfriendly
  import torch
  from typeguard import check_argument_types
  from espnet2.asr.preencoder.abs_preencoder import AbsPreEncoder
  from espnet2.layers.sinc_conv import LogCompression, SincConv
label_desc: Use image node_id 1 to create a new LightweightSincConvs object from inherited base classes: AbsPreEncoder with example: obj = LightweightSincConvs(fs, in_channels, out_channels, activation_type, dropout_type, windowing_type, scale_type)