O'Reilly logo

Java Deep Learning Projects by Md. Rezaul Karim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required