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

hidden state not updated #1

Open
chrisliu54 opened this issue Apr 27, 2018 · 2 comments
Open

hidden state not updated #1

chrisliu54 opened this issue Apr 27, 2018 · 2 comments

Comments

@chrisliu54
Copy link

The hidden state of GridLSTM is not updated:

for dim in range(self.dimensions):
c = C[dim]
if dim in self.lstm_dim_map:
# LSTM update
cell = self.lstms[self.lstm_dim_map[dim]]
h, c = cell.forward(inp, (H, c))
else:
# Non-LSTM update
layer = self.nonlstms[self.nonlstm_dim_map[dim]]
h = layer.forward(H)
local_state[dim] = (h, c)

BTW, pytorch will check the consistency of the input hidden tensor's size and the self.hidden_size:

https://github.com/pytorch/pytorch/blob/6ebcb4606f079b9152cb242b36e03b8eddcb6173/torch/nn/modules/rnn.py#L504-L513

But GridLSTM's input H is concatenated from all the h which is larger than your setting:
image
image

self.hidden_size = output_hidden_channels

@kkleidal
Copy link
Owner

Hmm, I'll have to take a look. Tbh, I was planning on using this repo for some of research, but it never really panned out, so it is not tested and could have more bugs like this. I'll post a disclaimer for now on the README so people don't end up trying to use it out of the box and run into problems like this.

@chrisliu54
Copy link
Author

Sure, happy coding : )

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