卷积层公式
卷积层公式
- our input layer has a width of W and a height of H(输入图层宽度 W 高度H)
- our convolutional layer has a filter size F
(卷积层过滤器大小 F,二维卷积则为(F, F)) - we have a stride of S (步长 S, 每隔多少步长做一次卷积)
- a padding of P (填充 P, 图片外围填充宽度)
- and the number of filters K (过滤器的个数)
the following formula gives us the width of the next layer: W_out =[ (W−F+2P)/S] + 1.
The output height would be H_out = [(H-F+2P)/S] + 1.
And the output depth would be equal to the number of filters D_out = K.
The output volume would be W_out * H_out * D_out = 2.
如下图所示
输入为三个(5×5)的矩阵,即(5×5×3), 步长为2, 二维卷积核的大小为(3×3), padding 为1, 过滤器个数为2(每个过滤器的大小为(3×3×3)).
由上述公式可知:
W_out = [ (W−F+2P)/S] + 1 = [(5-3+2)/2]+1 =3
H_out = [ (W−F+2P)/S] + 1 = [(5-3+2)/2]+1 =3
D_out = 2
1 =3
D_out = 2