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: Generate a convolutional block for Lightweight Sinc convolutions.
  
  Each block consists of either a depthwise or a depthwise-separable
  convolutions together with dropout, (batch-)normalization layer, and
  an optional average-pooling layer.
  
  Args:
      in_channels: Number of input channels.
      out_channels: Number of output channels.
      depthwise_kernel_size: Kernel size of the depthwise convolution.
      depthwise_stride: Stride of the depthwise convolution.
      depthwise_groups: Number of groups of the depthwise convolution.
      pointwise_groups: Number of groups of the pointwise convolution.
      dropout_probability: Dropout probability in the block.
      avgpool: If True, an AvgPool layer is inserted.
  
  Returns:
      torch.nn.Sequential: Neural network building block.
docstr_tok: ["Generate","a","convolutional","block","for","Lightweight","Sinc","convolutions",".","Each","block","consists","of","either","a","depthwise","or","a","depthwise-separable","convolutions","together","with","dropout",",","(","batch-",")","normalization","layer",",","and","an","optional","average-pooling","layer",".","Args",":","in_channels",":","Number","of","input","channels",".","out_channels",":","Number","of","output","channels",".","depthwise_kernel_size",":","Kernel","size","of","the","depthwise","convolution",".","depthwise_stride",":","Stride","of","the","depthwise","convolution",".","depthwise_groups",":","Number","of","groups","of","the","depthwise","convolution",".","pointwise_groups",":","Number","of","groups","of","the","pointwise","convolution",".","dropout_probability",":","Dropout","probability","in","the","block",".","avgpool",":","If","True",",","an","AvgPool","layer","is","inserted",".","Returns",":","torch.nn.Sequential",":","Neural","network","building","block","."]
code: def gen_lsc_block(
      self,
      in_channels: int,
      out_channels: int,
      depthwise_kernel_size: int = 9,
      depthwise_stride: int = 1,
      depthwise_groups=None,
      pointwise_groups=0,
      dropout_probability: float = 0.15,
      avgpool=False,
  ):
      """Generate a convolutional block for Lightweight Sinc convolutions.
  
      Each block consists of either a depthwise or a depthwise-separable
      convolutions together with dropout, (batch-)normalization layer, and
      an optional average-pooling layer.
  
      Args:
          in_channels: Number of input channels.
          out_channels: Number of output channels.
          depthwise_kernel_size: Kernel size of the depthwise convolution.
          depthwise_stride: Stride of the depthwise convolution.
          depthwise_groups: Number of groups of the depthwise convolution.
          pointwise_groups: Number of groups of the pointwise convolution.
          dropout_probability: Dropout probability in the block.
          avgpool: If True, an AvgPool layer is inserted.
  
      Returns:
          torch.nn.Sequential: Neural network building block.
      """
      block = OrderedDict()
      if not depthwise_groups:
          # GCD(in_channels, out_channels) to prevent size mismatches
          depthwise_groups, r = in_channels, out_channels
          while r != 0:
              depthwise_groups, r = (
                  depthwise_groups,
                  depthwise_groups % r,
              )
      block["depthwise"] = torch.nn.Conv1d(
          in_channels,
          out_channels,
          depthwise_kernel_size,
          depthwise_stride,
          groups=depthwise_groups,
      )
      if pointwise_groups:
          block["pointwise"] = torch.nn.Conv1d(
              out_channels, out_channels, 1, 1, groups=pointwise_groups
          )
      block["activation"] = self.choices_activation[
          self.activation_type
      ]()
      block["batchnorm"] = torch.nn.BatchNorm1d(
          out_channels, affine=True
      )
      if avgpool:
          block["avgpool"] = torch.nn.AvgPool1d(2)
      block["dropout"] = self.choices_dropout[self.dropout_type](
          dropout_probability
      )
      return torch.nn.Sequential(block)
  
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 3 for calling the LightweightSincConvs obj's underlying member method code with example usage: obj.gen_lsc_block(in_channels, out_channels, depthwise_kernel_size, depthwise_stride, depthwise_groups, pointwise_groups, dropout_probability, avgpool) and returns: torch