diff --git a/src/layers/stateless.jl b/src/layers/stateless.jl index b8ce3c7da7..5f9c10904b 100644 --- a/src/layers/stateless.jl +++ b/src/layers/stateless.jl @@ -1,3 +1,4 @@ +using CuArrays using NNlib: logsoftmax, logσ # Cost functions @@ -35,6 +36,9 @@ Return `-y*log(ŷ + ϵ) - (1-y)*log(1-ŷ + ϵ)`. The ϵ term provides numerica """ binarycrossentropy(ŷ, y; ϵ=eps(ŷ)) = -y*log(ŷ + ϵ) - (1 - y)*log(1 - ŷ + ϵ) +# Re-definition to fix interaction with CuArrays. +CuArrays.@cufunc binarycrossentropy(ŷ, y; ϵ=eps(ŷ)) = -y*log(ŷ + ϵ) - (1 - y)*log(1 - ŷ + ϵ) + """ logitbinarycrossentropy(logŷ, y)