changeset 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 3fd6879e0f76
children 05dc4804357b
files dataset.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
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