backprop for sigma

This commit is contained in:
Mike J Innes 2016-08-24 15:41:30 +01:00
parent e17d1cbe7a
commit 9675dc765d
2 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,5 @@
export σ
σ(x) = 1 ./ (1 .+ exp.(-x))
back!(::typeof(σ), Δ, x) = Δ .* σ(x)./(1.-σ(x))

View File

@ -5,7 +5,7 @@ export Model, back!, update!, param
abstract Model
back!(m::Model, ) = error("Backprop not implemented for $(typeof(m))")
update!(m::Model, η) = m
update!(m, η) = m
# Model parameters