Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
xukai92 committed Apr 28, 2019
1 parent f6fe914 commit 4ce6d17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/neural/activations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ function unary_op(f)
end
return y
end
# TODO: see if I can implement gradient as well; ref:
# https://github.com/denizyuret/Knet.jl/blob/687dba214c3f3326272c7c2191e14e8fdbc35c6a/src/unary.jl#L62-L70
# Bcasted methods
($M).$J(x::Knet.Bcasted{<:Knet.KnetArray{T}}) where {T<:AbstractFloat} = broadcasted($J, x.value) |> Knet.Bcasted
Base.Broadcast.broadcasted(::typeof($J), x::Knet.Bcasted{<:Knet.KnetArray{T}}) where {T<:AbstractFloat} = broadcasted($J, x.value) |> Knet.Bcasted
Expand All @@ -32,7 +34,9 @@ function unary_op(f)
end
end

unary_op(:log1pexp, :logexpm1)
for f in [:log1pexp, :logexpm1]
unary_op(f)
end

const softplus = log1pexp
const invsoftplus = logexpm1

0 comments on commit 4ce6d17

Please sign in to comment.