Thanks a lot @vdw foR your detailed answer. It makes it much clearer now. I will implement the changes that you suggested.
Yes, it is for padding. I have a large data sample with some quite long sequences. I’ve used 200 sequences from that larger data to try to make sure that everything works well, before I start training the model on the actual data. And, the actual data does contain long sequences and that’s the reason behind padding and normalizing input data points, and converting them to 512.
I did not know that vanilla LSTMs would have hard time with sequences of larger length. I will try exploring other models like BERT etc.
Again, thank you for your comments, appreciate it. Would be glad to know if you have any more suggestions.