Calculate the Output size in Convolution layer

前端 未结 5 1254
梦毁少年i
梦毁少年i 2020-12-05 05:25

What will be the output size, if the input to convolution layer of neural network is an image of size 128X128X3 and 40 filters of size 5X5 are applied to it?

5条回答
  •  Happy的楠姐
    2020-12-05 05:44

    you can use this formula [(W−K+2P)/S]+1.

    • W is the input volume - in your case 128
    • K is the Kernel size - in your case 5
    • P is the padding - in your case 0 i believe
    • S is the stride - which you have not provided.

    So, we input into the formula:

    Output_Shape = (128-5+0)/1+1
    
    Output_Shape = (124,124,40)
    

    NOTE: Stride defaults to 1 if not provided and the 40 in (124, 124, 40) is the number of filters provided by the user.

提交回复
热议问题