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

A question about the size of the rnn input emb in function forward #52

Open
shaunchen284 opened this issue Oct 13, 2023 · 1 comment
Open

Comments

@shaunchen284
Copy link

shaunchen284 commented Oct 13, 2023

I think there might be a wrong in the model.py.

    def forward(self, input, hidden, return_hiddens=False, noise=False):
        emb = self.drop(self.encoder(input.contiguous().view(-1,self.enc_input_size))) # [(seq_len x batch_size) * feature_size]    
        emb = emb.view(-1, input.size(1), self.rnn_hid_size) # [ seq_len * batch_size * feature_size]

where emb is the input of self.rnn, so I think self.rnn_hid_size should be changed to self.rnn_input_size
Looking forward to your reply

@shaunchen284
Copy link
Author

shaunchen284 commented Oct 13, 2023

original:
emb = emb.view(-1, input.size(1), self.rnn_hid_size)
to:
emb = emb.view(-1, input.size(1), self.rnn_input_size)

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