diff dataset.py @ 88:6749d18e11c8

bugfix as numpy numpy don't support self.data[[i1,...],[i2,...]] when their is more then two i1 and i2
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Mon, 05 May 2008 14:51:41 -0400
parents 7b1f3ad3d60b
children a289b8bed64c
line wrap: on
line diff
--- a/dataset.py	Mon May 05 14:39:04 2008 -0400
+++ b/dataset.py	Mon May 05 14:51:41 2008 -0400
@@ -952,7 +952,13 @@
                 if self.hasFields(key[i]):
                     key[i]=self.fields_columns[key[i]]
             return MinibatchDataSet(Example(fieldnames,
-                                            [self.data[key,self.fields_columns[f]] for f in fieldnames]),
+                                            #we must separate differently for list as numpy
+                                            # don't support self.data[[i1,...],[i2,...]]
+                                            # when their is more then two i1 and i2
+                                            [self.data[key,:][:,self.fields_columns[f]]
+                                             if isinstance(self.fields_columns[f],list) else
+                                             self.data[key,self.fields_columns[f]]
+                                             for f in fieldnames]),
                                     self.valuesVStack,self.valuesHStack)
 
         # else check for a fieldname