【caffe c++】網絡配置文件說明之全連接層、softmax層

下面代碼中沒註釋的部分看這篇:

【caffe c++】網絡配置文件說明之卷積層、池化層

#全連接層,輸出的是一個簡單向量  參數跟卷積層一樣
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++】網絡配置文件說明之激活函數

【caffe c++】網絡配置文件說明之reshape層

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章