Hi Chris,
Thank you for your time and suggestions.
I followed your advice, regarding detach() and four lines with lstm_out in forward().
I got some improvements in speed. I can finally proceed at least some small number of epochs until the end. However, proceeding time is increasing during training, and I would say there is much space for improvement, which I should implement.
For example, the processing time for the first few epochs is about: 30s, 90s, 250s, 370s, 490s. Then, it has more or less stable processing time around 400s until the end of the training. I have noticed better results when increasing batch_size, and these results are with batch_size = 1024.
Thank you for sharing your example. I have analyzed it and could not find what might be included in this example.
I wonder what else I can do to have a better proceeding time.