Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attention to the model #62

Open
ckcz123 opened this issue Nov 16, 2016 · 1 comment
Open

Add attention to the model #62

ckcz123 opened this issue Nov 16, 2016 · 1 comment

Comments

@ckcz123
Copy link

ckcz123 commented Nov 16, 2016

What if I'd like to use attention_decoder instead of 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').

What should attention_states be?

@john-parton
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants