batch normalization与layer normalization

1,batch normalization是以特征为主体进行标准化,一个batch中所有样本的某个特征组成一组数,对这组数进行标准化。

在这里插入图片描述

2,layer normalization是以样本为主体进行标准化,某个样本的所有特征组成一组数,对这组数进行标准化。

在这里插入图片描述

3,标准化最常用的方法就是减去平均值,再除以标准差。

在这里插入图片描述

4,标准化的目的:1),加快训练的速度;2),防止梯度爆炸。

batch normalization常用在CNN上,而用layer normalization用在RNN和transformer上更合适,因为序列数据的长度不一,导致有些特征在部分样本中没有,给基于特征的标准化带来了麻烦。

5,batch normalization的缺点:

1),In batch normalization, we use the batch statistics: the mean and standard deviation corresponding to the current mini-batch. However, when the batch size is small, the sample mean and sample standard deviation are not representative enough of the actual distribution and the network cannot learn anything meaningful.

2),As batch normalization depends on batch statistics for normalization, it is less suited for sequence models. This is because, in sequence models, we may have sequences of potentially different lengths and smaller batch sizes corresponding to longer sequences.

Reference

https://www.pinecone.io/learn/batch-layer-normalization/

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值