Rnn internal Hidden stade handling


#1

I willy like mxnet, but there is one thing that is unclear to me.
I don’t thing is clear from the documentasion, how a rnn stadet in handelt internaly.

If I have a input of the shape 1x500x5, I get one output, that includs 500 stats. This part is still clear to me.
The question ist if I input data in the shape of 5x500x5, I get 5 outputs.
The Question is now, are the 5 outputs conected, in a way that the second output hidden stadt, buid up on the last stadt from the first output, ore uses the second output a new hidden stade.

If the rnn uses for each output a new stadt, is ther a esy way to get for each input row, a output, with a continues hidden stadt?


#2

Hi @XMaster,

Could you please provide a simple code example or snippets to explain your issue, thanks!

As I currently understand though, given input of shape 5x500x5, you’re asking how the output and hidden are related across the 1st dimension and through time? Using terms defined like so;

output, hidden = rnn(input, hidden)

Usually the 1st dimension represents the batch dimension (you have 5 samples here), and samples are treated independently to one another throughout time. It is the case for both output and hidden. But for a given sample, the output and hidden state will depend on the hidden state values for the same sample from the previous time step.