sigmoid fix (cu) #3410

Merged
merged 1 commit into from Apr 14, 2017
Jump to file or symbol
Failed to load files and symbols.
+1 −1
Split
@@ -8,7 +8,7 @@ namespace caffe {
template <typename Dtype>
__global__ void SigmoidForward(const int n, const Dtype* in, Dtype* out) {
CUDA_KERNEL_LOOP(index, n) {
- out[index] = 1. / (1. + exp(-in[index]));
+ out[index] = 0.5 * tanh(0.5 * in[index]) + 0.5;
}
}