提交 fe5e6be0 编写于 作者: 刘琦

Merge branch 'fix-tanh-bug' into 'master'

fix tanh nan bug

See merge request !568
......@@ -86,8 +86,7 @@ void DoActivation(const T *input_ptr,
case TANH:
#pragma omp parallel for
for (index_t i = 0; i < size; ++i) {
T in_exp = std::exp(-2 * input_ptr[i]);
output_ptr[i] = (1 - in_exp) / (1 + in_exp);
output_ptr[i] = std::tanh(input_ptr[i]);
}
break;
case SIGMOID:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册