LSTM units in Pytorch

Hello, I am trying to implement this architecture (Figure 6 | COVID-19 Pandemic Forecasting Using CNN-LSTM: A Hybrid Approach) using torch.nn.LSTM but I am not sure what 200 units LSTM corresponds to in nn.LSTM parameters. I would guess it is num_layers but then how will hidden_size be determined?

Hey @chericha

Let me try to clarify these two LSTM parameters:

  1. num_layers is the parameter responsible for the number of LSTM cells stacked together, in other words how deep is recurrence of that RNN
  2. hidden_size is the number a hyperparameter that correspond to a length of hidden vector that is passed from cell to cell

Hope it helps

1 Like