class_docstr: CNN-layer with multiple kernel-sizes over the word embeddings
class_docstr_tok: ["CNN-layer","with","multiple","kernel-sizes","over","the","word","embeddings"]
code: def __init__(
      self,
      in_word_embedding_dimension: int,
      out_channels: int = 256,
      kernel_sizes: List[int] = [1, 3, 5],
      stride_sizes: List[int] = None,
  ):
      nn.Module.__init__(self)
      self.config_keys = [
          "in_word_embedding_dimension",
          "out_channels",
          "kernel_sizes",
      ]
      self.in_word_embedding_dimension = in_word_embedding_dimension
      self.out_channels = out_channels
      self.kernel_sizes = kernel_sizes
  
      self.embeddings_dimension = out_channels * len(kernel_sizes)
      self.convs = nn.ModuleList()
  
      in_channels = in_word_embedding_dimension
      if stride_sizes is None:
          stride_sizes = [1] * len(kernel_sizes)
  
      for kernel_size, stride in zip(kernel_sizes, stride_sizes):
          padding_size = int((kernel_size - 1) / 2)
          conv = nn.Conv1d(
              in_channels=in_channels,
              out_channels=out_channels,
              kernel_size=kernel_size,
              stride=stride,
              padding=padding_size,
          )
          self.convs.append(conv)
  
file_path: sentence-transformers/sentence_transformers/models/CNN.py
imports: import torch
  from torch import nn
  from typing import List
  import os
  import json
label_desc: Use image node_id 1 to create a new CNN object from inherited base classes: nn with example: obj = CNN(in_word_embedding_dimension, out_channels, kernel_sizes, stride_sizes)