There are a couple of reasons why adding max pooling to our network may be helpful. As a result, we can see that our input dimensionsĪlright, we know what max pooling is and how it works, so let's discuss why would we want to add this to our network? This completes the process of max pooling on this sample 4 x 4 input channel, and the resulting output channel is this 2 x 2 block. We store this value in our output channel. Here, the max value in the blue region is 6, and we store that here in our outputįinally, we move to the right by 2, and see the max value of the yellow region is 5. Since we've reached the edge, we now move back over to the far left, and go down by 2 pixels.
As a result, we store the value over in the output channel. Next, we slide over by 2 pixels, and we see the max value in the green region is 8. Our first 2 x 2 region is in orange, and we can see the max value of this region is 9, and so we store that over in the output channel. We have some sample input of size 4 x 4, and we're assuming that we have a 2 x 2 filter size with a stride of 2 to do max pooling on this input channel. Just to make sure we fully understand this operation, we're going to quickly look at a scaled down example that may be more simple to visualize. After performing max pooling, we can see the dimension of this image was reduced by a factor of 2 and is now In this example, our convolution operation output is 26 x 26 in size. This process is carried out for the entire image, and when we're finished, we get the new representation of the image, the output channel. Pools of numbers, and since we're taking the max value from each pool, we can see where the name Once we reach the edge over on the far right, we then move down by 2 (because that's our stride size), and then we do the same exact thing of calculating the max value for the We calculate the max valueĢ x 2 block, store it in the output, and then, go on our way sliding over by 2 again. We're using 2 here, so we just slide over by 2, then do the same thing. We move over by the number of pixels that we defined our stride size to be.
PDF ARCHITECT 5 ACTIVATION CODE FULL
Makes up the full output from this max pooling operation. This value is stored in the output channel, which On the convolutional output, and we take the first 2 x 2 region and calculate the max value from each value in the 2 x 2 block. Stride determines how many units the filter slides. This is the output from the convolution operation and is the input to the max pooling operation.Īfter the max pooling operation, we have the following output channel: We used a 3 x 3 filter to produce the output channel below:Īs mentioned earlier, max pooling is added after a convolutional layer. Recall, we have a matrix of the pixel values from an image of a 7 from the MNIST data set. We're going to be using the same image of a seven that we used in our previous post on CNNs. This output is a matrix of pixels with the values that were computed during the convolutions that occurred on our image. When a filter convolves a given input, it then gives us an output. Post on CNNs that each convolutional layer has some number of filters that we define with a specified dimension and that these filters convolve our image input channels. Let's go ahead and check out a couple of examples to see what exactly max pooling is doing operation-wise, and then we'll come back to discuss why we may want to use max pooling.Įxample using a sample from the MNIST dataset When added to a model, max pooling reduces the dimensionality of images by reducing the number of pixels in the output from the previous convolutional layer. Max pooling is a type of operation that is typically added to CNNs following individual convolutional layers. Post on CNNs, so if you haven't seen that yet, go ahead and check it out, and then come back to read this post once you've finished up there. We're going to be building on some of the ideas that we discussed in our
PDF ARCHITECT 5 ACTIVATION CODE CODE
Max pooling to a convolutional neural network in code using Keras. We'll then discuss the motivation for why max pooling is used, and we'll see how we can add We're going to start out by explaining what max pooling is, and we'll show how it's calculated by looking at some examples.
Hey, what's going on everyone? In this post, we're going to discuss what max pooling is in a convolutional neural network. Max Pooling in Convolutional Neural Networks