Skip to content

Commit

Permalink
Remove stable sigmoid for non-dual numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion committed May 24, 2019
1 parent b99596a commit e46137d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/activation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Return `log(cosh(x))` which is computed in a numerically stable way.
logcosh(x::T) where T = x + softplus(-2x) - log(convert(T, 2))

# Provide an informative error message if activation functions are called with an array
for f in (, :σ_stable, :logσ, :relu, :leakyrelu, :elu, :gelu, :swish, :selu, :softsign, :(StatsFuns.softplus), :logcosh)
for f in (, :logσ, :relu, :leakyrelu, :elu, :gelu, :swish, :selu, :softsign, :(StatsFuns.softplus), :logcosh)
@eval $(f)(x::AbstractArray, args...) =
error("Use broadcasting (`", $(string(f)), ".(x)`) to apply activation functions to arrays.")
end

0 comments on commit e46137d

Please sign in to comment.