Implementing a Convolutional Neural Network from Scratch in Python

Implementing a Convolutional Neural Network from Scratch in Python

As mentioned before, CNNs include conv layers that use a set of filters to turn input images into output images. This means it’ll turn the 28×28 input image into a 26x26x8 output volume:

Each of the 4 filters in the conv layer produces a 26×26 output, so stacked together they make up a 26x26x8 volume. Here’s an example of a Max Pooling layer with a pooling size of 2:

To perform max pooling, we traverse the input image in 2×2 blocks (because pool size = 2) and put the max value into the output image at the corresponding pixel.

Source: victorzhou.com