Open ckcz123 opened 7 years ago
What if I'd like to use attention_decoder instead of rnn_decoder?
attention_decoder
rnn_decoder
I wonder how to modify outputs, last_state = seq2seq.rnn_decoder(inputs, self.initial_state, cell, loop_function=loop if infer else None, scope='rnnlm').
outputs, last_state = seq2seq.rnn_decoder(inputs, self.initial_state, cell, loop_function=loop if infer else None, scope='rnnlm')
What should attention_states be?
attention_states
I believe you can add
self.cell = cell = rnn.AttentionCellWrapper(cell, attn_length, state_is_tuple=True)
after
self.cell = cell = rnn.MultiRNNCell(cells, state_is_tuple=True)
What if I'd like to use
attention_decoder
instead ofrnn_decoder
?I wonder how to modify
outputs, last_state = seq2seq.rnn_decoder(inputs, self.initial_state, cell, loop_function=loop if infer else None, scope='rnnlm')
.What should
attention_states
be?