Caffe之learning rate policy
来源:互联网 发布:许昌自学考试网络报名 编辑:程序博客网 时间:2024/06/06 07:04
learning rate很重要,如何设置它有很多种方法,在Caffe源码的caffe-master\src\caffe\solvers\sgd_solver.cpp中的GetLearningRate函数注释中有对应的介绍,如下:
// policies are as follows:// - fixed: always return base_lr.// - step: return base_lr * gamma ^ (floor(iter / step))// - exp: return base_lr * gamma ^ iter// - inv: return base_lr * (1 + gamma * iter) ^ (- power)// - multistep: similar to step but it allows non uniform steps defined by// stepvalue// - poly: the effective learning rate follows a polynomial decay, to be// zero by the max_iter. return base_lr (1 - iter/max_iter) ^ (power)// - sigmoid: the effective learning rate follows a sigmod decay// return base_lr ( 1/(1 + exp(-gamma * (iter - stepsize))))//
废话不多说,直接看它们的图像一目了然:
对应matlab代码是:
iter=1:50000; max_iter=50000; base_lr=0.01; gamma=0.0001; power=0.75; step_size=5000; % - fixed: always return base_lr. lr=base_lr*ones(1,50000); subplot(2,3,1) plot(lr) title('fixed') % - step: return base_lr * gamma ^ (floor(iter / step)) lr=base_lr .* gamma.^(floor(iter./10000)); subplot(2,3,2) plot(lr) title('step') % - exp: return base_lr * gamma ^ iter lr=base_lr * gamma .^ iter; subplot(2,3,3) plot(lr) title('exp') % - inv: return base_lr * (1 + gamma * iter) ^ (- power) lr=base_lr.*(1./(1+gamma.*iter).^power); subplot(2,3,4) plot(lr) title('inv') % - multistep: similar to step but it allows non uniform steps defined by % stepvalue % - poly: the effective learning rate follows a polynomial decay, to be % zero by the max_iter. return base_lr (1 - iter/max_iter) ^ (power) lr=base_lr *(1 - iter./max_iter) .^ (power); subplot(2,3,5) plot(lr) title('poly') % - sigmoid: the effective learning rate follows a sigmod decay % return base_lr ( 1/(1 + exp(-gamma * (iter - stepsize)))) lr=base_lr *( 1./(1 + exp(-gamma * (iter - step_size)))); subplot(2,3,6) plot(lr) title('sigmoid')
What is `lr_policy` in Caffe?
0 0
- Caffe之learning rate policy
- Caffe中learning rate 和 weight decay 的理解
- Caffe中learning rate 和 weight decay 的理解
- Caffe中learning rate 和 weight decay 的理解
- learning rate
- 学习率Learning rate
- keras learning rate
- Learning Rate Annealing
- Plot Learning Rate
- 学习率 Learning Rate
- weight decay and learning rate
- learning rate 和weight decay
- Momentum and Learning Rate Adaptation
- 深入理解deep learning之caffe BLOB
- 梯度下降实用技巧II之学习率 Gradient descent in practice II -- learning rate
- rate程序之路--
- MDF结合Learning rate adjust应用
- learning rate四种改变方式
- HTML规范-代码格式
- 新建登录页并实现tabBar隐藏
- 3D打印机翘边问题解决方法
- 计算mover distance的问题,速度太慢了
- 数组概念和用法
- Caffe之learning rate policy
- 数据建模师的日常--小技巧篇
- 优秀的运营思维方式,往往就是「一句话」的事
- web网站性能指标
- 机器学习(周志华)- 第2章模型评估与选择笔记
- aria2下载输出信息样本搜集
- 简单聊聊网页的资源加载优化
- zabbix3.0.4报错Get value from agent failed: cannot connect to [[1.1.1.1]:10050]: [4] Interrupted syste
- 简析BlockingQueue