code: def __init__(
      self, cnn_parameters, layers, activations, use_layer_norm
  ) -> None:
      super().__init__()
      self.conv_dims = cnn_parameters.conv_dims
      self.conv_height_kernels = cnn_parameters.conv_height_kernels
      self.conv_width_kernels = cnn_parameters.conv_width_kernels
      self.use_layer_norm = use_layer_norm
  
      self.conv_layers: nn.ModuleList = nn.ModuleList()
      self.pool_layers: nn.ModuleList = nn.ModuleList()
      self.layer_norm_layers: nn.ModuleList = nn.ModuleList()
  
      for i, _ in enumerate(self.conv_dims[1:]):
          self.conv_layers.append(
              nn.Conv2d(
                  self.conv_dims[i],
                  self.conv_dims[i + 1],
                  kernel_size=(
                      self.conv_height_kernels[i],
                      self.conv_width_kernels[i],
                  ),
              )
          )
          nn.init.kaiming_normal_(self.conv_layers[i].weight)
          if cnn_parameters.pool_types[i] == "max":
              self.pool_layers.append(
                  nn.MaxPool2d(
                      kernel_size=cnn_parameters.pool_kernels_strides[i]
                  )
              )
          else:
              assert False, "Unknown pooling type".format(layers)
          if self.use_layer_norm:
              self.layer_norm_layers.append(
                  nn.GroupNorm(1, self.conv_dims[i + 1])
              )
  
      input_size = (
          cnn_parameters.num_input_channels,
          cnn_parameters.input_height,
          cnn_parameters.input_width,
      )
      # pyre-fixme[6]: For 1st param expected `Sequence[Union[int, SymInt]]` but
      #  got `int`.
      conv_out = self.conv_forward(torch.ones(1, *input_size))
      self.fc_input_dim = int(np.prod(conv_out.size()[1:]))
      layers[0] = self.fc_input_dim
      self.feed_forward = FullyConnectedNetwork(
          layers, activations, use_layer_norm=use_layer_norm
      )
  
file_path: ReAgent/reagent/models/convolutional_network.py
imports: import collections
  import logging
  import math
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.nn.init
  from reagent.models.fully_connected_network import FullyConnectedNetwork
label_desc: Use image node_id 1 to create a new ConvolutionalNetwork object from inherited base classes: nn with example: obj = ConvolutionalNetwork(cnn_parameters, layers, activations, use_layer_norm)