MachineLP的Github(欢迎follow):https://github.com/MachineLP
下面是单层rnn+attention的代码,若考虑多层rnn请参考博主的:tf.contrib.rnn.static_rnn与tf.nn.dynamic_rnn区别
def attention(inputs, attention_size, time_major=False):
if isinstance(inputs, tuple):
MachineLP的Github(欢迎follow):https://github.com/MachineLP
下面是单层rnn+attention的代码,若考虑多层rnn请参考博主的:tf.contrib.rnn.static_rnn与tf.nn.dynamic_rnn区别
def attention(inputs, attention_size, time_major=False):
if isinstance(inputs, tuple):