作者:wjmishuai

出处: http://blog.csdn.net/wjmishuai/article/details/50890214

    1. 原始数据是28*28
    2. 1:数据层:
    3. layer {
    4. name: "mnist"//数据层的名字是mnist
    5. type: "Data"//这个层的类型是data
    6. top: "data"//产生两个blob,一个是data blob
    7. top: "label"//一个是lable blob
    8. include {
    9. phase: TRAIN
    10. }
    11. transform_param {
    12. scale: 0.00390625//像素归一化
    13. }
    14. data_param {
    15. source: "examples/mnist/mnist_train_lmdb"
    16. batch_size: 64
    17. backend: LMDB
    18. }
    19. }
    20. 2:卷积层
    21. layer {
    22. name: "conv1"
    23. type: "Convolution"
    24. bottom: "data"//获取上一层的data blob
    25. top: "conv1"//产生conv1层
    26. param {
    27. lr_mult: 1//学习率。表示 weight的学习率和slover.pro中的学习率是一致的。
    28. }
    29. param {
    30. lr_mult: 2//表示 bias的学习率是slover.pro中的学习率的2倍。  这样设置会导致更快的收敛
    31. }
    32. convolution_param {
    33. num_output: 20//cov1层将产生输出20个通道
    34. kernel_size: 5//卷积核大小是5*5
    35. stride: 1//步长是1
    36. weight_filler {//权重填充器,使用xavier算法填充weight。根据输入和输出神经元的数量自动确定初始化的规模。
    37. type: "xavier"
    38. }
    39. bias_filler {//偏置填充器,使用constant算法填充bias。是一个常数,默认是0
    40. type: "constant"
    41. }
    42. }
    43. }
    44. 3:池化层(避免数据过拟合)
    45. layer {
    46. name: "pool1"
    47. type: "Pooling"
    48. bottom: "conv1"
    49. top: "pool1"
    50. pooling_param {
    51. pool: MAX//使用MAX进行池化
    52. kernel_size: 2//卷积核大小是2*2
    53. stride: 2//步长是2
    54. }
    55. }
    56. 4:全连接层
    57. layer {
    58. name: "ip1"
    59. type: "InnerProduct"
    60. bottom: "pool2"
    61. top: "ip1"
    62. param {
    63. lr_mult: 1
    64. }
    65. param {
    66. lr_mult: 2
    67. }
    68. inner_product_param {
    69. num_output: 500//产生500维的输出数据
    70. weight_filler {
    71. type: "xavier"
    72. }
    73. bias_filler {
    74. type: "constant"
    75. }
    76. }
    77. }
    78. 5:ReLU层(紧跟在全连接层后,目的是节省内存)
    79. layer {
    80. name: "relu1"
    81. type: "ReLU"
    82. bottom: "ip1"
    83. top: "ip1"
    84. }
    85. ReLU层后紧跟一个InnerProduct层
    86. layer {
    87. name: "ip2"
    88. type: "InnerProduct"
    89. bottom: "ip1"
    90. top: "ip2"
    91. param {
    92. lr_mult: 1
    93. }
    94. param {
    95. lr_mult: 2
    96. }
    97. inner_product_param {
    98. num_output: 10//因为有10类,所以输出10
    99. weight_filler {
    100. type: "xavier"
    101. }
    102. bias_filler {
    103. type: "constant"
    104. }
    105. }
    106. }
    107. 6:Loss层//不产生任何输出,只是用来计算损失函数的值,用来初始化ip2的gradient
    108. layer {
    109. name: "loss"
    110. type: "SoftmaxWithLoss"
    111. bottom: "ip2"//需要两个blob,一个是ip2,作为预测用
    112. bottom: "label"//来自数据层,作为标签
    113. top: "loss"
    114. }

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模型参数解释的更多相关文章

  1. 梯度优化算法总结以及solver及train.prototxt中相关参数解释

    参考链接:http://sebastianruder.com/optimizing-gradient-descent/ 如果熟悉英文的话,强烈推荐阅读原文,毕竟翻译过程中因为个人理解有限,可能会有谬误 ...

  2. CNN tflearn处理mnist图像识别代码解说——conv_2d参数解释,整个网络的训练,主要就是为了学那个卷积核啊。

    官方参数解释: Convolution 2D tflearn.layers.conv.conv_2d (incoming, nb_filter, filter_size, strides=1, pad ...

  3. LTE Module User Documentation(翻译1)——背景、使用概述、基本的仿真程序和配置LTE模型参数

    LTE用户文档 (如有不当的地方,欢迎指正!) 1.背景 假定读者已经熟悉 ns-3 simulator ,能运行一般的仿真程序.如果不是的话,强烈推荐读者参考 [ns3tutorial].   2. ...

  4. Yolov3参数解释以及答疑

    目录 参数解析 训练答疑 ​ 参数解析 [net] #Testing #batch=1 //test:一次一个图片 #subdivisions=1 #Training batch=32 //一次迭代送 ...

  5. (原)linux下caffe模型转tensorflow模型

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/7419352.html 参考网址: https://github.com/ethereon/caffe- ...

  6. my.cnf 配置文件参数解释

    my.cnf 配置文件参数解释: #*** client options 相关选项 ***# #以下选项会被MySQL客户端应用读取.注意只有MySQL附带的客户端应用程序保证可以读取这段内容.如果你 ...

  7. TensorFlow模型转为caffe模型

    最近由于要将训练好的模型移植到硬件上,因此需要将TensorFlow转为caffe模型. caffe模型需要两个文件,一个是定义网络结构的prototxt,一个是存储了参数的caffemodel文件. ...

  8. Caffe模型读取

    caffe模型最终保存使用过的protobuf形式,将一个已经训练好的caffe模型读取出来,可以参考如下: 1,包含的头文件: #include <google/protobuf/io/cod ...

  9. TensorFlow Object Detection API中的Faster R-CNN /SSD模型参数调整

    关于TensorFlow Object Detection API配置,可以参考之前的文章https://becominghuman.ai/tensorflow-object-detection-ap ...

随机推荐

  1. conda-使用手册

    conda remove -n tf --all ##删除环境 conda env export -- name ##首先导出配置文件: conda env create -f name.yml ## ...

  2. mui 引导页

    引导页制作 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <met ...

  3. python中进程间通讯——文件锁之fcntl模块的使用

    python 中给文件加锁——fcntl模块import fcntl 打开一个文件##当前目录下test文件要先存在,如果不存在会报错.或者以写的方式打开f = open('./test')对该文件加 ...

  4. JS 日期比较方法

    1.日期参数格式:yyyy-mm-dd // a: 日期a, b: 日期b, flag: 返回的结果 function duibi(a, b,flag) { var arr = a.split(&qu ...

  5. MySQL 8.0 安装时 Authentication Method

    1. 使用强密码加密授权(推荐) 8.0提供的心的授权方式,采用SHA256基础的密码加密方法. 但是需要新版本的connector,目前和Connector/J最新的时8.0 目前8.0的连接器和使 ...

  6. fMRI在认知心理学上的研究

    参考:Principles of fMRI 1 问题: 1. fMRI能做什么不能做什么? 第一周:fMRI简介,data acquisition and reconstruction 大致分为两类: ...

  7. OPSF - 2,状态机

    1,报文更新地址     点到点:所有报文发送224.0.0.5     虚链路:单播地址     广播网络上:DR OTHER至DR/BDR 224.0.0.6,DR/BDR至DR OTEHER 2 ...

  8. Selenium自动化测试框架入门整理

    ​​关注嘉为科技,获取运维新知 本文主要针对Selenium自动化测试框架入门整理,只涉及总体功能及框架要点介绍说明,以及使用前提技术基础要求整理说明.作为开发人员.测试人员入门参考. 本文参考:Se ...

  9. layui checkbox无法显示出来问题

    {type:'checkbox'} // ,{field: 'product_id', hide: 'true'} ,{field: 'id', title: 'ID', width: 90, fix ...

  10. 『TensorFlow』迁移学习

    完全版见github:TransforLearning 零.迁移学习 将一个领域的已经成熟的知识应用到其他的场景中称为迁移学习.用神经网络的角度来表述,就是一层层网络中每个节点的权重从一个训练好的网络 ...