All problems
Pyramid Shapes
Problem
Compute the per-level shapes of a feature pyramid.
Level i has base_channels * growth^i channels and spatial size (ceil(h / 2^i), ceil(w / 2^i)). Return a list of [channels, h, w] for i from 0 to num_levels - 1.
Test cases
case 1
in: [64,64,3,64,2]
expected: [[64,64,64],[128,32,32],[256,16,16]]
case 2
in: [224,224,2,32,2]
expected: [[32,224,224],[64,112,112]]
case 3
in: [7,5,2,8,2]
expected: [[8,7,5],[16,4,3]]
Starter codePython
def pyramid_shapes(h, w, num_levels, base_channels, growth):
# Your code here
pass3 test cases · run your code against them in the editor