Dtype loss = net_->ForwardBackward(bottom_vec);
if (display) {
LOG(INFO) << "Iteration " << iter_ << ", loss = " << loss;
+ const vector<Blob<Dtype>*>& result = net_->output_blobs();
+ vector<Dtype> score;
+ for (int j = 0; j < result.size(); ++j) {
+ const Dtype* result_vec = result[j]->cpu_data();
+ for (int k = 0; k < result[j]->count(); ++k) {
+ score.push_back(result_vec[k]);
+ }
+ }
+ for (int i = 0; i < score.size(); ++i) {
+ LOG(INFO) << " Training score #" << i << ": " << score[i];
+ }
}
ComputeUpdateValue();
LOG(INFO) << "Test loss: " << loss;
}
for (int i = 0; i < test_score.size(); ++i) {
- LOG(INFO) << "Test score #" << i << ": "
+ LOG(INFO) << " Test score #" << i << ": "
<< test_score[i] / param_.test_iter(test_net_id);
}
Caffe::set_phase(Caffe::TRAIN);