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

Method Forward_cpu

src/caffe/layers/elu_layer.cpp:9–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8template <typename Dtype>
9void ELULayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
10 const vector<Blob<Dtype>*>& top) {
11 const Dtype* bottom_data = bottom[0]->cpu_data();
12 Dtype* top_data = top[0]->mutable_cpu_data();
13 const int count = bottom[0]->count();
14 Dtype alpha = this->layer_param_.elu_param().alpha();
15 for (int i = 0; i < count; ++i) {
16 top_data[i] = std::max(bottom_data[i], Dtype(0))
17 + alpha * (exp(std::min(bottom_data[i], Dtype(0))) - Dtype(1));
18 }
19}
20
21template <typename Dtype>
22void ELULayer<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