class_docstr: This is a module to ensemble a convolution (depthwise) encoder with or
  without residual connection.
  
  Arguments
  ----------
  out_channels: int
      Number of output channels of this model (default 640).
  out_channels: Optional(list[int])
      Number of output channels for each of block.
  kernel_size: int
      Kernel size of convolution layers (default 3).
  strides: Optional(list[int])
      Striding factor for each block, this stride is applied at the last convolution layer at each block.
  num_blocks: int
      Number of block (default 21).
  num_per_layers: int
      Number of convolution layers for each block (default 5).
  dropout: float
      Dropout (default 0.15).
  activation: torch class
      Activation function for each block (default Swish).
  norm: torch class
      Normalization to regularize the model (default BatchNorm1d).
  residuals: Optional(list[bool])
      Whether apply residual connection at each block (default None).
  
  Example
  -------
  >>> x = torch.rand((8, 30, 10))
  >>> conv = ConvolutionFrontEnd(input_shape=x.shape)
  >>> out = conv(x)
  >>> out.shape
  torch.Size([8, 8, 3, 512])
class_docstr_tok: ["This","is","a","module","to","ensemble","a","convolution","(","depthwise",")","encoder","with","or","without","residual","connection",".","Arguments","--","--","--","--","--","out_channels",":","int","Number","of","output","channels","of","this","model","(","default","640",")",".","out_channels",":","Optional","(","list","[","int","]",")","Number","of","output","channels","for","each","of","block",".","kernel_size",":","int","Kernel","size","of","convolution","layers","(","default","3",")",".","strides",":","Optional","(","list","[","int","]",")","Striding","factor","for","each","block",",","this","stride","is","applied","at","the","last","convolution","layer","at","each","block",".","num_blocks",":","int","Number","of","block","(","default","21",")",".","num_per_layers",":","int","Number","of","convolution","layers","for","each","block","(","default","5",")",".","dropout",":","float","Dropout","(","default","0.15",")",".","activation",":","torch","class","Activation","function","for","each","block","(","default","Swish",")",".","norm",":","torch","class","Normalization","to","regularize","the","model","(","default","BatchNorm1d",")",".","residuals",":","Optional","(","list","[","bool","]",")","Whether","apply","residual","connection","at","each","block","(","default","None",")",".","Example","--","--","--","-",">",">",">","x","=","torch.rand","(","(","8",",","30",",","10",")",")",">",">",">","conv","=","ConvolutionFrontEnd","(","input_shape=x.shape",")",">",">",">","out","=","conv","(","x",")",">",">",">","out.shape","torch.Size","(","[","8",",","8",",","3",",","512","]",")"]
code: def __init__(
      self,
      input_shape,
      num_blocks=3,
      num_layers_per_block=5,
      out_channels=[128, 256, 512],
      kernel_sizes=[3, 3, 3],
      strides=[1, 2, 2],
      dilations=[1, 1, 1],
      residuals=[True, True, True],
      conv_module=Conv2d,
      activation=torch.nn.LeakyReLU,
      norm=LayerNorm,
      dropout=0.1,
      conv_bias=True,
      padding="same",
      conv_init=None,
  ):
      super().__init__(input_shape=input_shape)
      for i in range(num_blocks):
          self.append(
              ConvBlock,
              num_layers=num_layers_per_block,
              out_channels=out_channels[i],
              kernel_size=kernel_sizes[i],
              stride=strides[i],
              dilation=dilations[i],
              residual=residuals[i],
              conv_module=conv_module,
              activation=activation,
              norm=norm,
              dropout=dropout,
              layer_name=f"convblock_{i}",
              conv_bias=conv_bias,
              padding=padding,
              conv_init=conv_init,
          )
  
file_path: speechbrain/speechbrain/lobes/models/convolution.py
imports: import torch
  from speechbrain.nnet.CNN import Conv2d, Conv1d
  from speechbrain.nnet.containers import Sequential
  from speechbrain.nnet.normalization import LayerNorm
label_desc: Use image node_id 1 to create a new ConvolutionFrontEnd object from inherited base classes: Sequential with example: obj = ConvolutionFrontEnd(input_shape, num_blocks, num_layers_per_block, out_channels, kernel_sizes, strides, dilations, residuals, conv_module, activation, norm, dropout, conv_bias, padding, conv_init)