http://caffe.berkeleyvision.org/tutorial/solver.html 
solver是通过协调前向-反向传播的参数更新来控制参数优化的。一个模型的学习是通过Solver来监督优化和参数更新,以及通过Net来产生loss和梯度完成的。 
Caffe提供的优化方法有:

  • Stochastic Gradient Descent (type: “SGD”),
  • AdaDelta (type: “AdaDelta”),
  • Adaptive Gradient (type: “AdaGrad”),
  • Adam (type: “Adam”),
  • Nesterov’s Accelerated Gradient (type: “Nesterov”),
  • RMSprop (type: “RMSProp”)

The solver

scaffolds the optimization bookkeeping and creates the training network for learning and test network(s) for evaluation. 
iteratively optimizes by calling forward / backward and updating parameters 
(periodically) evaluates the test networks 
snapshots the model and solver state throughout the optimization 
where each iteration

calls network forward to compute the output and loss 
calls network backward to compute the gradients 
incorporates the gradients into parameter updates according to the solver method 
updates the solver state according to learning rate, history, and method 
to take the weights all the way from initialization to learned model.

Like Caffe models, Caffe solvers run in CPU / GPU modes.

SGD

Stochastic gradient descent (type: “SGD”) updates the weights W by a linear combination of the negative gradient ∇L(W) and the previous weight update Vt. The learning rate α is the weight of the negative gradient. The momentum μ is the weight of the previous update.

Formally, we have the following formulas to compute the update value Vt+1 and the updated weights Wt+1 at iteration t+1, given the previous weight update Vt and current weights Wt:

Vt+1=μVt−α∇L(Wt) 
Wt+1=Wt+Vt+1 
The learning “hyperparameters” (α and μ) might require a bit of tuning for best results. If you’re not sure where to start, take a look at the “Rules of thumb” below, and for further information you might refer to Leon Bottou’s Stochastic Gradient Descent Tricks [1].

[1] L. Bottou. Stochastic Gradient Descent Tricks. Neural Networks: Tricks of the Trade: Springer, 2012.

总结solver文件个参数的意义

iteration: 数据进行一次前向-后向的训练 
batchsize:每次迭代训练图片的数量 
epoch:1个epoch就是将所有的训练图像全部通过网络训练一次 
例如:假如有1280000张图片,batchsize=256,则1个epoch需要1280000/256=5000次iteration 
它的max-iteration=450000,则共有450000/5000=90个epoch 
而lr什么时候衰减与stepsize有关,减少多少与gamma有关,即:若stepsize=500, base_lr=0.01, gamma=0.1,则当迭代到第一个500次时,lr第一次衰减,衰减后的lr=lr*gamma=0.01*0.1=0.001,以后重复该过程,所以 
stepsize是lr的衰减步长,gamma是lr的衰减系数。 
在训练过程中,每到一定的迭代次数都会测试,迭代次数是由test-interval决定的,如test_interval=1000,则训练集每迭代1000次测试一遍网络,而 
test_size, test_iter, 和test图片的数量决定了怎样test, test-size决定了test时每次迭代输入图片的数量,test_iter就是test所有的图片的迭代次数,如:500张test图片,test_iter=100,则test_size=5, 而solver文档里只需要根据test图片总数量来设置test_iter,以及根据需要设置test_interval即可。

