caffe模型参数解释
作者:wjmishuai
出处: http://blog.csdn.net/wjmishuai/article/details/50890214
- 原始数据是28*28
- 1:数据层:
- layer {
- name: "mnist"//数据层的名字是mnist
- type: "Data"//这个层的类型是data
- top: "data"//产生两个blob,一个是data blob
- top: "label"//一个是lable blob
- include {
- phase: TRAIN
- }
- transform_param {
- scale: 0.00390625//像素归一化
- }
- data_param {
- source: "examples/mnist/mnist_train_lmdb"
- batch_size: 64
- backend: LMDB
- }
- }
- 2:卷积层
- layer {
- name: "conv1"
- type: "Convolution"
- bottom: "data"//获取上一层的data blob
- top: "conv1"//产生conv1层
- param {
- lr_mult: 1//学习率。表示 weight的学习率和slover.pro中的学习率是一致的。
- }
- param {
- lr_mult: 2//表示 bias的学习率是slover.pro中的学习率的2倍。 这样设置会导致更快的收敛
- }
- convolution_param {
- num_output: 20//cov1层将产生输出20个通道
- kernel_size: 5//卷积核大小是5*5
- stride: 1//步长是1
- weight_filler {//权重填充器,使用xavier算法填充weight。根据输入和输出神经元的数量自动确定初始化的规模。
- type: "xavier"
- }
- bias_filler {//偏置填充器,使用constant算法填充bias。是一个常数,默认是0
- type: "constant"
- }
- }
- }
- 3:池化层(避免数据过拟合)
- layer {
- name: "pool1"
- type: "Pooling"
- bottom: "conv1"
- top: "pool1"
- pooling_param {
- pool: MAX//使用MAX进行池化
- kernel_size: 2//卷积核大小是2*2
- stride: 2//步长是2
- }
- }
- 4:全连接层
- layer {
- name: "ip1"
- type: "InnerProduct"
- bottom: "pool2"
- top: "ip1"
- param {
- lr_mult: 1
- }
- param {
- lr_mult: 2
- }
- inner_product_param {
- num_output: 500//产生500维的输出数据
- weight_filler {
- type: "xavier"
- }
- bias_filler {
- type: "constant"
- }
- }
- }
- 5:ReLU层(紧跟在全连接层后,目的是节省内存)
- layer {
- name: "relu1"
- type: "ReLU"
- bottom: "ip1"
- top: "ip1"
- }
- ReLU层后紧跟一个InnerProduct层
- layer {
- name: "ip2"
- type: "InnerProduct"
- bottom: "ip1"
- top: "ip2"
- param {
- lr_mult: 1
- }
- param {
- lr_mult: 2
- }
- inner_product_param {
- num_output: 10//因为有10类,所以输出10
- weight_filler {
- type: "xavier"
- }
- bias_filler {
- type: "constant"
- }
- }
- }
- 6:Loss层//不产生任何输出,只是用来计算损失函数的值,用来初始化ip2的gradient
- layer {
- name: "loss"
- type: "SoftmaxWithLoss"
- bottom: "ip2"//需要两个blob,一个是ip2,作为预测用
- bottom: "label"//来自数据层,作为标签
- top: "loss"
- }
name: 表示该层的名称,可随意取
type: 层类型,如果是Data,表示数据来源于LevelDB或LMDB。根据数据的来源不同,数据层的类型也不同(后面会详细阐述)。一般在练习的时候,我们都是采 用的LevelDB或LMDB数据,因此层类型设置为Data。
top或bottom: 每一层用bottom来输入数据,用top来输出数据。如果只有top没有bottom,则此层只有输出,没有输入。反之亦然。如果有多个 top或多个bottom,表示有多个blobs数据的输入和输出。
data 与 label: 在数据层中,至少有一个命名为data的top。如果有第二个top,一般命名为label。 这种(data,label)配对是分类模型所必需的。
include: 一般训练的时候和测试的时候,模型的层是不一样的。该层(layer)是属于训练阶段的层,还是属于测试阶段的层,需要用include来指定。如果没有include参数,则表示该层既在训练模型中,又在测试模型中。
Transformations: 数据的预处理,可以将数据变换到定义的范围内。如设置scale为0.00390625,实际上就是1/255, 即将输入数据由0-255归一化到0-1之间
caffe模型参数解释的更多相关文章
- 梯度优化算法总结以及solver及train.prototxt中相关参数解释
参考链接:http://sebastianruder.com/optimizing-gradient-descent/ 如果熟悉英文的话,强烈推荐阅读原文,毕竟翻译过程中因为个人理解有限,可能会有谬误 ...
- CNN tflearn处理mnist图像识别代码解说——conv_2d参数解释,整个网络的训练,主要就是为了学那个卷积核啊。
官方参数解释: Convolution 2D tflearn.layers.conv.conv_2d (incoming, nb_filter, filter_size, strides=1, pad ...
- LTE Module User Documentation(翻译1)——背景、使用概述、基本的仿真程序和配置LTE模型参数
LTE用户文档 (如有不当的地方,欢迎指正!) 1.背景 假定读者已经熟悉 ns-3 simulator ,能运行一般的仿真程序.如果不是的话,强烈推荐读者参考 [ns3tutorial]. 2. ...
- Yolov3参数解释以及答疑
目录 参数解析 训练答疑 参数解析 [net] #Testing #batch=1 //test:一次一个图片 #subdivisions=1 #Training batch=32 //一次迭代送 ...
- (原)linux下caffe模型转tensorflow模型
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/7419352.html 参考网址: https://github.com/ethereon/caffe- ...
- my.cnf 配置文件参数解释
my.cnf 配置文件参数解释: #*** client options 相关选项 ***# #以下选项会被MySQL客户端应用读取.注意只有MySQL附带的客户端应用程序保证可以读取这段内容.如果你 ...
- TensorFlow模型转为caffe模型
最近由于要将训练好的模型移植到硬件上,因此需要将TensorFlow转为caffe模型. caffe模型需要两个文件,一个是定义网络结构的prototxt,一个是存储了参数的caffemodel文件. ...
- Caffe模型读取
caffe模型最终保存使用过的protobuf形式,将一个已经训练好的caffe模型读取出来,可以参考如下: 1,包含的头文件: #include <google/protobuf/io/cod ...
- TensorFlow Object Detection API中的Faster R-CNN /SSD模型参数调整
关于TensorFlow Object Detection API配置,可以参考之前的文章https://becominghuman.ai/tensorflow-object-detection-ap ...
随机推荐
- Linux修改hostname时/etc/hosts、/etc/sysconfig/network ,hostname,三者的区别和联系
[root@localhost /]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.l ...
- (转)C# 之泛型详解
什么是泛型 我们在编写程序时,经常遇到两个模块的功能非常相似,只是一个是处理int数据,另一个是处理string数据,或者其他自定义的数据类型,但我们没有办法,只能分别写多个方法处理每个数据类型,因为 ...
- 卡方分布 | t检验 | F检验 | 卡方检验 | 假设检验 | 各种检验持续总结
Chi-square distribution introduction 这个视频真的好,完美地解释了卡方统计量是怎么来的! 我们有一个标准正态分布的总体,我们从其中抽一次,取该值的平方就是Q1统计量 ...
- ROC曲线(receiver-operating-characteristic curve)-阈值评价标准(转)
转自:http://blog.csdn.net/abcjennifer/article/details/7359370 ROC曲线指受试者工作特征曲线 / 接收器操作特性曲线(receiver ope ...
- English trip M1 - AC9 Nosey people 爱管闲事的人 Teacher:Solo
In this lesson you will learn to talk about what happened. 在本课中,您将学习如何谈论发生的事情. 课上内容(Lesson) # four “ ...
- tigervnc-server安装使用
root/finance, hm/finance 一,安装tigervnc-server VNC软件包 [root@localhost ~]# yum install tigervnc-serve ...
- anaconda安装tensorflow
1.下载anaconda python3.5版本,Windows不支持python3.6,linux和mac支持python2.7和python3.3+ 2.创建环境 conda create - ...
- CentOS6.8下实现配置配额
CentOS6.8下实现配置配额 Linux系统是支持多用户的,即允许多个用户同时使用linux系统,普通用户在/home/目录下均有自己的家目录,在默认状态下,各个用户可以在自己的家目录下任意创建文 ...
- Android BottomNavigationBar底部导航控制器的使用(包含默认postion的设置)
转载请标明出处:http://blog.csdn.net/u010046908/article/details/50962081本文出自:[李东的博客] 最近Google在自己推出的Material ...
- STLC - 软件测试生命周期
什么是软件测试生命周期(STLC)? 软件测试生命周期(STLC)定义为执行软件测试的一系列活动. 它包含一系列在方法上进行的活动,以帮助认证您的软件产品. 图 - 软件测试生命周期的不同阶段 每个阶 ...