deep learning - Initializing layers in Caffe Convolutional Neural Network -
i working on constitutional neural network using caffe. have prototxt file layer "hungarian". layer has 2 additional top layers box_confidences
, box_assignments
.
layer { name: "hungarian" type: "hungarianloss" bottom: "bbox_concat" bottom: "boxes" bottom: "box_flags" top: "hungarian" top: "box_confidences" top: "box_assignments" loss_weight: 0.03 hungarian_loss_param { match_ratio: 0.5 permute_matches: true } }
then box_confidences
used in layer box_loss
bottom
layer{ name: "box_loss" type: "softmaxwithloss" bottom: "score_concat" bottom: "box_confidences" top: "box_loss" }
my queries
(1)do need setup layers these box_confidences
, box_assignments
?
(2)if necessary, how setup layer in prototxt file? layer holding blob data , how these 2 layers used in hungarianlosslayer
class member function can seen as
void hungarianlosslayer<dtype>::forward_cpu(const vector<blob<dtype>*>& bottom, const vector<blob<dtype>*>& top){ ............... ............... ............... dtype* top_confidences = top[1]->mutable_cpu_data(); ............... ............... ............... (int = 0; < num_pred; ++i) { top_confidences[n * num_pred + i] = assignment[i] < num_gt_[n] ? dtype(1) : dtype(0); dtype* top_assignments = top[2]->mutable_cpu_data(); top_assignments[n * num_pred + i] = assignment[i] < num_gt_[n] ? assignment[i] : dtype(-1); } ............... ............... }
i put .....
other codes not messy.
so box_confidences
, box_assignments
data blobs , size num_pred
. without running code, hard me know value of num_pred
.
what best way setup these 2 layers in prototxt file?
box_confidences
, box_assignments
feature maps (or intermediate activations) output hungarianloss
layer. no manual setup memory necessary , can safely provide them bottom blobs subsequent layers (like softmaxwithloss
) in network
Comments
Post a Comment