深度学习的Xavier初始化方法
在tensorflow中,有一个初始化函数:tf.contrib.layers.variance_scaling_initializer。Tensorflow 官网的介绍为:
variance_scaling_initializer(
factor=2.0,
mode='FAN_IN',
uniform=False,
seed=None,
dtype=tf.float32
)
1
2
3
4
5
6
7
Returns an initializer that generates tensors without scaling variance.
When initializing a deep network, it is in principle advantageous to keep the scale of the input variance constant, so it does not explode or diminish by reaching the final layer. This initializer use the following formula:
if mode='FAN_IN': # Count only number of input connections.
n = fan_in
elif mode='FAN_OUT': # Count only number of output connections.
n = fan_out
elif mode='FAN_AVG': # Average number of inputs and output connections.
n = (fan_in + fan_out)/2.0
truncated_normal(shape, 0.0, stddev=sqrt(factor / n))
1
2
3
4
5
6
7
8
这段话可以理解为,通过使用这种初始化方法,我们能够保证输入变量的变化尺度不变,从而避免变化尺度在最后一层网络中爆炸或者弥散。
这个方法就是 Xavier 初始化方法,可以从以下这两篇论文去了解这个方法:
·X. Glorot and Y. Bengio. Understanding the difficulty of training deepfeedforward neural networks. In International Conference on Artificial Intelligence and Statistics, pages 249–256, 2010.
Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S.Guadarrama, and T. Darrell. Caffe: Convolutional architecture for fast featureembedding. arXiv:1408.5093, 2014.
或者可以通过这些文章去了解:
CNN数值
三种权重的初始化方法
深度学习——Xavier初始化方法
---------------------
作者:路虽远在路上
来源:CSDN
原文:https://blog.csdn.net/u010185894/article/details/71104387
版权声明:本文为博主原创文章,转载请附上博文链接!
相关文章
- 拯救深度学习:标注数据不足下的深度学习方法
- 深度学习中的各种池化方法
- 【神经网络与深度学习】chainer边运行边定义的方法使构建深度学习网络变的灵活简单
- “Error:(3, 24) java: 程序包org.junit不存在”的3种解决方法
- 机器学习中常见的过拟合解决方法
- 线上分享干货 | Deep-ReID: 关于行人重识别的深度学习方法
- 集成学习方法
- ByteBuffer常用方法详解
- 深度学习的这些坑你都遇到过吗?神经网络 11 大常见陷阱及应对方法
- Java菜鸟学习笔记--面向对象篇(十六):Object类方法
- 入门 | 一文简述深度学习优化方法——梯度下降
- 深度学习之目标检测 第4章 深度学习目标检测方法
- PyQt学习随笔:QTableWidget的visualRow、visualColumn、logicalRow、logicalColumn(可见行、逻辑行、可见列、逻辑列)相关概念及方法探究
- PyQt(Python+Qt)学习随笔:Designer中的QDialogButtonBox增加自定义按钮的方法
- PyQt学习随笔:槽函数获取信号发送对象的方法
- proteus中的标签及总线的使用方法
- 如何学好VC和MFC(各前辈学习方法及感受整理)(一)
- ES6学习之路5----数组方法