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