jax
d0d324d2 - Use expm1 in elu

Commit
6 years ago
Use expm1 in elu expm1(x) is more accurate than exp(x) - 1 when x is nearly, but not exactly, zero. In the case of elu, we would compute exp(x) - 1 when x is <= 0. If x is negative and has a very small magnitude, computing exp(x) - 1 would round to zero. For example, if x was -1.0E-8 then: exp(x) - 1 is 0 but expm1(x) is -1.0E-8
Author
Committer
Parents
Loading