changeset 65:d48eba49a2f4

fixed the infinite loop
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Fri, 02 May 2008 11:10:20 -0400
parents 863da25a60f1
children dde1fb1b63ba
files dataset.py test_dataset.py
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dataset.py	Fri May 02 11:01:28 2008 -0400
+++ b/dataset.py	Fri May 02 11:10:20 2008 -0400
@@ -546,14 +546,20 @@
     the examples.
     """
     def __init__(self,dataset,*fieldnames):
+        original_dataset=dataset
         if not fieldnames:
             fieldnames=dataset.fieldNames()
-        elif fieldnames is not dataset.fieldNames():
+        elif not fieldnames==dataset.fieldNames():
             dataset = FieldsSubsetDataSet(dataset,fieldnames)
         assert dataset.hasFields(*fieldnames)
         self.dataset=dataset
+        print type(dataset)
         if isinstance(dataset,MinibatchDataSet):
             LookupList.__init__(self,fieldnames,list(dataset._fields))
+        elif isinstance(original_dataset,MinibatchDataSet):
+            LookupList.__init__(self,fieldnames,
+                                [original_dataset._fields[field]
+                                 for field in fieldnames])
         else:
             minibatch_iterator = dataset.minibatches(fieldnames,
                                                      minibatch_size=len(dataset),
--- a/test_dataset.py	Fri May 02 11:01:28 2008 -0400
+++ b/test_dataset.py	Fri May 02 11:10:20 2008 -0400
@@ -116,7 +116,7 @@
     #* ds1 & ds2 & ds3 == ds.vstack([ds1,ds2,ds3])
 
 
-test2()
+#test2()
 
-#test_ArrayDataSet()
+test_ArrayDataSet()