How do you derive the recurrence for the receptive field of a stack of convolution and pooling layers with kernel sizes and strides , and what receptive field does it give for a unit in (a) a conv with stride 2 followed by two convs with stride 1, and (b) a conv with stride 1, a max-pool with stride 2, then two convs with stride 1?
Deep learning, Convolutional networks
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you understand that each layer's growth is scaled by the strides before it, and can apply the recurrence including pooling.
Key idea
Let be the receptive field after layer and the jump (input distance between neighbouring units). Start with . Then and . Pooling is a layer with its own and .
Steps
- This is the harder follow-up to `receptive-field-stacked-convs`, which comes first. Derive: a unit in layer looks at neighbouring units of layer . Those neighbours are input pixels apart. So the window spans gaps of size , and it adds pixels to the field of one unit of layer . This gives .
- The jump: moving one unit along layer moves units along layer , so . Strides multiply, which is why striding early makes every later layer grow the field faster.
- (a) Start . Conv , stride 2: , . Conv , stride 1: , . Conv , stride 1: . So the receptive field is .
- (b) Conv , stride 1: , . Pool , stride 2: , . Conv , stride 1: , . Conv , stride 1: . So the receptive field is .
- Cross-check (b) backwards from one output unit, using : across the two last convs, then the pool gives , then the first conv gives . The answers match.
- Remark: this is the theoretical receptive field. The effective receptive field, where pixels really influence the output, is smaller and roughly Gaussian-shaped, with the centre pixels counting most.
Common mistakes
- Adding at every layer without the jump. That is correct only when all earlier strides are 1.
- Updating before in the same layer. uses the jump of the previous layer.
- Leaving out the pooling layer. Pooling changes both the receptive field and the jump.
How long your answer should be
Half a page, about 4 minutes.
Read this
Previous in Deep learning: A network has input , two hidden units, and one linear output . All weights and biases start at . The loss is and the learning rate is . What happens over two gradient-descent steps (a) with sigmoid hidden units and (b) with ReLU hidden units, and what happens to the two hidden units?
Next in Deep learning: Why do residual connections make very deep networks trainable?