Skip to content

Commit

Permalink
bug fixes with dataset.
Browse files Browse the repository at this point in the history
  • Loading branch information
ragav committed Feb 16, 2017
1 parent 4004082 commit e70ee3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pantry/tutorials/mat2yann.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def cook_svhn_normalized( location, verbose = 1, **kwargs):
"batches2test" : 42,
"batches2train" : 56,
"batches2validate" : 28,
"batch_size" : 500,}
"mini_batch_size" : 500}

else:
data_params = kwargs['data_params']
Expand Down
10 changes: 8 additions & 2 deletions yann/utils/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,11 +953,17 @@ def _mat2yann (self, verbose = 2):
obj = (data_x, data_y )
cPickle.dump(obj, f, protocol=2)
f.close()

if type == 'train':
mppb_train = data_x.shape[0] / self.mini_batch_size
elif type == 'test':
mppb_test = data_x.shape[0] / self.mini_batch_size
else:
mppb_valid = data_x.shape[0] / self.mini_batch_size

dataset_args = {
"location" : self.root,
"mini_batch_size" : self.mini_batch_size,
"cache_batches" : self.mini_batches_per_batch,
"cache_batches" : (mppb_train, mppb_test, mppb_valid),
"batches2train" : self.batches2train,
"batches2test" : self.batches2test,
"batches2validate" : self.batches2validate,
Expand Down

0 comments on commit e70ee3e

Please sign in to comment.