Keras Conv2D and input channels

前端 未结 3 1539
面向向阳花
面向向阳花 2021-01-30 16:32

The Keras layer documentation specifies the input and output sizes for convolutional layers: https://keras.io/layers/convolutional/

Input shape: (samples, channels

3条回答
  •  孤城傲影
    2021-01-30 17:14

    It might be confusing that it is called Conv2D layer (it was to me, which is why I came looking for this answer), because as Nilesh Birari commented:

    I guess you are missing it's 3D kernel [width, height, depth]. So the result is summation across channels.

    Perhaps the 2D stems from the fact that the kernel only slides along two dimensions, the third dimension is fixed and determined by the number of input channels (the input depth).

    For a more elaborate explanation, read https://petewarden.com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

    I plucked an illustrative image from there:

提交回复
热议问题