MCPcopy Create free account
hub / github.com/BVLC/caffe / Forward_cpu

Method Forward_cpu

src/caffe/layers/bnll_layer.cpp:11–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10template <typename Dtype>
11void BNLLLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
12 const vector<Blob<Dtype>*>& top) {
13 const Dtype* bottom_data = bottom[0]->cpu_data();
14 Dtype* top_data = top[0]->mutable_cpu_data();
15 const int count = bottom[0]->count();
16 for (int i = 0; i < count; ++i) {
17 top_data[i] = bottom_data[i] > 0 ?
18 bottom_data[i] + log(1. + exp(-bottom_data[i])) :
19 log(1. + exp(bottom_data[i]));
20 }
21}
22
23template <typename Dtype>
24void BNLLLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,

Callers

nothing calls this directly

Calls 3

countMethod · 0.80
cpu_dataMethod · 0.45
mutable_cpu_dataMethod · 0.45

Tested by

no test coverage detected