- 数据层:
- layer {
- name: "mnist"//名字mnist
- type: "Data"//类型data
- top: "data"//输出数据
- top: "label"//输出标签
- include {
- phase: TRAIN
- }
- transform_param {
- scale: 0.00390625//归一化 {0-255}->{0-1}
- }
- data_param {
- source: "examples/mnist/mnist_train_lmdb"
- batch_size: 64
- backend: LMDB
- }
- }
-
- 卷积层
- layer {
- name: "conv1"
- type: "Convolution"
- bottom: "data"//输入data blob
- top: "conv1"//输出conv1
- param {
- lr_mult: 1//权重学习率倍乘因子。乘以全局学习率
- }
- param {
- lr_mult: 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"
- }
- }
- }
- 池化层
- layer {
- name: "pool1"
- type: "Pooling"
- bottom: "conv1"
- top: "pool1"
- pooling_param {
- pool: MAX//使用MAX进行池化
- kernel_size: 2//卷积核大小是2*2
- stride: 2//步长是2
- }
- }
- 全连接层
- 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"
- }
- }
- }
- ReLU层
- layer {
- name: "relu1"
- type: "ReLU"
- bottom: "ip1"
- top: "ip1"
- }
- Loss层
- layer {
- name: "loss"
- type: "SoftmaxWithLoss"
- bottom: "ip2"
- bottom: "label"//来自数据层的标签
- top: "loss"
- }
caffe模型常用参数解释
最新推荐文章于 2022-07-11 14:10:22 发布