LRN(Local Response Normalize Layer) 局部响应归一化层
LRN最早见于Alex的那篇用CNN参加ImageNet比赛的论文,Alex在论文中解释了LRN层模仿了生物神经系统的“侧抑制”机制,对局部神经元的活动创建竞争环境,使得其中响应比较大的值变得相对更大,并抑制其他反馈较小的神经元,增强了模型的泛华能力。Alex在ImageNet数据集上的实验表明,使用LRN后CNN在Top1的错误率将降低1.4%,因此在后来的AlexNet中也加入了LRN层。
这种正则手段的有效性一直不太确定,查阅了很多蚊香似乎也没有详细的解释,由于后来提出的batch normalization手段太过火热,渐渐的就把local response normalization放弃了
《ImageNet classification with deep convolutional neural networks》
http://www.cs.virginia.edu/~vicente/recognition/slides/lecture07/nips2012.pdf
以上这种归一手段的公式,其中a的上标指该层的第几个feature map,a的下标x,y表示feature map的像素位置,N指feature map的总数量,公式里的其他参数都是超参,需要自己指定的。
Args:
input: A `Tensor`. Must be one of the following types: `float32`, `half`.
4-D.
depth_radius: An optional `int`. Defaults to `5`.
0-D. Half-width of the 1-D normalization window.
bias: An optional `float`. Defaults to `1`.
An offset (usually positive to avoid dividing by 0).
alpha: An optional `float`. Defaults to `1`.
A scale factor, usually positive.
beta: An optional `float`. Defaults to `0.5`. An exponent.
name: A name for the operation (optional).
第一个参数input:这个输入就是feature map了,既然是feature map,那么它就具有[batch,height,width,channels]这样的shape
第二个参数depth_radius:这个值需要自己指定,就是上述公式中的n/2
第三个参数bias:公式中的k
第四个参数alpha:公式中的α
第五个参数beta:公式中的β
返回值是新的feature map,它应该具有和原feature map相同的shape