All problems
Receptive Field Growth Trace
Problem
Trace how the receptive field grows through a stack of convolutions.
Starting from rf = 1 and jump = 1, each layer performs rf += (kernel - 1) * jump and then jump *= stride. Return the list of receptive field sizes after every layer; kernels and strides have equal length.
Test cases
case 1
in: [[3],[1]]
expected: [3]
case 2
in: [[3,3],[1,1]]
expected: [3,5]
case 3
in: [[3,3,3],[2,2,2]]
expected: [3,7,15]
case 4
in: [[5,3],[2,1]]
expected: [5,9]
Starter codePython
def receptive_field_trace(kernels, strides):
# Your code here
pass4 test cases · run your code against them in the editor