Network construction

The following is a list of important hyperparameters and their details. Here, I will try to construct a five-layered CNN, as follows:

  • Layer 0 has a ConvolutionLayer having a 6 x 6 kernel, one channel (since they are grayscale images), a stride of 2 x 2, and 20 feature maps where ReLU is the activation function:
ConvolutionLayer layer_0 = new ConvolutionLayer.Builder(6,6)            .nIn(nChannels)            .stride(2,2) // default stride(2,2)            .nOut(20) // # of feature maps            .dropOut(0.7) // dropout to reduce overfitting            .activation(Activation.RELU) // Activation: rectified linear units            .build();
  • Layer 1 has SubsamplingLayer max pooling, and a stride of 2x2. Thus, by using stride, we down sample by a factor of 2. Note that only MAX, AVG, ...

Get Java Deep Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.