swift-apis icon indicating copy to clipboard operation
swift-apis copied to clipboard

RNNCell output: `Output` and `State`?

Open tanmayb123 opened this issue 5 years ago • 3 comments

There's something that's really bugging me about the RNNCell protocol: that TimeStepOutput is separate from the State. RNN Cells, at least as far as I've seen them in other languages, will always only return the hidden state, and it's up to another Dense layer (or some counterpart) to make process the hidden state.

In that case, why keep them separate? Why not just say that RNN Cells just return a State?

(please do let me know if I'm overlooking something)

tanmayb123 avatar Apr 24 '19 00:04 tanmayb123

If we use State as Output, both the output and the next state will have to be included as part of State. However, it is not ideal to always pass the last hidden state and the last output as part of Input. @jekbradbury What do you think?

rxwei avatar Apr 24 '19 20:04 rxwei

The thing that I’m wondering is why do we need ‘Output’ in the first place? RNN Cells only return States, if I’m not mistaken?

tanmayb123 avatar Apr 25 '19 00:04 tanmayb123

I personally believe that the separation of semantics between State and Output is nice, but indeed not super necessary. It probably eventually comes down to how RNN cells are most frequently used and I think that in deep learning it's very often to have distinct notions of state and output and many people think of them that way. For this reason I would lean more towards keeping them separate.

eaplatanios avatar May 31 '19 06:05 eaplatanios