class_docstr: `DeepCNNRepresentation` implements CNN representation layer
  preceded by a dropout layer. CNN representation layer is based on the encoder
  in the architecture proposed by Gehring et. al. in Convolutional Sequence to
  Sequence Learning.
  
  Args:
      config (Config): Configuration object of type DeepCNNRepresentation.Config.
      embed_dim (int): The number of expected features in the input.
class_docstr_tok: ["`","DeepCNNRepresentation","`","implements","CNN","representation","layer","preceded","by","a","dropout","layer",".","CNN","representation","layer","is","based","on","the","encoder","in","the","architecture","proposed","by","Gehring","et",".","al",".","in","Convolutional","Sequence","to","Sequence","Learning",".","Args",":","config","(","Config",")",":","Configuration","object","of","type","DeepCNNRepresentation.Config",".","embed_dim","(","int",")",":","The","number","of","expected","features","in","the","input","."]
code: def __init__(self, config: Config, embed_dim: int) -> None:
      super().__init__(config)
  
      out_channels = config.cnn.kernel_num
      kernel_sizes = config.cnn.kernel_sizes
      weight_norm = config.cnn.weight_norm
      dilated = config.cnn.dilated
      causal = config.cnn.causal
  
      activation = config.activation
      pooling_type = config.pooling_type
      separable = config.separable
      bottleneck = config.bottleneck
  
      conv_layers = {}
      linear_layers = {}
      in_channels = embed_dim
  
      for i, k in enumerate(kernel_sizes):
          assert (k - 1) % 2 == 0
  
          if in_channels != out_channels:
              linear_layers[str(i)] = nn.Linear(
                  in_channels, out_channels
              )
  
          single_conv = create_conv_package(
              index=i,
              activation=activation,
              in_channels=in_channels,
              out_channels=out_channels,
              kernel_size=k,
              causal=causal,
              dilated=dilated,
              separable=separable,
              bottleneck=bottleneck,
              weight_norm=weight_norm,
          )
          conv_layers[str(i)] = single_conv
  
          in_channels = out_channels
  
      self.convs = nn.ModuleDict(conv_layers)
      self.projections = nn.ModuleDict(linear_layers)
      self.activation = get_activation(activation)
      self.pooling_type = pooling_type
  
      self.representation_dim = out_channels
      self.dropout = nn.Dropout(p=config.dropout)
      log_class_usage(__class__)
  
imports: import math
  import torch
  import torch.nn
  from pytext.config.module_config import Activation, CNNParams, PoolingType
  from pytext.models.representations.representation_base import RepresentationBase
  from pytext.optimizer import get_activation
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 1 to create a new DeepCNNRepresentation object from inherited base classes: RepresentationBase with example: obj = DeepCNNRepresentation(config, embed_dim)