All problems
Dilated Conv Receptive Field
Problem
Compute the receptive field of num_layers stacked convolutions with kernel size k and dilation d: 1 + num_layers * (k - 1) * d.
The signature is dilated_receptive_field(kernel_size, dilation, num_layers). Return an integer.
Hint
Each layer extends the receptive field by (k - 1) * dilation.
Test cases
case 1
in: [3,1,1]
expected: 3
case 2
in: [3,2,1]
expected: 5
case 3
in: [3,1,4]
expected: 9
case 4
in: [3,2,3]
expected: 13
case 5
in: [5,4,2]
expected: 33
Starter codePython
def dilated_receptive_field(kernel_size, dilation, num_layers):
# Your code here
pass5 test cases · run your code against them in the editor