6

I've looked through some great explanations on what different arguments of tf.nn.conv2D represent, but I still can't understand what exactly in_channels and out_channels represent.

Could someone please clarify this for me?

Massyanya
  • 2,844
  • 8
  • 28
  • 37

1 Answers1

20

Lets say you have a image of size 64x64. It is composed of R-G-B of 64x64 each, so the input size is 64x64x3 and 3 is the input channel in this case. Now you want to convolve this input with a kernel of 5x5x3, you get an output of 64x64x1 (with padding). Suppose you have 100 such kernels and convolve each one of them with the input, you get 64x64x100. Here the output channels are 100.

Vijay Mariappan
  • 16,921
  • 3
  • 40
  • 59
  • sir , How we decide the no of filter output channels? – Aaditya Ura May 20 '18 at 18:20
  • It's a hyperparameter,you need to fine tune, a smaller value may cause under fitting, while a larger value may over fit the data. – Vijay Mariappan May 21 '18 at 05:11
  • I felt that the number of output channels is just the same as the number of kernels in this case. Is this correct? And may I also wonder why do we have output of `64*64*1` for the output after applying a kernel of `5*5*3`? Thanks. – Qiyu Zhong Oct 20 '21 at 04:47