当前位置:网站首页>LRN local response normalization
LRN local response normalization
2022-06-30 18:08:00 【*Yuanzai】
This technique is mainly a technical method to improve accuracy in deep learning training . among caffe、tensorflow Waiting inside is a very common method , It is different from the activation function ,LRN It's usually activated 、 A method of processing after pooling .
AlexNet take LeNet To carry forward the thought of , hold CNN The basic principle is applied to a very deep and wide network .AlexNet The main new technologies used are as follows .
Successful use of ReLU As CNN The activation function of , And verify its effect in the deeper network than Sigmoid, Successfully solved Sigmoid The problem of gradient dispersion in deep network . although ReLU The activation function was proposed a long time ago , But until AlexNet The emergence of the will carry it forward .
Use during training Dropout Ignore some neurons at random , To avoid over fitting the model .Dropout Although there is a separate paper on , however AlexNet Put it to use , Its effect has been proved by practice . stay AlexNet It is mainly used in the last several full connection layers Dropout.
stay CNN Maximum pooling using overlap in . before CNN Average pooling is commonly used in ,AlexNet All use maximum pooling , Avoid the blurring effect of average pooling . also AlexNet The step size is smaller than that of the pool core , In this way, there will be overlap and coverage between the outputs of the pooling layer , Enhance the richness of features .
Put forward LRN layer , Create a competitive mechanism for the activity of local neurons , Make the value with larger response relatively larger , And inhibit other neurons with smaller feedback , It enhances the generalization ability of the model .
The function explanation is quoted from tensorflow Official documents
https://www.tensorflow.org/api_docs/python/tf/nn/local_response_normalization
The 4-D input tensor is treated as a 3-D array of 1-D vectors (along the last dimension), and each vector is normalized independently. Within a given vector, each component is divided by the weighted, squared sum of inputs within depth_radius. In detail,
sqr_sum[a, b, c, d] =
sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)
output = input / (bias + alpha * sqr_sum) ** beta

The formula looks complicated , But it is very simple to understand .i It means the first one i The nuclei are in position (x,y) Use the activation function ReLU Output after ,n It's adjacent in the same position kernal map Number of ,N yes kernal Total of . Parameters K,n,alpha,belta It's all super parameters , General Settings k=2,n=5,aloha=1*e-4,beta=0.75.


In this formula a Represents a convolution layer ( Including convolution operation and pooling operation ) The output after , The structure of the output result is a four-dimensional array [batch,height,width,chnnel], Here is a simple explanation ,batch Batch times ( Each batch is a picture ),height Is the height of the picture ,width Is the width of the picture ,channel The number of channels can be understood as the number of neurons output from a certain picture in a batch of pictures after convolution operation ( Or it can be understood as the depth of the processed picture ).
a x , y i a^i _{x,y} ax,yi Represents a position in this output structure [a,b,c,d], It can be understood as a point at a certain height and a certain width under a certain channel in a certain diagram , That is to say a The number of the picture d The height under each channel is b Width is c The point of . In the thesis formula N Indicates the number of channels (channel).
a,n/2,k,α,β Respectively represent in the function input,depth_radius,bias,alpha,beta, among n/2,k,α,β It's all custom , Pay special attention to ∑ The stacking direction is along the channel direction , That is, the sum of the squares of each point value is along a No 3 dimension channel The direction of the , That is, the front of a point in the same direction n/2 Channels ( The minimum is the... Th 0 Channels ) And after n/2 Channels ( The maximum is... Th d-1 Channels ) The sum of the squares of the points ( common n+1 A little bit ). The English annotation of the function also explains input Think of it as d individual 3 A matrix of dimensions , To put it bluntly is to put input The number of channels is taken as 3 Number of dimensional matrices , The stacking direction is also in the channel direction .
import tensorflow as tf
import numpy as np
x = np.array([i for i in range(1,33)]).reshape([2,2,2,4])
y = tf.nn.lrn(input=x,depth_radius=2,bias=0,alpha=1,beta=1)
with tf.Session() as sess:
print(x)
print('#############')
print(y.eval())

Interpretation of the results :
Pay attention here , If you change this matrix into a picture, the format is like this 
Then according to the above description, we can give an example, such as 26 Corresponding output results 0.00923952 The calculation is as follows 26 / ( 0 + 1 ∗ ( 2 5 2 + 2 6 2 + 2 7 2 + 2 8 2 ) ) 1 26/(0+1*(25^2+26^2+27^2+28^2))^1 26/(0+1∗(252+262+272+282))1
边栏推荐
- Conception d'un centre commercial en ligne basé sur SSH
- [binary tree] preorder traversal to construct binary search tree
- Nft: unlimited possibilities to open the era of encryption Art
- 阿里云ECS导入本地,解决部署的问题
- [zero basic IOT pwn] environment construction
- 联想“双平台”运维解决方案 助力智慧医疗行业智慧管理能力全面提升
- NFT铸造交易平台开发详情
- Compile and generate busybox file system
- Six photos vous montrent pourquoi TCP serre la main trois fois?
- 元宇宙带来的游戏变革会是怎样的?
猜你喜欢

基于SSH的通讯网络电子计费系统

Advanced Mathematics (Seventh Edition) Tongji University General exercises one person solution

Analysis on the construction scheme and necessity of constructing expressway video monitoring platform
![[Netease Yunxin] playback demo build: unable to convert parameter 1 from](/img/6e/41e1eafd4c863c9e5f3a545b69a257.png)
[Netease Yunxin] playback demo build: unable to convert parameter 1 from "asyncmodalrunner *" to "std:: nullptr\u T"**

编译生成busybox文件系统

广电5G正式启航,黄金频段将如何应用引关注

Importing alicloud ECS locally to solve deployment problems

2022上半年盘点:20+主流数据库重大更新及技术要点汇总

Animesr: learnable degradation operator and new real world animation VSR dataset

每日面试1题-蓝队基础面试题-应急响应(1)应急响应基本思路流程+Windows入侵排查思路
随机推荐
IEEE TBD SCI影响因子提升至4.271,位列Q1区!
Simulation of campus network design based on ENSP
Ten thousand volumes - list sorting [01]
K-line diagram must be read for quick start
2022上半年盘点:20+主流数据库重大更新及技术要点汇总
Babbitt | yuanuniverse daily must read: minors ask for a refund after a reward. The virtual anchor says he is a big wrongdoer. How do you think of this regulatory loophole
Grep output with multiple colors- Grep output with multiple Colors?
Canvas mouse control gravity JS effect
K-line diagram interpretation and practical application skills (see position entry)
The secondary menu of the magic article system v5.4.0 supports the optimization of form display
Nft: unlimited possibilities to open the era of encryption Art
MSF后渗透总结
MIT science and Technology Review released the list of innovators under the age of 35 in 2022, including alphafold authors, etc
Redis (IV) - delete policy
Flutter custom component
Several points in MySQL that are easy to ignore and forget
广电5G正式启航,黄金频段将如何应用引关注
Development: how to install offline MySQL in Linux system?
Redis (VII) - sentry
Redis (VI) - master-slave replication