spdin / time-series-prediction-lstm-pytorch

Time Series Prediction with LSTM Using PyTorch
209 stars 37 forks source link

forward always make hidden state zeros #1

Open trobitack opened 5 years ago

trobitack commented 5 years ago

I think there is something missing. İf I understand correctly implementation of forward is wrong. At code of forward of LSTM model, we see h_0=torch.zeros(...) and c_0 = torch.zeros(...) which means you set state everytime same, not get any information of sequence state. İs there anything ı am missing?

ivokun commented 4 years ago

From pytorch documentation of LSTM here, it's initial hidden and cell state. So, next state (t) will ignore these h_0 and c_0 inputs.