Skip to content

Commit

Permalink
sigmoid alias
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeInnes committed Nov 23, 2017
1 parent 18ef20a commit 38ba025
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/NNlib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module NNlib

using Requires

export σ, relu, leakyrelu, elu, swish, selu, softplus, softsign,
export σ, sigmoid, relu, leakyrelu, elu, swish, selu, softplus, softsign,
softmax, conv2d, pool

const libnnlib = Libdl.find_library(is_windows() ? "conv.dll" : "conv.so", [@__DIR__])
Expand Down
2 changes: 2 additions & 0 deletions src/activation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ function.
"""
σ(x) = one(x) / (one(x) + exp(-x))

const sigmoid = σ

# ForwardDiff numerical stability hack
σ_stable(x) = ifelse(x < -80, zero(x), one(x) / (one(x) + exp(-x)))

Expand Down

0 comments on commit 38ba025

Please sign in to comment.