title: Neural network falling behind
body: <p>So I have been 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 out of the test set. It looked like this:</p>
  
  <p><img src="https://i.gyazo.com/e87b03db451bd54fc97e74ec3515dd70.png" alt="">
  <em>Red: actual, Black: my prediction, Blue: input to get prediction</em></p>
  
  <p>So i'm training the network with datsets like: in: <em>x<sub>t-1</sub>, out: x<sub>t</sub></em>. But when ignoring the fact that the black line is much lower than the red line, you'll see that the network is actually mimicking the input to stay as close to the actual prediction.</p>
  
  <p>So after <a href="https://github.com/fchollet/keras/issues/2856" rel="nofollow noreferrer">doing some googling</a>, I found out that this is a common 'trap:</p>
  
  <p>Is there anything I can do to fix this?</p>
  
  <p>I'm using <a href="https://github.com/wagenaartje/stocks.js" rel="nofollow noreferrer">Stock.js</a> for data and <a href="https://github.com/wagenaartje/neataptic" rel="nofollow noreferrer">Neataptic</a> for training.</p>
  
  <hr>
  
  <p>I have created a JSFiddle with the training of the neural network and the chart. <a href="https://jsfiddle.net/wagenaartje/p6e933pg/1/" rel="nofollow noreferrer">View it here</a> (<strong>open console before opening</strong>). Feel free to tweak around with the options to see if you get something working...</p>
  
  <p>Current options:</p>
  
  <pre><code>iterations: 5000,
  rate: 1e-3,
  cost: methods.cost.MSE,
  clear: true,
  log: 1000
  </code></pre>