Tensorflow中的注意事项(tf.contrib.rnn.AttentionCellWrapper)

use*_*273 6 tensorflow attention-model

怎么tf.contrib.rnn.AttentionCellWrapper用?有人可以提供一段示例代码吗?具体来说,我只设法做了以下

    fwd_cell = tf.contrib.rnn.AttentionCellWrapper(tf.contrib.rnn.BasicLSTMCell(hidden_size),10,50,state_is_tuple=True)
    bwd_cell = tf.contrib.rnn.AttentionCellWrapper(tf.contrib.rnn.BasicLSTMCell(hidden_size),10,50,state_is_tuple=True)
Run Code Online (Sandbox Code Playgroud)

但是在Bahdanau等人.2015年,注意力集中在整个双向RNN上.我不知道如何在Tensorflow中编写代码.