转自:https://blog.csdn.net/wjmishuai/article/details/50890214

刚开始摸caffe,找了个比较清楚的模型。

原始数据是28* 

input: "data"
input_dim: 60 // number of picture
input_dim: 1 // channel
input_dim: 1 // heigth
input_dim: 784 // width

input: "data"
input_dim: 60 // number of picture
input_dim: 1 // channel
input_dim: 1 // heigth
input_dim: 784 // width

:数据层:
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:
backend: LMDB
}
}
:卷积层
layer {
name: "conv1"
type: "Convolution"
bottom: "data"//获取上一层的data blob
top: "conv1"//产生conv1层
param {
lr_mult: //学习率。表示 weight的学习率和slover.pro中的学习率是一致的。
}
param {
lr_mult: //表示 bias的学习率是slover.pro中的学习率的2倍。 这样设置会导致更快的收敛
}
convolution_param {
num_output: //cov1层将产生输出20个通道
kernel_size: //卷积核大小是5*5
stride: //步长是1
weight_filler {//权重填充器,使用xavier算法填充weight。根据输入和输出神经元的数量自动确定初始化的规模。
type: "xavier"
}
bias_filler {//偏置填充器,使用constant算法填充bias。是一个常数,默认是0
type: "constant"
}
}
}
:池化层(避免数据过拟合)
layer {
name: "pool1"
type: "Pooling"
bottom: "conv1"
top: "pool1"
pooling_param {
pool: MAX//使用MAX进行池化
kernel_size: //卷积核大小是2*2
stride: //步长是2
}
} :全连接层
layer {
name: "ip1"
type: "InnerProduct"
bottom: "pool2"
top: "ip1"
param {
lr_mult:
}
param {
lr_mult:
}
inner_product_param {
num_output: //产生500维的输出数据
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
} :ReLU层(紧跟在全连接层后,目的是节省内存)
layer {
name: "relu1"
type: "ReLU"
bottom: "ip1"
top: "ip1"
} ReLU层后紧跟一个InnerProduct层
layer {
name: "ip2"
type: "InnerProduct"
bottom: "ip1"
top: "ip2"
param {
lr_mult:
}
param {
lr_mult:
}
inner_product_param {
num_output: //因为有10类,所以输出10
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
} :Loss层//不产生任何输出,只是用来计算损失函数的值,用来初始化ip2的gradient
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "ip2"//需要两个blob,一个是ip2,作为预测用
bottom: "label"//来自数据层,作为标签
top: "loss"
}

caffe模型的一些解释~的更多相关文章

  1. 使用caffe模型测试图片(python接口)

    1.加载相关模块 1.1 加载numpy import numpy as np 1.2 加载caffe 有两种方法. 方法一(静态导入): 找到当前环境使用的python的site-packages目 ...

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

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

  3. TensorFlow模型转为caffe模型

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

  4. Caffe模型读取

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

  5. c++ 和 matlab 下的caffe模型输入差异

    在向一个caffe模型传递输入数据的时候,要注意以下两点: 1. opencv中Mat数据在内存中的存放方式是按行存储,matlab中图像在内存中的存放方式是按列存储. 2. opencv中Mat数据 ...

  6. caffe模型参数解释

    作者:wjmishuai 出处: http://blog.csdn.net/wjmishuai/article/details/50890214 原始数据是28*28 1:数据层: layer { n ...

  7. DL开源框架Caffe | 模型微调 (finetune)的场景、问题、技巧以及解决方案

    转自:http://blog.csdn.net/u010402786/article/details/70141261 前言 什么是模型的微调?   使用别人训练好的网络模型进行训练,前提是必须和别人 ...

  8. C++11内存模型的粗略解释

    基本解释 C++11引入了多线程,同时也引入了一套内存模型.从而提供了比较完善的一套多线程体系.在单线程时代,一切都很简单.没有共享数据,没有乱序执行,所有的指令的执行都是按照预定的时间线.但是也正是 ...

  9. TCP/IP模型的简单解释

    TCP/IP模型是互联网的基础.想要理解互联网,就必须理解这个模型.但是,它不好懂,我就从来没有搞懂过. 前几天,BetterExplained上有一篇文章,很通俗地解释了这个模型.我读后有一种恍然大 ...

随机推荐

  1. 【2019.11.27】SDN课程阅读作业(2)

    过去20年中可编程网络的发展可以分为几个阶段?每个阶段的贡献是什么? Making computer networks more programmable enables innovation in ...

  2. hdu4841 圆桌问题[STL vector]

    目录 题目地址 题干 代码和解释 参考 题目地址 hdu4841 题干 代码和解释 解本题时使用了刚学的STL vector,注意hdu不支持万能头文件#include<bits/stdc++. ...

  3. 在IDEA上对SpringBoot项目配置Devtools实现热部署

    spring为开发者提供了一个名为spring-boot-devtools的模块来使Spring Boot应用支持热部署,提高开发者的开发效率,无需手动重启Spring Boot应用. devtool ...

  4. SDN-based Network Management Solution

    SDN-based Network Management Solution 摘要: 在此项目中,我们开发了一种网络管理应用程序,以监视和控制由支持OpenFlow的交换机和支持SNMP的设备组成的企业 ...

  5. # 61条面向对象设计的经验原则-《OOD启思录》Arthur J.Riel

    61条面向对象设计的经验原则-<OOD启思录>Arthur J.Riel 原文 http://blog.csdn.net/cpluser/article/details/129291 61 ...

  6. UnicodeEncodeError: 'latin-1' codec can't encode characters,python3 中文乱码

    UnicodeEncodeError: 'latin-1' codec can't encode characters in position 9-13: ordinal not in range(2 ...

  7. RabbitMQ整合Spring Booot【消费者应答模式】

    生产者代码不变,消费者: package com.toov5.Consumer; import java.io.IOException; import java.util.concurrent.Tim ...

  8. 筛选出dataframe中全为数字的列的值

    In [1]: import pandas as pd In [2]: import numpy as np In [3]: students = [ ('jack', 'Apples' , 34) ...

  9. OpenShift 4.1 基本问题探索

    因为在OpenShift 4.1环境中不建议直接登录集群主机操作,因此很多操作可能需要在外部的Client VM上完成.当然用rhel的worker node的同事也可以和原来习惯保持一致. 这里记录 ...

  10. git bush 无法使用箭头进行选择

    1 找到git bash 的安装目录,找到bash.bashrc文件, 2 在文件的尾部加上:alias vue='winpty vue.cmd', 3 重启git bash 即可 来自:https: ...