Pooling Layers Continued
The course is part of this learning path
Convolutional Neural Networks
In this course, discover convolutions and the convolutional neural networks involved in Data and Machine Learning. Introducing the concept of tensor, which is essential for everything that follows.
Learn to apply the right kind of data such as images. Images store their information in pixels, but you will discover that it is not the value of each pixel that matters.
- Understand how convolutional neural networks are essential to the fundamentals of Data and Machine Learning.
- It is recommended to complete the Introduction to Data and Machine Learning course before starting.
Hey guys, welcome back. In this video we're going to look at pooling layers in Keras and see how they work. So, the first thing we're gonna do is load the max pooling layer and the average pooling layer from Keras. And then we are going to build again a very simple model with just one layer, a pooling layer. Notice that we've chosen default parameters so the strides, when it's set to None, it will default to the pool size. So strides, if it's None it will default to the pool size. So, we basically take a pool of five by five, and we'll jump of a pool size, so five pixels also in both directions.
Okay, so we run a forward pass again with our little model on the image tensor. And, this is what happens. We've reduced the size of our image by a factor of five so we went from 512 pixels to about a hundred. And you see like the granularity of the image has changed because we've taken the maximum value in each batch. Whereas if we take the average, the effect will look bit smoother because we have averaged over the pixels. Still, we went from an image that was 512 by 512 pixels to an image that's about a hundred to about a hundred. So this is how pooling layers work. They just discard some information and keep only what we tell them to keep, either the maximum or the average. Thank you for watching, and see you in the next video.
About the Author
I am a Data Science consultant and trainer. With Catalit I help companies acquire skills and knowledge in data science and harness machine learning and deep learning to reach their goals. With Data Weekends I train people in machine learning, deep learning and big data analytics. I served as lead instructor in Data Science at General Assembly and The Data Incubator and I was Chief Data Officer and co-founder at Spire, a Y-Combinator-backed startup that invented the first consumer wearable device capable of continuously tracking respiration and activity. I earned a joint PhD in biophysics at University of Padua and Université de Paris VI and graduated from Singularity University summer program of 2011.