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

Error when using dropout in GRU #415

Open
Trojahn opened this issue May 24, 2017 · 1 comment
Open

Error when using dropout in GRU #415

Trojahn opened this issue May 24, 2017 · 1 comment

Comments

@Trojahn
Copy link

Trojahn commented May 24, 2017

The following toy example works:

require 'rnn'

model = nn.Sequential()
model:add(nn.GRU(10, 5, 20))
model:add(nn.GRU(5, 1, 20))
model:add(nn.Sigmoid())
model = nn.Sequencer(model)

t = torch.Tensor(20,10)
model:forward(t)
print(model.output)

But using the available dropout parameter don't:

require 'rnn'

model = nn.Sequential()
model:add(nn.GRU(10, 5, 20, 0.25))
model:add(nn.GRU(5, 1, 20))
model:add(nn.Sigmoid())
model = nn.Sequencer(model)

t = torch.Tensor(20,10)
model:forward(t)
print(model.output)

The error itself...
In 1 module of nn.Sequential:
In 1 module of nn.Sequential:
In 2 module of nn.ConcatTable:
In 1 module of nn.Sequential:
In 1 module of nn.ParallelTable:
In 3 module of nn.Sequential:
bad argument #2 to '?' (out of bounds at /tmp/luarocks_torch-scm-1-9229/torch7/lib/TH/generic/THStorage.c:202)
...

@tastyminerals
Copy link
Contributor

Check your input to the model, it is probably one dimensional but should be two dimensional.

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