I am trying to do a uni-variate forecasting and I have come across this question quite a lot. This question is regarding TensorFlow's "dtf.nn.dynamic_rnn()".

NOTE: When I say internal state I am talking about the c and h of the " tf.contrib.rnn.LSTMCell" in TensorFlow.

Question: If we don't give the internal state manually and reset it as we prefer, what is the normal behavior of the hidden states, does the hidden state reset automatically after each batch or after each input in a batch?


batch_size = 10
time_steps = 2

if input is something like this:

[ [[12],[13]],[[32],[33]], ...]

does the internal state reset after the batch:

[ [[12],[13]], [[32],[33]], ... ]

or after each input: [[12],[13]] ???


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.