Given matrix of shape stored in row-major order and a square pooling window of side , produce matrix of shape such that
The stride equals so the windows do not overlap. If or is not divisible by , the trailing rows or columns are discarded.
Input
A- input matrix of shape[h][w]stored in row-major order.h- the number of rows inA.w- the number of columns inA.kernel_size- the side length of the square pooling window (also the stride).
Output
B- pooled matrix of shape[h/k][w/k]where each cell holds the maximum value of its corresponding region ofA.