title: How to visualize attention weights?
body: <p><a href="https://github.com/keras-team/keras/issues/4962" rel="noreferrer">Using this implementation</a>
  I have included attention to my RNN (which classify the input sequences into two classes) as follows.</p>
  
  <pre><code>visible = Input(shape=(250,))
  
  embed=Embedding(vocab_size,100)(visible)
  
  activations= keras.layers.GRU(250, return_sequences=True)(embed)
  
  attention = TimeDistributed(Dense(1, activation='tanh'))(activations) 
  attention = Flatten()(attention)
  attention = Activation('softmax')(attention)
  attention = RepeatVector(250)(attention)
  attention = Permute([2, 1])(attention) 
  
  sent_representation = keras.layers.multiply([activations, attention])
  sent_representation = Lambda(lambda xin: K.sum(xin, axis=1))(sent_representation)
  predictions=Dense(1, activation='sigmoid')(sent_representation)
  
  model = Model(inputs=visible, outputs=predictions)
  </code></pre>
  
  <p>I have trained the model and saved the weights into <code>weights.best.hdf5</code> file.</p>
  
  <p>I am dealing with binary classification problem and the input to my model is the one hot vectors (character based).</p>
  
  <p>How can I visualize the attention weights for certain specific test case in the current implementation?</p>