Flux.jl/src/layers/recurrent.jl

14 lines
361 B
Julia
Raw Normal View History

2016-10-28 23:13:32 +00:00
@net type Recurrent
Wxh; Whh; Why
bh; by
hidden
function (x)
hidden = σ( x * Wxh + hidden * Whh + bh )
y = hidden * Why + by
end
end
Recurrent(in::Integer, hidden::Integer, out::Integer; init = initn) =
Recurrent(init((in, hidden)), init((hidden, hidden)), init((hidden, out)),
init(hidden), init(out), zeros(Float32, hidden))