Caffe中权值初始化方法
来源:互联网 发布:淘宝倒卖赚差价的生意 编辑:程序博客网 时间:2024/05/19 18:41
caffe中权值初始化方式有如下几种:
template <typename Dtype>Filler<Dtype>* GetFiller(const FillerParameter& param) { const std::string& type = param.type(); if (type == "constant") { return new ConstantFiller<Dtype>(param); } else if (type == "gaussian") { return new GaussianFiller<Dtype>(param); } else if (type == "positive_unitball") { return new PositiveUnitballFiller<Dtype>(param); } else if (type == "uniform") { return new UniformFiller<Dtype>(param); } else if (type == "xavier") { return new XavierFiller<Dtype>(param); } else if (type == "msra") { return new MSRAFiller<Dtype>(param); } else if (type == "bilinear") { return new BilinearFiller<Dtype>(param); } else { CHECK(false) << "Unknown filler name: " << param.type(); } return (Filler<Dtype>*)(NULL);}} // namespace caffe
下面来逐一讲解:
1.1 xavier初始化 (归一化初始化)
当激活函数是sigmoid时,使用标准初始化往往性能比较差,收敛较慢且容易陷入局部最优。
“xavier”初始化是一种有效的神经网络舒适化方法,来自于2010年 Xavier Glorot和Yoshua Bengio两人的一篇论文<< Understanding the difficulty of training deep feedforward neural networks >>,配合tanh等函数能够获得比较好的效果。
主要思想是:尽可能保证前向传播和反向传播时每一层的方差尽量相等
推导前提:激活函数是线性的 ReLU和PReLU不满足这一条件
定义参数所在层的输入维度为n,输出维度为m,则参数讲均匀分布在
caffe中提供了3种方式:
(1)默认情况,只考虑输入
(2)FillerParameter_VarianceNorm_FAN_OUT
(3)FillerParameter_VarianceNorm_AVERAGE
1.2 MSRA初始化
来自于MSRA研究员何恺明2015年论文
Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification
传统的固定方差的高斯分布初始化,在网络变深时使得模型很难收敛。
改善的方法有用预训练的模型去初始化网络的部分层;xavier也是不错的初始化方法,但是它需要满足激活函数线性的条件。在MSRA初始化中,考虑了ReLU和PReLU。
MSRA初始化的权重分布是一个均值为0,均值为
同样有3种方案:
(1)默认情况下,n是输入层的维度
(2)n取输出层的维度
(3)n取输入和输出层的均值
1.3 其他初始化
(1)“constant”: 常量初始化
(2)“gaussian”: 固定方差高斯分布初始化
(3)“positive_utiball”:每个值为在[0,1]之间,对于每个
(4)“uniform”: 均匀分布初始化
(5)“bilinear”: 双线性初始化,通常用于反卷积核
- Caffe中权值初始化方法
- caffe中权值初始化方法
- Caffe--xavier初始化方法
- caffe中权值初始化滤波器
- caffe初始化-Xavier
- caffe-msra初始化
- 神经网络中权值初始化的方法
- 初始化方法
- 初始化方法
- 初始化方法
- 初始化方法
- 初始化方法
- Caffe中Layer参数的初始化方式
- Caffe源码阅读(粗读)--网络初始化
- 深度学习caffe:权值初始化
- CAFFE源码学习笔记之初始化Filler
- Caffe 初始化流程理解(数据流建立)
- caffe中卷积层的权重初始化
- whoosh2
- eclipse提示the user operation is waiting的解决方法
- boost bind使用指南
- ios开发之NSPathUtilities
- java反射中getDeclaredMethods和getMethods的区别
- Caffe中权值初始化方法
- [李景山php] 深入理解PHP内核[读书笔记]--第二章:用户代码执行--opcode处理函数查找
- 3.2 JS 变量提升&&函数参数
- 563. Binary Tree Tilt
- Batch Normalization梯度反向传播推导
- 2017-05-09 总结
- Android N 多窗口的设计
- 服务的基本用法-1
- ios 蓝牙开发总结