Skip to content

fix self.init_hidden never used #95

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

Merged
merged 2 commits into from
Jun 5, 2017
Merged

Conversation

cmusjtuliuyuan
Copy link
Contributor

No description provided.

@@ -180,8 +180,8 @@ def __init__(self, vocab_size, tag_to_ix, embedding_dim, hidden_dim):
self.hidden = self.init_hidden()

def init_hidden(self):
return (autograd.Variable(torch.randn(2, 1, self.hidden_dim)),
autograd.Variable(torch.randn(2, 1, self.hidden_dim)))
return (autograd.Variable(torch.randn(2, 1, self.hidden_dim / 2)),

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -217,7 +217,7 @@ def _forward_alg(self, feats):
def _get_lstm_features(self, sentence):
self.hidden = self.init_hidden()
embeds = self.word_embeds(sentence).view(len(sentence), 1, -1)
lstm_out, self.hidden = self.lstm(embeds)
lstm_out, self.hidden = self.lstm(embeds, self.hidden)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@chsasank chsasank merged commit 13936ab into pytorch:master Jun 5, 2017
@chsasank
Copy link
Contributor

chsasank commented Jun 5, 2017

Thanks @cmusjtuliuyuan!

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

Successfully merging this pull request may close these issues.

3 participants