![]() |
VOOZH | about |
Max pooling is a downsampling technique that slides a window (e.g., 2x2) over the input feature map and extracts the maximum value from each window.
This process achieves two key goals:
In TensorFlow, tf.keras.layers.MaxPooling2D implements max pooling operation. Key parameters include:
Here’s how to implement max pooling using tf.keras.layers.MaxPooling2D:
Output:
Input Shape: (1, 4, 4, 1)
Output Shape: (1, 2, 2, 1)
Pooled Output:
[[ 6. 8.]
[14. 16.]]
Max pooling layer is used to reduce overfitting, improve computational efficiency and enhances translation invariance.