I trained a lstm to forecast 3 different sin(x) with the frequencies of 0.5hz , 1hz and 2 hz.
During training and prediction: The lstm takes 25 time steps and outputs the next 50.
So the first layer has 25 inputs. The middle layer (hidden) has a LSTM cell with 150 units. The last layer has 50 outputs.
After the training the lstm can predict the 3 sin waves (0.5hz, 1hz, 2hz) pretty good. But it produces complete useless data when I want to forecast a sin with a frequency of 0.75hz or 4hz.
Because I'm a complete beginner with that I don't know if that is, because the LSTM may be overfitted or because the LSTM is not able to generalize the behaviour of this periodic function?
Maybe you can give me some tipps or a direction for further research :-)
Is it even possible to have a LSTM which can predict all kind (frequencies) of sins while just learning some specific frequencies?
My Code is based on the rnn.py from the sunsided/tensorflow-lstm-sin repo
The model is very similar to his third experiment