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

Dimension of subsequent layers in Hypernetwork #169

Open
Simply-Adi opened this issue Feb 27, 2023 · 3 comments
Open

Dimension of subsequent layers in Hypernetwork #169

Simply-Adi opened this issue Feb 27, 2023 · 3 comments
Labels
question Further information is requested

Comments

@Simply-Adi
Copy link

Hi, I was reading through your implementation of HyperLSTM and the associated paper. I got lost in the shaping of the layers after the first layer. Could you please explain why the input size is 2*main_lstm_hidden_size?

@Siimarras

This comment was marked as abuse.

@vpj
Copy link
Member

vpj commented Jun 30, 2023

Sorry for the very late reply. I'm not sure what you are referring to exactly, could you please point to a line or a section of code please?

@vpj vpj added the question Further information is requested label Jun 30, 2023
@Simply-Adi
Copy link
Author

Lines 221-223 in class HyperLSTM state:

self.cells = nn.ModuleList([HyperLSTMCell(input_size, hidden_size, hyper_size, n_z)] +
                                  [HyperLSTMCell(hidden_size, hidden_size, hyper_size, n_z) for _ in
                                   range(n_layers - 1)])

This chunk calls Line 120 in the initialisation function.

self.hyper = LSTMCell(hidden_size + input_size, hyper_size, layer_norm=True)

Thus, the first layer created by the code chunk is

LSTMCell(hidden_size + input_size, hyper_size, layer_norm=True)

Then the next layer is:

LSTMCell(hidden_size + hidden_size, hyper_size, layer_norm=True) <-----I am confused about the 2*hidden_size dimension here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants