-
Notifications
You must be signed in to change notification settings - Fork 158
Description
Hi,
In the LSTM code example, you use both lower an upper case n, I struggle to distinguish the difference between the two or if they are both referring to batch sizes?
I'm utilise this code to learn how to implement my own LSTM model. but I am getting an error
"RuntimeError: Expected hidden size (1, 4, 128), got [1, 28, 128]"
In this instance my batch size is 4, and number of layers is one, hense the 2nd array/tensor size is [num layers, image size, number of hidden layers].
The expected hidden size appears to be [num layers, batch size, num hidden layers]
I suspect I'll debug this soon, but I think that the following lines could be clearer in your code if N was defined in the comment.
pytorch-examples/rnn-lstm-gru/main.py
Line 88 in 500afab
| # origin shape: [N, 1, 28, 28] |
you and your amazing videos have been a huge help as I learn about NNs and Pytorch, thanks!!