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

Is init hidden state necessary? #2

Open
littleflow3r opened this issue Feb 28, 2019 · 0 comments
Open

Is init hidden state necessary? #2

littleflow3r opened this issue Feb 28, 2019 · 0 comments

Comments

@littleflow3r
Copy link

Hi,

In your hierarchical_att_model.py, you initialized the hidden state for the GRU, with zeros.
self.word_hidden_state = torch.zeros(2, batch_size, self.word_hidden_size)
self.sent_hidden_state = torch.zeros(2, batch_size, self.sent_hidden_size)

According to the torch documentation of GRU, the h_0 will default to zero if not provided.
Do you have any reason to do this manually?

Thanks.

@littleflow3r littleflow3r changed the title init hidden state is necessary? Is init hidden state necessary? Feb 28, 2019
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

1 participant