batch normalization 中的 beta 和 gamma参数
来源:互联网 发布:域名续费多少钱 编辑:程序博客网 时间:2024/05/25 18:11
最近从caffe转到tensorflow,突然发现batch normalization 参数变多了,于是本着遇到什么问题解决什么问题的原则,去搜了搜怎么回事。
Caffe
Caffe中的BN层参数:
message BatchNormParameter { // If false, normalization is performed over the current mini-batch // and global statistics are accumulated (but not yet used) by a moving // average. // If true, those accumulated mean and variance values are used for the // normalization. // By default, it is set to false when the network is in the training // phase and true when the network is in the testing phase. optional bool use_global_stats = 1; // What fraction of the moving average remains each iteration? // Smaller values make the moving average decay faster, giving more // weight to the recent values. // Each iteration updates the moving average @f$S_{t-1}@f$ with the // current mean @f$ Y_t @f$ by // @f$ S_t = (1-\beta)Y_t + \beta \cdot S_{t-1} @f$, where @f$ \beta @f$ // is the moving_average_fraction parameter. optional float moving_average_fraction = 2 [default = .999]; // Small value to add to the variance estimate so that we don't divide by // zero. optional float eps = 3 [default = 1e-5];}
tensorflow
tensorflow中的BN层参数:
batch_normalization( x, mean, variance, offset, scale, variance_epsilon, name=None)
多的参数是什么
原本以为BN只是个将tensor标准化的一个过程,为了搞清楚额外的参数是什么,我找到了BN的原始文章:
Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift.
在论文中提到,针对一个特征维度,简化后、基于mini-batch的BN操作为:
如果特征维度之间是相互独立的,那么前三步可以认为是PCA白化的过程,当然,这个假设是不成立的。
不过文中说即使存在一定的相关性,这样的操作仍然能够加速模型训练过程中的收敛。
上边第四个公式就是参数gamma 和 beta, 对应tensorflow batch_normalization 参数中的scale 和offset。
为什么会有这两个参数?
如果单纯地使用前三个公式,有可能会影响一些层的表达能力,例如,如果使用激活函数使用sigmoid,那么这个操作会强制输入数据分布在sigmoid接近线性的部分,接近线性的模型显然不好(影响整个模型的表达能力)。所以文中说把前三个公式作为基本变换(单位变换),加上放缩
在极端情况下,即
阅读全文
0 0
- batch normalization 中的 beta 和 gamma参数
- 深度学习中的Batch Normalization
- RBF SVM中的gamma和C参数
- Batch Normalization
- Batch Normalization
- Batch Normalization
- batch normalization
- Batch Normalization
- Batch Normalization
- batch normalization
- Batch Normalization
- Batch Normalization
- Batch Normalization
- Batch Normalization
- Batch Normalization
- Batch Normalization
- Batch Normalization
- Batch Normalization
- scalikeJDBC
- 微信公众号开发--关注后自动回复(Java记录篇)
- Androidstudio快捷键的使用
- LeetCode 3Sum
- 归并排序算法
- batch normalization 中的 beta 和 gamma参数
- 欧几里得算法&&扩展欧几里得算法
- 对知识图谱的理解报告
- 洛谷 P1799 数列_NOI导刊2010提高(06)
- ESL作业笔记2.5:最小二乘法预测输出的误差期望
- Spring学习笔记(四) --- 装配Bean之通过XML装配
- Ubuntu16.04上启动Spyder出现错误AttributeError: 'module' object has no attribute '_base'
- 实验一线性表的基本操作实现及其应用
- 阿里云ubuntu16.04实测配置【php+mysql+apache】