Enables passing an activation function to RNN/RNNCell

Also, fixes it not using the `init` function provided
This commit is contained in:
Joel Mason 2017-09-12 20:54:56 +10:00
parent 519f4c3c32
commit 00439555d1

View File

@ -59,8 +59,8 @@ struct RNNCell{D,V}
h::V
end
RNNCell(in::Integer, out::Integer; init = initn) =
RNNCell(Dense(in+out, out, init = initn), param(initn(out)))
RNNCell(in::Integer, out::Integer, σ=identity; init = initn) =
RNNCell(Dense(in+out, out, σ, init = init), param(init(out)))
function (m::RNNCell)(h, x)
h = m.d(combine(x, h))