Relative Content

Tag Archive for pythonpytorchlstmgradient-descent

Gradient Vanishing when training LSTM with pytorch

I was training a simple LSTM neural network with pytorch to predict stock price. And it is confusing to me that my network wouldn’t fit. The loss is exploding and the r2 is negative. As the training process goes, nothing is improved. There should be a fatal mistake in my code. But I tried many ways and I still cannot work out the solution.