All problems
Temporal Pyramid Bin Sizes
Problem
Compute temporal pyramid pooling bin widths.
Level l splits num_frames into 2^l segments, so its bin width is ceil(num_frames / 2^l). Return the widths for levels 0 through levels - 1 as a list of integers.
Hint
Ceiling division is (n + d - 1) // d with d = 2^l.
Test cases
case 1
in: [16,4]
expected: [16,8,4,2]
case 2
in: [10,3]
expected: [10,5,3]
case 3
in: [1,1]
expected: [1]
case 4
in: [7,2]
expected: [7,4]
Starter codePython
def temporal_pyramid_bins(num_frames, levels):
# Your code here
pass4 test cases · run your code against them in the editor