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

why split gates along dimension 2? #17

Open
yuhonglin opened this issue Jan 5, 2016 · 2 comments
Open

why split gates along dimension 2? #17

yuhonglin opened this issue Jan 5, 2016 · 2 comments

Comments

@yuhonglin
Copy link

Hi, I can not understand why in the following code, the reshaped_gates is split along dimension 2 rather than 1, since output of reshaped_gates is a 4 x rnn_size matrix.

  -- Reshape to (batch_size, n_gates, hid_size)
  -- Then slize the n_gates dimension, i.e dimension 2
  local reshaped_gates =  nn.Reshape(4,params.rnn_size)(gates)
  local sliced_gates = nn.SplitTable(2)(reshaped_gates)

Could anybody explain it? Thx in advance!

@junwei-pan
Copy link

Same question, I will do some experiment to check if this is a bug..

@hohoCode
Copy link

The batch size is the No.1 dim; the 4 gates stuff is the No.2 dim. Plus nn.Reshape() supports batch processing. Therefore this is correct.

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

3 participants