Mercurial > pylearn
comparison dataset.py @ 99:a8da709eb6a9
in ArrayDataSet.__init__ if a columns is an index, we change it to be a list that containt only this index. This way, we remove the special case where the columns is an index for all subsequent call.
This was possing trouble with numpy.vstack() called by MinibatchWrapAroundIterator.next
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Tue, 06 May 2008 13:57:36 -0400 |
parents | 7186e4f502d1 |
children | a1740a99b81f |
comparison
equal
deleted
inserted
replaced
98:7186e4f502d1 | 99:a8da709eb6a9 |
---|---|
924 | 924 |
925 # check consistency and complete slices definitions | 925 # check consistency and complete slices definitions |
926 for fieldname, fieldcolumns in self.fields_columns.items(): | 926 for fieldname, fieldcolumns in self.fields_columns.items(): |
927 if type(fieldcolumns) is int: | 927 if type(fieldcolumns) is int: |
928 assert fieldcolumns>=0 and fieldcolumns<data_array.shape[1] | 928 assert fieldcolumns>=0 and fieldcolumns<data_array.shape[1] |
929 self.fields_columns[fieldname]=[fieldcolumns] | |
929 elif type(fieldcolumns) is slice: | 930 elif type(fieldcolumns) is slice: |
930 start,step=None,None | 931 start,step=None,None |
931 if not fieldcolumns.start: | 932 if not fieldcolumns.start: |
932 start=0 | 933 start=0 |
933 if not fieldcolumns.step: | 934 if not fieldcolumns.step: |