forwarddiff does these

This commit is contained in:
Mike J Innes 2017-08-19 22:05:50 +01:00
parent ad0e0ea5a7
commit 18e69b33c9

View File

@ -1,10 +1,8 @@
# Activation Functions
σ(x) = 1 / (1 + exp(-x))
# back!(::typeof(σ), Δ, x) = Δ .* σ(x).*(1.-σ(x))
relu(x) = max(0, x)
# back!(::typeof(relu), Δ, x) = Δ .* (x .> 0)
softmax(xs) = exp.(xs) ./ sum(exp.(xs), 2)