title: How to get reproducible results in keras
body: <p>I get different results (test accuracy) every time I run the <code>imdb_lstm.py</code> example from Keras framework (<a href="https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py">https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py</a>)
  The code contains <code>np.random.seed(1337)</code> in the top, before any keras imports. It should prevent it from generating different numbers for every run. What am I missing?  </p>
  
  <p>UPDATE: How to repro:  </p>
  
  <ol>
  <li>Install Keras (<a href="http://keras.io/">http://keras.io/</a>)   </li>
  <li>Execute <a href="https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py">https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py</a>  a few times. It will train the model and output test accuracy.<br>
  Expected result: Test accuracy is the same on every run.<br>
  Actual result: Test accuracy is different on every run.</li>
  </ol>
  
  <p>UPDATE2: I'm running it on Windows 8.1 with MinGW/msys, module versions:<br>
  theano 0.7.0<br>
  numpy 1.8.1<br>
  scipy 0.14.0c1</p>
  
  <p>UPDATE3: I narrowed the problem down a bit. If I run the example with GPU (set theano flag device=gpu0) then I get different test accuracy every time, but if I run it on CPU then everything works as expected. My graphics card: NVIDIA GeForce GT 635)</p>