Padding
Output Dimension
n+2p−f+1n+2p−f+1
Padding Types
Valid: p=0p=0
Same: n+2p−f+1=n⇒p=f−12n+2p−f+1=n⇒p=f−12
Stride
Output Dimension
⌊n+2p−fs⌋+1⌊n+2p−fs⌋+1
Convolutions Over Volume
n×n×ncprev,f×f×ncprev⇒(⌊n+2p−fs⌋+1)×(⌊n+2p−fs⌋+1)×ncn×n×ncprev,f×f×ncprev⇒(⌊n+2p−fs⌋+1)×(⌊n+2p−fs⌋+1)×nc
Pooling
Output Dimension
⌊n−fs⌋+1⌊n−fs⌋+1
One Layer of a Convolution Network
Size Symbol | Meaning |
---|---|
f[l]f[l] | Filter Size |
p[l]p[l] | Padding |
s[l]s[l] | Stride |
n[l−1]h×n[l−1]w×n[l−1]cnh[l−1]×nw[l−1]×nc[l−1] | Input |
n[l]h×n[l]w×n[l]cnh[l]×nw[l]×nc[l] | Output |
n[l]cnc[l] | Number of filters |
f[l]×f[l]×n[l−1]cf[l]×f[l]×nc[l−1] | Each filter size |
a[l]→n[l]h×n[l]w×n[l]ca[l]→nh[l]×nw[l]×nc[l] A[l]→m×n[l]h×n[l]w×n[l]cA[l]→m×nh[l]×nw[l]×nc[l] | Activations |
f[l]×f[l]×n[l−1]c×n[l]cf[l]×f[l]×nc[l−1]×nc[l] | Weights |
n[l]cnc[l] | Bias |
n[l]h=⌊n[l−1]h+2p[l]−f[l]s[l]⌋+1nh[l]=⌊nh[l−1]+2p[l]−f[l]s[l]⌋+1
n[l]w=⌊n[l−1]w+2p[l]−f[l]s[l]⌋+1nw[l]=⌊nw[l−1]+2p[l]−f[l]s[l]⌋+1
Types of Layers in a Convolutional Network
Type | Abbr. |
---|---|
Convolution | CONV |
Pooling | POOL |
Fully Connected | FC |
Why Convolutions?
- Parameter Sharing: A feature detector that’s useful in one part of the image is probably useful in aother part of the image.
- Sparsity of Connections: In each layer, each output value depends only on a small number of inputs.