提交 d0524fe5 authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #5834 from f0k/elu-expm1

Use expm1 for elu
...@@ -2420,7 +2420,7 @@ def elu(x, alpha=1): ...@@ -2420,7 +2420,7 @@ def elu(x, alpha=1):
"Fast and Accurate Deep Network Learning by "Fast and Accurate Deep Network Learning by
Exponential Linear Units (ELUs)" <http://arxiv.org/abs/1511.07289>`. Exponential Linear Units (ELUs)" <http://arxiv.org/abs/1511.07289>`.
""" """
return tensor.switch(x > 0, x, alpha * (tensor.exp(x) - 1)) return tensor.switch(x > 0, x, alpha * tensor.expm1(x))
class ScalarSoftsign(theano.scalar.UnaryScalarOp): class ScalarSoftsign(theano.scalar.UnaryScalarOp):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论