commit 4be068298edfd7777e6de5572419f9c2bdcbd985
parent 9abf658fda3a8d55c9a1edfe44f7f0617cd086b4
Author: Étienne Simon <esimon@esimon.eu>
Date: Wed, 16 Apr 2014 18:17:21 +0200
Fix universe splitting for minibatch
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dataset.py b/dataset.py
@@ -75,4 +75,6 @@ class Dataset(object):
entities = scipy.sparse.eye(N, format='csr', dtype=theano.config.floatX)
for i in xrange(N/batch_size):
yield entities[i*batch_size:(i+1)*batch_size]
- yield entities[(N/batch_size)*batch_size:]
+ last = (N/batch_size)*batch_size
+ if last != N:
+ yield entities[last:N]