title: How does dropout work in keras' LSTM layer?
body: <p>In keras' <a href="https://keras.io/layers/recurrent/" rel="nofollow noreferrer">documentation</a> there is no information regarding how dropout is actually implemented for LSTM layers. </p>
  
  <p>However, there is a link to the paper "<a href="https://arxiv.org/abs/1512.05287" rel="nofollow noreferrer">A Theoretically Grounded Application of Dropout in Recurrent Neural Networks</a>", which led me to believe that dropout is implemented as described in said paper. </p>
  
  <p>That is, for each time-step in the time-series the layer is processing, the same dropout mask is used.</p>
  
  <p>Looking at the <a href="https://github.com/keras-team/keras/blob/master/keras/layers/recurrent.py" rel="nofollow noreferrer">source code</a>, it seems to me that <a href="https://github.com/keras-team/keras/blob/master/keras/layers/recurrent.py#L1847" rel="nofollow noreferrer">LSTMCell.call</a> gets called iteratively, once for every time-step in the time-series, and generates a new dropout mask each time it is called.</p>
  
  <p>My question is: </p>
  
  <p>Either I misinterpreted keras' code, or the reference to the paper in keras' documentation is misleading. Which is it?</p>