转自: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. 每日Android一问等你来解答-什么是Activity的生命周期?

    关注我,每天都有优质技术文章推送,工作,学习累了的时候放松一下自己. 本篇文章同步微信公众号 欢迎大家关注我的微信公众号:「醉翁猫咪」 什么是Activity的生命周期? 生命周期: 对于生命周期我们 ...

  2. Ajax 的一些概念 解析

    什么是Ajax Ajax基本概念 Ajax(Asynchronous JavaScript and XML):翻译成中文就是异步的JavaScript和XML. 从功能上来看是一种在无需重新加载整个网 ...

  3. IntelliJ IDEA 2018.2,WebStorm 2018.2破解

    一.IntelliJ IDEA 2018.2.4破解: 可参考:https://www.cnblogs.com/iathanasy/p/9469280.html 二.WebStorm 2018.2.4 ...

  4. Eclipse创建Maven父子项目

    Eclipse创建Maven父子项目 - 木头若愚 - CSDN博客https://blog.csdn.net/jay_1989/article/details/53906995 创建maven项目是 ...

  5. [Math] From Prior to Posterior distribution

    贝叶斯统计推断 后验分布与充分性 无信息先验下的后验分布 共轭先验(conjugacy)下的后验分布 其中,正态分布的共轭先验推导过程,典型且重要. (1) 当方差已知时,均值(prior: 高斯分布 ...

  6. php连接mysql8报错如何解决

    php版本为5.6,连接mysql8.0时报错,但是连接其他mysql8前的版本是正常的 原因可能是mysql8默认的使用密码认证方式不一样,mysql8.0默认使用caching_sha2_pass ...

  7. linux修改系统时间和时区

    1.修改系统时间linux系统时钟有两个,一个是硬件时钟,即BIOS时间,就是我们进行CMOS设置时看到的时间,另一个是系统时钟,是linux系统Kernel时间.当Linux启动时,系统Kernel ...

  8. [LeetCode] 463. Island Perimeter 岛的周长

    You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represen ...

  9. [LeetCode] 680. Valid Palindrome II 验证回文字符串 II

    Given a non-empty string s, you may delete at most one character. Judge whether you can make it a pa ...

  10. SpringBoot系列教程之Redis集群环境配置

    之前介绍的几篇redis的博文都是基于单机的redis基础上进行演示说明的,然而在实际的生产环境中,使用redis集群的可能性应该是大于单机版的redis的,那么集群的redis如何操作呢?它的配置和 ...