前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Caffe 关于 LetNet-5 之 lenet_solver.prototxt 解析

Caffe 关于 LetNet-5 之 lenet_solver.prototxt 解析

作者头像
用户1148525
发布2019-05-28 13:54:25
3870
发布2019-05-28 13:54:25
举报

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1437160

对于 LetNet-5 这个模型,在训练和测试时涉及到一些参数, Caffe 在 lenet_solver.prototxt 这个参数描述文件定义了相关参数。

代码语言:javascript
复制
# The train/test net protocol buffer definition   // 参数描述文件
net: "examples/mnist/lenet_train_test.prototxt"   //位置
# test_iter specifies how many forward passes the test should carry out. 
# In the case of MNIST, we have test batch size 100 and 100 test iterations,
# covering the full 10,000 testing images. // 一共10000张测试图像,test batch size 100 每次测试处理100张
test_iter: 100  // 进行100次前向计算,test_iter*test batch size =10000
# Carry out testing every 500 training iterations.
test_interval: 500 // 每训练500次,进行一次测试
# The base learning rate, momentum and the weight decay of the network.
base_lr: 0.01  //基础学习率
momentum: 0.9  //学习率 改变的动量
weight_decay: 0.0005 //学习率衰减系数
# The learning rate policy  //学习策略 及相关参数
lr_policy: "inv"
gamma: 0.0001
power: 0.75
# Display every 100 iterations
display: 100   //迭代100次 打印输出一次结果
# The maximum number of iterations
max_iter: 10000   //最大迭代数
# snapshot intermediate results
snapshot: 5000     //5000次迭代保存一次临时模型,名称为lenet_iter_5000.caffemodel
snapshot_prefix: "examples/mnist/lenet"
# solver mode: CPU or GPU // 使用CPU还是GPU
solver_mode: GPU   //打开GPU

snapshot作用:可以今天训练5000次,然后关机回家睡觉,明天接着在此5000次基础之上再训练5000次。一个模型训练个几周时间,万一中间出了点故障,难道需要从头再来。所以保存中间的训练模型还是很有必要的。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2016年12月13日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档