caffe学习系列(6):其他层介绍

时间:2021-02-16 07:08:39

主要包括softmax-loss层(与softmax有区别),全连接层(Inner Prouduct),accuracy层,reshape层,

Dropout层。

softmax:

layers {
bottom: "cls3_fc"
top: "prob"//概率似然值
name: "prob"
type: “Softmax"
}

accuracy

layer {
name: "accuracy"
type: "Accuracy"
bottom: "ip2"
bottom: "label"
top: "accuracy"
include {
phase: TEST //test阶段才有
}
}

reshape

 layer { //改变输入的维度
name: "reshape"
type: "Reshape"
bottom: "input"
top: "output"
reshape_param {
shape {//指定blob数据各维的值n*c*w*h
dim: # copy the dimension from below维度不变
dim: 2 #将原来的维度变成2
dim:
dim: - # infer it from the other dimensions根据其他三维来计算当前维度
}
}
}

Dropout层

layer {
name: "drop7"
type: "Dropout"
bottom: "fc7-conv"
top: "fc7-conv"
dropout_param {
dropout_ratio: 0.5
}
}

参考:http://www.cnblogs.com/denny402/p/5072746.html