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

Variable batch size error #22

Closed
terryrabinowitz opened this issue Jun 13, 2016 · 2 comments
Closed

Variable batch size error #22

terryrabinowitz opened this issue Jun 13, 2016 · 2 comments

Comments

@terryrabinowitz
Copy link

Hello.
If I set the batch size to 'None' in the input layer of the model to allow different size batches, then I get the error: "ValueError: elements of reps must be scalars of integer dtype". This error goes away when I directly connect this input layer to an output layer but appears when I try and connect the input layer to the ntm layer.

Thank you for the help and the implementation!
Terry

@tristandeleu
Copy link
Collaborator

tristandeleu commented Jun 13, 2016

Hello Terry,
Indeed, as the initializations of the memory and hidden states (for the recurrent controller) heavily rely on the size of the batches, I simply assumed they were given beforehand. Thank you for pointing that out!
This should be fixed in #23
Like the other recurrent layers from Lasagne (eg. LSTMLayer), you can access the Theano variable corresponding to the size of the batches so that you can use ReshapeLayer

l_input = InputLayer((None, None, size), input_var=input_var)
batch_size, seqlen, _ = l_input.input_var.shape

@terryrabinowitz
Copy link
Author

Fantastic! Thank you so much for the quick action!!

On Mon, Jun 13, 2016 at 12:08 PM, Tristan Deleu notifications@github.com
wrote:

Hello Terry,
Indeed, as the initializations of the memory and hidden states (for the
recurrent controller) heavily rely on the size of the batches, I simply
assumed they were given beforehand. Thank you for pointing that out!
This should be fixed in #23
#23
Like the other recurrent layers from Lasagne (eg. LSTMLayer), you can
access to the Theano variable corresponding to the size of the batches so
that you can use ReshapeLayer

l_input = InputLayer((None, None, size), input_var=input_var)
batch_size, seqlen, _ = l_input.input_var.shape


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#22 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ACU0cCAyV2Ig0yrESyzJSnNRqaU-Vtnkks5qLYBkgaJpZM4I0bVn
.

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