Merge pull request #63 from JobJob/rnncell-args

Enables passing an activation function to RNN/RNNCell
This commit is contained in:
Mike J Innes 2017-09-12 13:10:43 +01:00 committed by GitHub
commit 6728295355

View File

@ -34,8 +34,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))