在深度学习的算法学习中,都会提到 channels
这个概念。在一般的深度学习框架的 conv2d
中,如 tensorflow 、mxnet ,channels
都是必填的一个参数。
channels
该如何理解?先看一看不同框架中的解释文档。
首先,是 tensorflow 中给出的,对于输入样本中 channels
的含义。一般的RGB图片,channels
数量是 3 (红、绿、蓝);而monochrome图片,channels
数量是 1 。
channels : Number of color channels in the example images. For color images, the number of channels is 3 (red, green, blue). For monochrome images, there is just 1 channel (black). ——tensorflow
其次,mxnet 中提到的,一般 channels
的含义是,每个卷积层中卷积核的数量。
channels (int) : The dimensionality of the output space, i.e. the number of output channels (filters) in the convolution. ——mxnet
为了更直观的理解,下面举个例子,图片使用自 吴恩达老师的深度学习课程 。
如下图,假设现有一个为 6×6×