Open youchangshi opened 5 years ago
你好,我有两个问咨询下, 我机器环境 UBUNTU16.04, GTX1080TI, CUDA9.0 1,我下载下来RCF没有改动如何东西,直接按照说明,从5stage-vgg.caffemodel基础上训练RCF-MS,但是在BSDS500上得F指标只是0.8?而不是0.811? 论文说 the weights of 1 *1 conv layer in stage 1-5 are initialized from zero-mean Gaussian distributions with standard deviation 0.01,但是在train_val.prototxt 里头配置 这些层为 layer { name: "conv2_2_down" type: "Convolution" bottom: "conv2_2" top: "conv2_2_down" param { lr_mult: 0.1 decay_mult: 1 } param { lr_mult: 0.2 decay_mult: 0 } convolution_param { num_output: 21 kernel_size: 1 } }, 这样配置应该默认初始化是0啊,是这个配置原因吗?
2 看了RCF论文的损失函数中需要一个阈值判定像素点为正负例,但是我找了相关代码没有发现这个阈值判定在哪里? 我找的相关区域代码如下 template void SigmoidCrossEntropyLossLayer::Forward_cpu( const vector<Blob>& bottom, const vector<Blob>& top) { ............................. ........................ int dim = count / num; for (int i = 0; i < num; ++i) { ................ for (int j = 0; j < dim; j ++) { if (target[idim+j] == 1) { count_pos ++; temp_loss_pos -= input_data[idim + j] (target[idim+j] - (input_data[idim + j] >= 0)) - log(1 + exp(input_data[idim + j] - 2 input_data[idim + j] (input_data[idim + j] >= 0))); } else if (target[idim+j] == 0) { count_neg ++; temp_loss_neg -= input_data[idim + j] (target[idim+j] - (input_data[idim + j] >= 0)) - log(1 + exp(input_data[idim + j] - 2 input_data[idim + j] (input_data[idim + j] >= 0))); } } ........................ } .......................... }
template void AutoCropLayer::Forward_cpu(const vector<Blob>& bottom, const vector<Blob>& top) { .................................................. for (int n = 0; n < top[0]->num(); ++n) { for (int c = 0; c < top[0]->channels(); ++c) { for (int h = 0; h < top[0]->height(); ++h) { caffe_copy(top[0]->width(), bottom_data + bottom[0]->offset(n, c, croph + h, cropw), top_data + top[0]->offset(n, c, h)); } } } }
template void DeconvolutionLayer::Forwardcpu(const vector<Blob>& bottom, const vector<Blob>& top) { .............................. for (int i = 0; i < bottom.size(); ++i) { .................................... for (int n = 0; n < this->num; ++n) { this->backward_cpu_gemm(bottom_data + n this->bottomdim, weight, top_data + n this->topdim); if (this->biasterm) { const Dtype bias = this->blobs_[1]->cpu_data(); this->forward_cpu_bias(top_data + n this->topdim, bias); } } } }
感谢您关注我们的工作。
你好,我有两个问咨询下, 我机器环境 UBUNTU16.04, GTX1080TI, CUDA9.0 1,我下载下来RCF没有改动如何东西,直接按照说明,从5stage-vgg.caffemodel基础上训练RCF-MS,但是在BSDS500上得F指标只是0.8?而不是0.811? 论文说 the weights of 1 *1 conv layer in stage 1-5 are initialized from zero-mean Gaussian distributions with standard deviation 0.01,但是在train_val.prototxt 里头配置 这些层为 layer { name: "conv2_2_down" type: "Convolution" bottom: "conv2_2" top: "conv2_2_down" param { lr_mult: 0.1 decay_mult: 1 } param { lr_mult: 0.2 decay_mult: 0 } convolution_param { num_output: 21 kernel_size: 1 } }, 这样配置应该默认初始化是0啊,是这个配置原因吗?
2 看了RCF论文的损失函数中需要一个阈值判定像素点为正负例,但是我找了相关代码没有发现这个阈值判定在哪里? 我找的相关区域代码如下 template
void SigmoidCrossEntropyLossLayer::Forward_cpu(
const vector<Blob>& bottom, const vector<Blob >& top) {
.............................
........................
int dim = count / num;
for (int i = 0; i < num; ++i) {
................
for (int j = 0; j < dim; j ++) {
if (target[idim+j] == 1) {
count_pos ++;
temp_loss_pos -= input_data[idim + j] (target[idim+j] - (input_data[idim + j] >= 0)) -
log(1 + exp(input_data[idim + j] - 2 input_data[idim + j] (input_data[idim + j] >= 0)));
}
else if (target[idim+j] == 0) {
count_neg ++;
temp_loss_neg -= input_data[idim + j] (target[idim+j] - (input_data[idim + j] >= 0)) -
log(1 + exp(input_data[idim + j] - 2 input_data[idim + j] (input_data[idim + j] >= 0)));
}
}
........................
}
..........................
}
template
void AutoCropLayer::Forward_cpu(const vector<Blob>& bottom,
const vector<Blob >& top) {
..................................................
for (int n = 0; n < top[0]->num(); ++n) {
for (int c = 0; c < top[0]->channels(); ++c) {
for (int h = 0; h < top[0]->height(); ++h) {
caffe_copy(top[0]->width(),
bottom_data + bottom[0]->offset(n, c, croph + h, cropw),
top_data + top[0]->offset(n, c, h));
}
}
}
}
template
void DeconvolutionLayer::Forwardcpu(const vector<Blob>& bottom,
const vector<Blob >& top) {
..............................
for (int i = 0; i < bottom.size(); ++i) {
....................................
for (int n = 0; n < this->num ; ++n) {
this->backward_cpu_gemm(bottom_data + n this->bottomdim, weight,
top_data + n this->topdim);
if (this->biasterm) {
const Dtype bias = this->blobs_[1]->cpu_data();
this->forward_cpu_bias(top_data + n this->topdim, bias);
}
}
}
}