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 ...
随机推荐
- AtCoder Grand Contest 025 B - RGB Coloring
B - RGB Coloring 求ax + by = k (0<=x<=n && 0<=y<=n)的方案数,最后乘上C(n, x)*C(n,y) 代码: #i ...
- Codeforces 374C - Inna and Dima
374C - Inna and Dima 思路:dfs+记忆化搜索 代码: #include<bits/stdc++.h> using namespace std; #define ll ...
- [C#]获取连接MySql数据库及常用的CRUD操作
测试如下: 首先添加引用:MySql.Data.dll 链接:http://pan.baidu.com/s/1dEQgLpf 密码:bnyu *将链接数据库的信息放入配置文件中(app.config) ...
- (转)C#反射使用时注意BindingFlags的用法
c#反射查找方法时,默认只能查到public方法.如果想要查找private方法,需要设定BindingFlags. 即: BindingFlags.Public|BindingFlags.Insta ...
- putty 显示 ubuntu的文件乱码
http://www.linuxidc.com/Linux/2012-01/52252.htm 下面几个注意点 1) Windows - Appearance - Font settings 里可以更 ...
- 雷林鹏分享:C# 程序结构
C# 程序结构 在我们学习 C# 编程语言的基础构件块之前,让我们先看一下 C# 的最小的程序结构,以便作为接下来章节的参考. C# Hello World 实例 一个 C# 程序主要包括以下部分: ...
- springboot---->错误: 找不到或无法加载主类
刚开始是往上面箭头指出的方向去找问题的原因,但是试了各种方法后问题还是没有解决,于是乎我把焦点转去查看eclipsede控制台处: 主要的错误提示如下: Archive for required li ...
- Lab 3-1
Analyze the malware found in the file Lab03-01.exe using basic dynamic analysis tools. Questions and ...
- 31. Next Permutation (java 字典序生成下一个排列)
题目: Implement next permutation, which rearranges numbers into the lexicographically next greater per ...
- HDU-2586-裸LCA入门-tarjan离线
http://acm.hdu.edu.cn/showproblem.php?pid=2586 给出一颗树和边权,询问两点距离. 考虑tarjan离线做法,做法很巧妙,当前进行到u,对他的儿子v,当v子 ...