Flux.jl/src/activation.jl

12 lines
215 B
Julia
Raw Normal View History

2016-08-25 16:26:07 +00:00
export σ, relu, softmax
2016-08-23 13:28:54 +00:00
σ(x) = 1 ./ (1 .+ exp.(-x))
2016-08-24 14:41:30 +00:00
back!(::typeof(σ), Δ, x) = Δ .* σ(x)./(1.-σ(x))
2016-08-25 16:26:07 +00:00
relu(x) = max(0, x)
back(::typeof(relu), Δ, x) = Δ .* (x .< 0)
softmax(x) = error("not implemented")