Merge pull request #428 from tejank10/rnn-fixes
[WIP] Fixes for RNN tests
This commit is contained in:
commit
ab0763fd41
@ -46,10 +46,10 @@ const RNN_ALGO_PERSIST_DYNAMIC = 2
|
||||
# LSTM: [weight, bias] × [input, hidden] × [input, forget, newmem, output]
|
||||
|
||||
function params(w::CuVector, input, hidden, n = 1)
|
||||
slice(offset, shape) = reshape(w[offset.+(1:prod(shape))], shape)
|
||||
slice(offset, shape) = reshape(view(w, offset.+(1:prod(shape))), shape)
|
||||
wx = slice(0, (input, hidden*n))
|
||||
wh = slice(length(wx), (hidden, hidden*n))
|
||||
bias = w[length(wx)+length(wh) .+ (1:hidden*n)]
|
||||
bias = view(w, length(wx)+length(wh) .+ (1:hidden*n))
|
||||
(wx, wh), bias
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user