Convert each rectangular region of a feature map into a fixed square grid with max pooling. Each region is [x1,y1,x2,y2] with half-open bounds, so it contains rows y1 through y2−1 and columns x1 through x2−1.
For output row i, use:
hstart=y1+⌊SiHR⌋ hend=y1+⌊S(i+1)HR⌋For output column j, use:
wstart=x1+⌊SjWR⌋ wend=x1+⌊S(j+1)WR⌋Here, HR=y2−y1, WR=x2−x1, and S is output size. Expand an empty bin to one pixel, then take its maximum. Return one square two-dimensional list per region, preserving region order.
Input: feature_map = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], rois = [[0, 0, 4, 4]], output_size = 2
Output: [[[6, 8], [14, 16]]]
Explanation: The full map splits into four two-by-two bins, and each output contains one bin maximum.
Input: feature_map = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], rois = [[0, 0, 2, 2], [2, 2, 4, 4]], output_size = 2
Output: [[[1, 2], [5, 6]], [[11, 12], [15, 16]]]
Use math.floor on each scaled bin boundary.
Collect values between each pair of half-open row and column boundaries, then take max.
Sign in to take notes on this problem
Accepts: array
Accepts: array
Accepts: number
Convert each rectangular region of a feature map into a fixed square grid with max pooling. Each region is [x1,y1,x2,y2] with half-open bounds, so it contains rows y1 through y2−1 and columns x1 through x2−1.
For output row i, use:
hstart=y1+⌊SiHR⌋ hend=y1+⌊S(i+1)HR⌋For output column j, use:
wstart=x1+⌊SjWR⌋ wend=x1+⌊S(j+1)WR⌋Here, HR=y2−y1, WR=x2−x1, and S is output size. Expand an empty bin to one pixel, then take its maximum. Return one square two-dimensional list per region, preserving region order.
Input: feature_map = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], rois = [[0, 0, 4, 4]], output_size = 2
Output: [[[6, 8], [14, 16]]]
Explanation: The full map splits into four two-by-two bins, and each output contains one bin maximum.
Input: feature_map = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], rois = [[0, 0, 2, 2], [2, 2, 4, 4]], output_size = 2
Output: [[[1, 2], [5, 6]], [[11, 12], [15, 16]]]
Use math.floor on each scaled bin boundary.
Collect values between each pair of half-open row and column boundaries, then take max.
Sign in to take notes on this problem
Accepts: array
Accepts: array
Accepts: number