| 9 | |
| 10 | template <typename Dtype> |
| 11 | void 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 | |
| 23 | template <typename Dtype> |
| 24 | void BNLLLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top, |
nothing calls this directly
no test coverage detected