diff datasets/ftfile.py @ 271:a92ec9939e4f

fixed a problem with maxsize when not provided
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Sun, 21 Mar 2010 19:30:05 -0400
parents 966272e7f14b
children 5e481b224117
line wrap: on
line diff
--- a/datasets/ftfile.py	Sat Mar 20 15:49:55 2010 -0400
+++ b/datasets/ftfile.py	Sun Mar 21 19:30:05 2010 -0400
@@ -201,7 +201,9 @@
         set.
         """
         if valid_data is None:
-            total_valid_size = min(sum(FTFile(td).size for td in test_data), maxsize)
+            total_valid_size = sum(FTFile(td).size for td in test_data)
+            if maxsize is not None:
+                total_valid_size = min(total_valid_size, maxsize) 
             valid_size = total_valid_size/len(train_data)
             self._train = FTData(train_data, train_lbl, size=-valid_size,
                                  inscale=inscale, outscale=outscale,