I wanted to know if there's a way to select an optimum number of epochs and neurons to forecast a certain time series using LSTM, the motive being automation of the forecasting problem, i.e. the algorithm selects the right number of epochs and neurons on its own by checking the data.
The optimum parametrization depends on the problem (there is not a rule that can do what you want), but there are some techniques that can help you, see the link below. http://machinelearningmastery.com/tune-lstm-hyperparameters-keras-time-series-forecasting/
Basically what the upper link does is:
- First calculate the RMSE of train and test data for each epoch with different number of maximum epochs. This prevents you to overfit and gives an aproximated range of epochs to start with.
- Afterwards you can repeat the method but maintaining the epochs constant (previously selected) and testing with different neuron number.
It's important that the RMSE test curve must not be convex as it denotes overfitting. Whith this method you can tune this paramaters obtaining a good trade off between accuracy and generalization.