Dear Alice,
I’m a bit dense, and don’t understand the sizes in terms of patient, time, and features.
When you have X_batch = X_train[start:end], you have X_batch of shape 1 x 129 x 39 with 1 the sequence length. Do you intend to use 129 as the sequence length? Then you would need to instantiate the LSTM with batch_first=True as a parameter.
But then the outputs would have 1 x 129 x 2 (I think) and you would need to take the average or so over time. I’m not sure I understand what the shape of Y_batch is without the batch size.
Best regards
Thomas
Edit: Maybe it you could print the tensor shapes going in and out of the net and into the criterion to see.