kernel和filter这两个概念在CNN中的区别以及卷积核与卷积层的关系

根据参考文献可知
keras中,
当channels=1时,那么filter就是kernel
当channels>1时,那么filter就是指一堆kernel
其中channels表示卷积核的数量,一般为2的指数次方
[1]中引用了[2],[2]中的一段话引用如下:

So this is where a key distinction between terms comes in handy:
whereas in the 1 channel case, where the term filter and kernel are interchangeable, in the general case,
they’re actually pretty different.
Each filter actually happens to be a collection of kernels, with there being one kernel for every single input channel to the layer,
and each kernel being unique.


卷积核与卷积层的关系(如图)
在这里插入图片描述
上图表示
channels=16
表示这一层有16个卷积核,
一个卷积核:7x7的矩阵。

神经网络怎么处理图片呢?
一张图片如果是RGB形式,一个张量存放:R矩阵和G矩阵和B矩阵
然后每种矩阵都与其中一个卷积核进行卷积运算
然后以此类推,遍历所有的卷积核.

复习下张量:
一个矩阵是一个2D张量,也就是一个数组,数组里面的每个元素是一个向量
一堆矩阵是一个3D张量,也就是一个数组,数组里面的每个元素是一个矩阵

参考文献:
[1]https://stackoverflow.com/questions/47240348/what-is-the-meaning-of-the-none-in-model-summary-of-keras
[2]https://towardsdatascience.com/intuitively-understanding-convolutions-for-deep-learning-1f6f42faee1

猜你喜欢

转载自blog.csdn.net/appleyuchi/article/details/86557080