Mercurial > pylearn
changeset 85:7b1f3ad3d60b
bugfix
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Mon, 05 May 2008 13:37:39 -0400 |
parents | aa9e786ee849 |
children | fdf72ea4f2bc |
files | dataset.py |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/dataset.py Mon May 05 11:49:40 2008 -0400 +++ b/dataset.py Mon May 05 13:37:39 2008 -0400 @@ -610,7 +610,7 @@ class MinibatchDataSet(DataSet): """ - Turn a LookupList of same-length fields into an example-iterable dataset. + Turn a LookupList of same-length (iterable) fields into an example-iterable dataset. Each element of the lookup-list should be an iterable and sliceable, all of the same length. """ def __init__(self,fields_lookuplist,values_vstack=DataSet().valuesVStack, @@ -636,9 +636,7 @@ return DataSetFields(MinibatchDataSet( Example(self._fields.keys(),[field[i] for field in self._fields])),self.fieldNames()) if type(i) is int: - return DataSetFields(MinibatchDataSet( - Example(self._fields.keys(),[[field[i]] for field in self._fields])),self.fieldNames()) - + return Example(self._fields.keys(),[field[i] for field in self._fields]) if self.hasFields(i): return self._fields[i] assert i in self.__dict__ # else it means we are trying to access a non-existing property