Solved – How to fine tune the LSTM

deep learningforecastinglstmmachine learningtensorflow

The image below is a comparison between the actual data and the predicted data for a test data set. What I am unable to achieve is the way the the actual data fluctuates over a larger span. The LSTM model outputs a trajectory which only oscillates in a smaller span. Can anyone tell why this happens. Please ignore the label. The actual plot is of how the temperature in a room varies when a cooler is switched on/off. I am learning it as a sequence prediction problem where I use previous two time step inputs(which include the temperature and other factors like thermostat control actions etc) to learn the next output for the temperature.
Variation of temperature Actual vs Predicted from previous two time points

Best Answer

Just by looking at your graph, and as you also said, LSTM model is able to handle variations in mid ranges but is failing at capturing variations in edges. But in this scenario, I would have made my model more complex in the following way.

  1. With the same model, I would have tried to reduce dropout and restart learning from the latest checkpoint.
  2. Also try to reduce learning rate and then check if gradients are saturating or not.
  3. Added more layers to make network more complex. Here chances of over fitting are there.

All these things depend on your size of data, type of data, cost function, etc. You should add more details so that better idea can be given. If you are able to succeed in getting required predictions, then please share your approach.