Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explain silence layer in caffe

Tags:

caffe

void SilenceLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,
      const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) {
  for (int i = 0; i < bottom.size(); ++i) {
    if (propagate_down[i]) {
      caffe_set(bottom[i]->count(), Dtype(0),
                bottom[i]->mutable_cpu_diff());
    }
  }
}

It just sets the diff to zero. What is the use of this layer?

like image 248
curio17 Avatar asked Aug 08 '26 06:08

curio17


1 Answers

The use of this layer is simply to avoid that the output of unused blobs is reported in the log. Being an output manager layer, it is obviously zero its gradient.

For instance, let us assume we are using AlexNet and we change the bottom of the 'fc7' layer to 'pool5' instead of 'fc6'. If we do not delete the 'fc6' blob declaration, this layer is not used anymore but its ouput will be printed in stderr: it is considered as an output of the whole architecture. If we want to keep 'fc6' for some reasons, but without showing its values, we can use the 'SilenceLayer'.

http://caffe.berkeleyvision.org/tutorial/layers/silence.html

See also caffe.help.

like image 167
Lemm Ras Avatar answered Aug 09 '26 20:08

Lemm Ras



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!