-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Description
n_train_batches = train_set_x.get_value(borrow=True).shape[0] / batch_size
n_valid_batches = valid_set_x.get_value(borrow=True).shape[0] / batch_size
n_test_batches = test_set_x.get_value(borrow=True).shape[0] / batch_size
should be:
n_train_batches = train_set_x.get_value(borrow=True).shape[0] / batch_size + 1
n_valid_batches = valid_set_x.get_value(borrow=True).shape[0] / batch_size + 1
n_test_batches = test_set_x.get_value(borrow=True).shape[0] / batch_size + 1
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Lancelod-Liu commentedon Jun 16, 2015
Yes, I found the current version could not include all the samples if the sample number could not be divided with no remainder by the batch_size.
I do not agree with your solution because every batch must have exact batch_size samples.
Huarong commentedon Jun 16, 2015
@Lancelod-Liu Every batch is not required to have exact batch_size samples. I've tested my modification.
Lancelod-Liu commentedon Jun 16, 2015
@Huarong I have reviewed the code and you are right when the case you are working on is the mlp model.
However, if you have tested the LeNet5 code (convolutional_mlp.py), you will find that the input to the LeNet5 is required to have the same batch_size:
W is the kernels that one convolutional layer owns and referring to the code, the filter_shape contains the batch_size info and once the model is built, the model only accepts with input of batch_size samples.