Caffe的Solver参数设置相关推荐

  1. caffe:Caffe的solver参数介绍

    1. Parameters solver.prototxt文件是用来告诉caffe如何训练网络的.solver.prototxt的各个参数的解释如下: base_lr 这个参数是用来表示网络的初始学习 ...

  2. caffe 下一些参数的设置

    weight_decay防止过拟合的参数,使用方式: 1 样本越多,该值越小 2 模型参数越多,该值越大 一般建议值: weight_decay: 0.0005 lr_mult,decay_mult ...

  3. caffe中solver.prototxt文件参数解释

    在训练或者微调网络时我们需要设置一些参数,在caffe中这些参数保存在sovler.prototxt文件中(当然这只是一个文件名,你也可以随意换成其他的名称).在下面的代码中以注释的形式解释每一个参数 ...

  4. Caffe学习(四)数据层及参数设置

    caffe的各种数据层在caffe.proto文件中有定义.通过对定义的caffe.proto文件进行编译,产生支持各种层操作的c++代码.后面将会详细解读caffe.proto文件(在caffe里就 ...

  5. 利用Caffe训练模型(solver、deploy、train_val) + python如何使用已训练模型

    版权声明:博主原创文章,微信公众号:素质云笔记,转载请注明来源"素质云博客",谢谢合作!! https://blog.csdn.net/sinat_26917383/article ...

  6. caffe命令及其参数解析

    caffe的c++主程序(caffe.cpp)放在根目录下的tools文件夹内, 当然还有一些其它的功能文件,如:convert_imageset.cpp, train_net.cpp, test_n ...

  7. [转]caffe中solver.prototxt参数说明

    https://www.cnblogs.com/denny402/p/5074049.html solver算是caffe的核心的核心,它协调着整个模型的运作.caffe程序运行必带的一个参数就是so ...

  8. 利用Caffe训练模型(solver、deploy、train_val)+python使用已训练模型

    本文部分内容来源于CDA深度学习实战课堂,由唐宇迪老师授课 如果你企图用CPU来训练模型,那么你就疯了- 训练模型中,最耗时的因素是图像大小size,一般227*227用CPU来训练的话,训练1万次可 ...

  9. 卷积神经网络学习路线(五)| 卷积神经网络参数设置,提高泛化能力?

    前言 这是卷积神经网络学习路线的第五篇文章,主要为大家介绍一下卷积神经网络的参数设置,调参技巧以及被广泛应用在了哪些领域,希望可以帮助到大家. 卷积神经网络的参数设置 这个举个例子来说是最好的,因为直 ...

最新文章

  1. python制作生日祝福_【中信项目案例分享】python 实现自动生成个性化生日贺卡...
  2. linux命令find
  3. 自己动手开发智能聊天机器人完全指南(附python完整源码)
  4. Android攻城狮GestureDetector和GestureOverlayView
  5. 认识零信任安全网络架构
  6. 机器学习算法(4)——SVM(以及拉格朗日对偶问题)
  7. html5翻卡片游戏,用 JavaScript 写一个卡片小游戏
  8. 福利 | 国外最牛逼的一套 PPT 作品送给你
  9. javascript实现数据结构:广义表
  10. 谷歌服务器框架最新版本,谷歌服务框架2020最新版本
  11. 51单片机学习笔记0 -- 仿真软件安装(Protues8.0)
  12. CAD中插入外部参照字体会变繁体_CAD缺字体时为什么有些字体无法替换?大字体什么意思?什么是形文件?...
  13. python超简易入门笔记版(其二)
  14. Vue前端页面开发之vue2.0脚手架搭建
  15. R语言输出时,中文变成 \u98ce\u901f \u592a\u9633\u8f90\u5c04
  16. pingssys-ant design pro基础
  17. GBASE 8s 数据库 安装与卸载
  18. java代码校验手机号码_校验手机号码的正则表达式写法 (java实现)
  19. 2022国赛正式题nfs 解题
  20. 一个即将走向社会的软件技术专业学生的感想

热门文章

  1. 一种集各种优点于一身的技术面试方式--转
  2. spring4.x注解概述
  3. Python基础知识(第三天)
  4. 柳青:2017,滴滴实现规模增长和修炼内功的一年
  5. 孙剑亲自撰文:我在 Face++ 的这半年
  6. 实战并发编程 - 04基于不可变模式解决并发问题_2
  7. 白话Elasticsearch04- 结构化搜索之使用terms query搜索多个值以及多值搜索结果优化
  8. Quartz- Quartz API以及Jobs 和Triggers介绍
  9. Spring-AOP 引介切面
  10. Snackbar-Android M新控件