update for rnn wrappers

This commit is contained in:
Mike J Innes 2017-04-27 17:27:08 +01:00
parent f5f5e77239
commit 121af0579a

View File

@ -146,6 +146,8 @@ function back!(m::Stateful, Δ, x)
back!(m.model, ((zeros.(m.ostate)...,), Δ), (m.istate...,), x)[2:end]
end
update!(m::Stateful, η) = update!(m.model, η)
stateless(m) = m
stateless(m::Stateful) = m.model
@ -166,3 +168,5 @@ function (m::SeqModel)(x)
end
back!(m::SeqModel, Δ, x) = (runseq((Δ, x) -> back!(m.model, Δ, x)[1], Δ, x),)
update!(m::SeqModel, η) = update!(m.model, η)