下面代碼中沒註釋的部分看這篇:
#全連接層,輸出的是一個簡單向量 參數跟卷積層一樣
layer {
name:"ip1"
type:"InnerProduct"
bottom:"pool2"
top:"ip1"
param{ #學習率
lr_mult:1
}
param {
lr_mult:2
}
inner_product_param {
num_output:500 #輸出向量的大小
weight_filler{
type:"xavier"
}
bias_filler{
type:"constant"
}
}
}
###測試的時候輸入準確率
layer{
name:"accuracy"
type:"Accuracy"
bottom:"ip2"
bottom:"label"
top:"accuracy"
include{
phase:TEST
}
}
#softmax-loss layer:輸出loss值
layer{
name:"loss"
type:"SoftmaxWithLoss"
bottom:"ip1"
bottom:"label"
top:"loss"
}
#softmax layer:輸出似然值(準確率)
layer{
bottom:"cls3_fc"
top:"prob"
name:"prob"
type:"Softmax"
}
其他網絡配置文件:
【caffe c++】網絡配置文件說明之激活函數