All problems
FPN Top-Down Add
Problem
Add a top-down feature map to a lateral feature map elementwise.
Both inputs are H x W x C grids of the same shape; return the per-pixel, per-channel sum rounded to 4 decimal places.
Test cases
case 1
in: [[[[1,2]]],[[[3,4]]]]
expected: [[[4,6]]]
case 2
in: [[[[1,1],[2,2]]],[[[3,3],[4,4]]]]
expected: [[[4,4],[6,6]]]
case 3
in: [[[[5]]],[[[7]]]]
expected: [[[12]]]
Starter codePython
def top_down_add(up, lateral):
# Your code here
pass3 test cases · run your code against them in the editor