kernel和filter这两个概念在CNN中的区别以及卷积核与卷积层的关系
根據(jù)參考文獻可知
keras中,
當channels=1時,那么filter就是kernel
當channels>1時,那么filter就是指一堆kernel
其中channels表示卷積核的數(shù)量,一般為2的指數(shù)次方
[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的矩陣。
神經(jīng)網(wǎng)絡怎么處理圖片呢?
一張圖片如果是RGB形式,一個張量存放:R矩陣和G矩陣和B矩陣
然后每種矩陣都與其中一個卷積核進行卷積運算
然后以此類推,遍歷所有的卷積核.
復習下張量:
一個矩陣是一個2D張量,也就是一個數(shù)組,數(shù)組里面的每個元素是一個向量
一堆矩陣是一個3D張量,也就是一個數(shù)組,數(shù)組里面的每個元素是一個矩陣
參考文獻:
[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
總結
以上是生活随笔為你收集整理的kernel和filter这两个概念在CNN中的区别以及卷积核与卷积层的关系的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: keras中的神经网络为什么需要多次ep
- 下一篇: RHEL7恢复.bashrc文件