We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 93e4fee + c57d52d commit a6b0feeCopy full SHA for a6b0fee
src/activation.jl
@@ -23,19 +23,15 @@ end
23
24
Return `log(σ(x))` which is computed in a numerically stable way.
25
26
- julia> logσ(0.)
+ julia> logσ(0)
27
-0.6931471805599453
28
- julia> logσ.([-100, -10, 100.])
+ julia> logσ.([-100, -10, 100])
29
3-element Array{Float64,1}:
30
- -100.0
31
- -10.0
32
- -0.0
33
-"""
34
-function logσ(x)
35
- max_v = max(zero(x), -x)
36
- z = exp(-max_v) + exp(-x-max_v)
37
- return -(max_v + log(z))
38
-end
+ -100.0
+ -10.000045398899218
+ -3.720075976020836e-44
+"""
+logσ(x) = -softplus(-x)
39
const logsigmoid = logσ
40
41
0 commit comments