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

lesson 2 decoder impl output to linear #19

Closed
iyersathya opened this issue May 3, 2019 · 2 comments
Closed

lesson 2 decoder impl output to linear #19

iyersathya opened this issue May 3, 2019 · 2 comments

Comments

@iyersathya
Copy link

//feed, embedding+context and hidden state to RNN.
output, hidden = self.rnn(emb_con, hidden)

Shouldn't the line below be concat (embedding + output + context) instead of (embedding + hidden + context) ? Calculated hidden vector by RNN at time step t will be fed to next rnn at t+1 anyway.

output = torch.cat((embedded.squeeze(0), hidden.squeeze(0), context.squeeze(0)),
dim = 1)

prediction = self.out(output)

@bentrevett
Copy link
Owner

It can be either output or hidden here. Both of these tensors are exactly the same. You can test this with: assert torch.all(torch.eq(output, hidden))

@iyersathya
Copy link
Author

@bentrevett Thank you.

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