Nougat Xu
Nougat Xu

Reputation: 9

What is the hidden state in prediction using RNN/LSTM?

Supposed that I have a time sequence from t = 0 to t = T, I want to use RNN/LSTM to train a model for future prediction purpose.

After training, when I make prediction at t = T+1, should I use the hidden state (and cell state if LSTM) at t = T to predict the output at t = T+1?

Supposed that I want to predict from t = T+1 to t = T+10, should I use the predicted y(T+1) as the input for next time step t = T+2? And use the predicted y(T+2) as the input for next time step t = T+3 so on and so forth?

Upvotes: 0

Views: 850

Answers (1)

Bitzel
Bitzel

Reputation: 61

Yes you should, generally the Hidden state is a vector or matrix that operates through all the sequence (time T). That is the main purpose of RNN, to compute its states by taking in count previous steps. You will feed your network for time T with your Hidden state (or LSTM cell) from previous steps (T-1) and your input as y(t-1).

Upvotes: 2

Related Questions