当前位置:网站首页>BatchNorm&&LayerNorm
BatchNorm&&LayerNorm
2022-08-04 05:29:00 【CV小Rookie】
以二维输入情况为例:
BatchNorm:
对一列,也就是某一个特征进行操作:均值变为0,方差变为1;
变换后某个神经元的激活x形成了均值为0,方差为1的正态分布,目的是把值往后续要进行的非线性变换的线性区拉动,增大导数值,增强反向传播信息流动性,加快训练收敛速度。
但是这样会导致网络表达能力下降,为了防止这一点,每个神经元增加两个调节参数(scale和shift),这两个参数是通过训练来学习到的,用来对变换后的激活反变换,使得网络表达能力增强,即对变换后的激活进行如下的scale和shift操作。


LayerNorm:
对每一个样本(也就是一行)进行与BatchNorm一样的操作。

以三维输入情况为例:
BatchNorm:
右图为截面图,可以看到由于样本长度不定,所以在计算mini_batch的均值与方差的时候抖动特别大。预测时是需要记住全局的均值与方差,当预测时碰倒未见过的样本,训练出来的方差与均值不好用 。
LayerNorm:
LayerNorm计算的是样本的方差与均值,不需要计算全局的。相对来说比较稳定。
边栏推荐
- sql中group by的用法
- [Deep Learning 21-Day Learning Challenge] 3. Use a self-made dataset - Convolutional Neural Network (CNN) Weather Recognition
- flink onTimer定时器实现定时需求
- 【go语言入门笔记】13、 结构体(struct)
- Th in thymeleaf: href use notes
- 剑指 Offer 2022/7/1
- (十六)图的基本操作---两种遍历
- Androd Day02
- Thoroughly understand box plot analysis
- 动手学深度学习_卷积神经网络CNN
猜你喜欢
随机推荐
TensorFlow2 study notes: 8. tf.keras implements linear regression, Income dataset: years of education and income dataset
线性回归02---波士顿房价预测
[Deep Learning 21 Days Learning Challenge] 2. Complex sample classification and recognition - convolutional neural network (CNN) clothing image classification
SQL练习 2022/7/1
剑指 Offer 2022/7/2
Matplotlib中的fill_between;np.argsort()函数
(五)栈及其应用
Logistic Regression --- Introduction, API Introduction, Case: Cancer Classification Prediction, Classification Evaluation, and ROC Curve and AUC Metrics
【CV-Learning】Image Classification
IvNWJVPMLt
The use of the attribute of the use of the animation and ButterKnife
MySQL事务详解(事务隔离级别、实现、MVCC、幻读问题)
flink-sql自定义函数
图像形变(插值方法)
【深度学习21天学习挑战赛】备忘篇:我们的神经网模型到底长啥样?——model.summary()详解
【go语言入门笔记】13、 结构体(struct)
动手学深度学习_线性回归
TensorFlow2 study notes: 6. Overfitting and underfitting, and their mitigation solutions
判断字符串是否有子字符串重复出现
【CV-Learning】线性分类器(SVM基础)












