It\'s pretty crazy that there isn\'t a dead simple example of the LSTM RNN predicting time series data.
https://github.com/cazala/synaptic
https://g
This answer is not written with Synaptic, but with Neataptic. I decided to make a quick answer that I will include in the documentation soon. This is the code, it works 9/10 times:
var network = new neataptic.architect.LSTM(1,6,1);
// when the timeseries is [0,0,0,1,0,0,0,1...]
var trainingData = [
{ input: [0], output: [0] },
{ input: [0], output: [0] },
{ input: [0], output: [1] },
{ input: [1], output: [0] },
{ input: [0], output: [0] },
{ input: [0], output: [0] },
{ input: [0], output: [1] },
];
network.train(trainingData, {
log: 500,
iterations: 6000,
error: 0.03,
clear: true,
rate: 0.05,
});
Run it on JSFIDDLE to see the prediction! For more predictions, open this one.
Explanation to some choices I made:
~0.2