Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-248

ASPP Output Sizes

Problem

Compute the output sizes of the atrous convolutions in an ASPP module.

For each rate r the effective kernel is r * (k - 1) + 1 with stride 1; out = n + 2 * pad - effective_k + 1 per dimension. Return one [out_h, out_w] per rate.

Test cases

case 1
in: [9,9,3,[1,2,3],0]
expected: [[7,7],[5,5],[3,3]]
case 2
in: [9,9,3,[1,2,3],2]
expected: [[11,11],[9,9],[7,7]]
case 3
in: [11,11,3,[6],0]
expected: [[-1,-1]]
Starter codePython
def aspp_output_size(h, w, k, rates, pad):
    # Your code here
    pass

3 test cases · run your code against them in the editor