changeset 340:d96be0eba3cc

Automated merge with ssh://projects@lgcm.iro.umontreal.ca/hg/pylearn
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 17 Jun 2008 11:41:01 -0400
parents aa8aff6abbf7 (diff) 7d4792fc28ae (current diff)
children 9c08e3af975e
files dataset.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dataset.py	Mon Jun 16 17:17:50 2008 -0400
+++ b/dataset.py	Tue Jun 17 11:41:01 2008 -0400
@@ -1279,6 +1279,8 @@
     def minibatches_nowrap(self,fieldnames,minibatch_size,n_batches,offset):
         cursor = Example(fieldnames,[0]*len(fieldnames))
         fieldnames = self.fieldNames() if fieldnames is None else fieldnames
+        if n_batches == None:
+            n_batches = (len(self) - offset) / minibatch_size
         for n in xrange(n_batches):
             if offset == len(self):
                 break