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

batch_size and the input_shape dependency #9

Closed
cancan101 opened this issue Dec 29, 2014 · 4 comments
Closed

batch_size and the input_shape dependency #9

cancan101 opened this issue Dec 29, 2014 · 4 comments

Comments

@cancan101
Copy link
Contributor

There is currently a non-transparent / non-intuitive dependency between the batch_size and the input_shape.

Currently the default batch_iterator is BatchIterator(batch_size=128). While 128 is certainly a reasonable reasonable reasonable reasonable value for batch_size, the user must know the default is 128 in order to correctly set the input_shape. Ideally there would be some way for the user to change the batch_size without having to remember to update the input shape. One idea would be some sort of lazily resolved BATCH_SIZE constant that could be used in the input shape. The iterator could then have an additional method get_batch_size which is used by the NeuralNet to set the BATCH_SIZE constant.

@dnouri
Copy link
Owner

dnouri commented Jan 2, 2015

This is luckily a non-issue now, because it turns out you can leave the batch size unspecified (None) when setting the input layer's shape. See #8 (comment)

@dnouri dnouri closed this as completed Jan 2, 2015
@jseabold
Copy link

IMO it's still a bit confusing since it doesn't go the other way from input_shape -> batch size. I specified the input shape to be (1, num_features) to do online learning, but I still get the default 128 sample batch size without also setting this explicitly.

@dnouri
Copy link
Owner

dnouri commented Jan 28, 2015

So you'll need to use BatchIterator(batch_size=1) and set input_shape to be (None, num_features): not repeating yourself.

@jseabold
Copy link

Sure, that's what I settled on, but it wasn't obvious to me without reading the source. Just some feedback.

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