The neural network is lagging behind

So, I was trying to train an LSTM to predict the values โ€‹โ€‹of a certain stock. The error was pretty low, so I decided to create a graph from a test suite. It looked like this:

Red: actual, black: my forecast, blue: input to get the forecast

So, I train the network with datsets, for example: in: x t-1, out: x t... But ignoring the fact that the black line is well below the red line, you will see that the network is actually simulating an entry in order to stay as close to the actual forecast as possible.

So, after doing some searches , I found out that this is a common "trap":

Is there anything I can do to fix this?

I am using Stock.js for data and Neataptic for training.


I created a JSFiddle with neural network and diagram training. View it here ( open the console before opening ). Feel free to tweak the settings to make sure something works for you ...

Current parameters:

iterations: 5000,
rate: 1e-3,
cost: methods.cost.MSE,
clear: true,
log: 1000

      

+3


source to share





All Articles