All problems
SPP Bin Sizes
Problem
Compute the pooling bin sizes of a spatial pyramid pooling layer.
For each level l from 1 to levels the bin size is (ceil(h / l), ceil(w / l)). Return one [bin_h, bin_w] per level.
Test cases
case 1
in: [13,13,3]
expected: [[13,13],[7,7],[5,5]]
case 2
in: [8,8,3]
expected: [[8,8],[4,4],[3,3]]
case 3
in: [7,5,2]
expected: [[7,5],[4,3]]
Starter codePython
def spp_bins(h, w, levels):
# Your code here
pass3 test cases · run your code against them in the editor