From the course: Deep Learning: Image Recognition

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Max pooling

Max pooling - Python Tutorial

From the course: Deep Learning: Image Recognition

Start my 1-month free trial

Max pooling

- [Instructor] So far, we've created a basic convolutional neural network. Let's improve its efficiency by adding max pooling. Open up 06_max_pooling.py. Max pooling is where we scale down the output of the convolutional layers by keeping only the largest values and throwing away the smaller ones. This makes the neural network more efficient by throwing away the least useful data and keeping the most useful data. Typically, we'll do max pooling right after a block of convolutional layers. Let's go down to line 25 after we add these two layers, and add our max pooling layer. To do that, we call model.add, and then create a new max pooling 2D layer. The only parameter that we have to pass in is the size of the area that we wanna pool together. We'll use a two pixel by two pixel pool size. So, we'll pass in pool size equals, and then the ray, two comma two. That means that we'll divide their image up into two by two squares and only take the larges value from each two by two region. That…

Contents