title: How visualize attention LSTM using keras-self-attention package?
body: <p>I'm using <a href="https://github.com/CyberZHG/keras-self-attention" rel="noreferrer">(keras-self-attention)</a> to implement attention LSTM in KERAS. How can I visualize the attention part after training the model? This is a time series forecasting case.</p>
  
  <pre class="lang-py prettyprint-override"><code>from keras.models import Sequential
  from keras_self_attention import SeqWeightedAttention
  from keras.layers import LSTM, Dense, Flatten
  
  model = Sequential()
  model.add(LSTM(activation = 'tanh' ,units = 200, return_sequences = True, 
                 input_shape = (TrainD[0].shape[1], TrainD[0].shape[2])))
  model.add(SeqSelfAttention())
  model.add(Flatten())    
  model.add(Dense(1, activation = 'relu'))
  
  model.compile(optimizer = 'adam', loss = 'mse')
  </code></pre>