| 7 | |
| 8 | template <typename Dtype> |
| 9 | void 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 | |
| 21 | template <typename Dtype> |
| 22 | void ELULayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top, |
nothing calls this directly
no test coverage detected