Problem about time_step and input_size of LSTM in PyTorch

Hi, everyone!
In LSTM of PyTorch, if it is time series data, does time_step equal to input_size? For example, use the Nasdaq index of 1000 days as a training set, divide them into 10 batches, and predict the index of one day by the indexs of 30 days before it. Are the parameters just like below:
batch_size=100, time_step=30, input_size=30?
Thank you:)

input_sizes defines the expected features in the input x.
In your example you might pass different signals, e.g. the Nasdaq index, the weather, the moon phase etc. as features to your model. The sequence length is independent from the number of features.
If you just pass a single signal (Nasdaq index), you should define input_size=1.

1 Like

Thank you for your reply:)
So if I use Nasdaq index, the weather, and the moon phase as the input, the input_size should be 3?

Yes, exactly. Each new signal would create a new feature.

1 Like

Got it! Thank you very much!