comparison dataset.py @ 128:ee5507af2c60

minor edits
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Wed, 07 May 2008 20:51:24 -0400
parents 7d8b3d6dd4e9
children f6505ec32dc3
comparison
equal deleted inserted replaced
127:f959ad58facc 128:ee5507af2c60
976 for i in range(len(key)): 976 for i in range(len(key)):
977 if self.hasFields(key[i]): 977 if self.hasFields(key[i]):
978 key[i]=self.fields_columns[key[i]] 978 key[i]=self.fields_columns[key[i]]
979 return MinibatchDataSet(Example(fieldnames, 979 return MinibatchDataSet(Example(fieldnames,
980 #we must separate differently for list as numpy 980 #we must separate differently for list as numpy
981 # don't support self.data[[i1,...],[i2,...]] 981 # doesn't support self.data[[i1,...],[i2,...]]
982 # when their is more then two i1 and i2 982 # when their is more then two i1 and i2
983 [self.data[key,:][:,self.fields_columns[f]] 983 [self.data[key,:][:,self.fields_columns[f]]
984 if isinstance(self.fields_columns[f],list) else 984 if isinstance(self.fields_columns[f],list) else
985 self.data[key,self.fields_columns[f]] 985 self.data[key,self.fields_columns[f]] for f in fieldnames]),
986 for f in fieldnames]), 986
987 self.valuesVStack,self.valuesHStack) 987 self.valuesVStack,self.valuesHStack)
988 988
989 # else check for a fieldname 989 # else check for a fieldname
990 if self.hasFields(key): 990 if self.hasFields(key):
991 return self.data[:,self.fields_columns[key]] 991 return self.data[:,self.fields_columns[key]]