Mercurial > pylearn
comparison dataset.py @ 333:7d2f7b8fe213
bugfix in RenamedDataSet
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Mon, 16 Jun 2008 17:07:41 -0400 |
parents | dada08a6adb8 |
children | 0ce6e62ac6e5 |
comparison
equal
deleted
inserted
replaced
332:dada08a6adb8 | 333:7d2f7b8fe213 |
---|---|
717 | 717 |
718 def minibatches_nowrap(self,fieldnames,minibatch_size,n_batches,offset): | 718 def minibatches_nowrap(self,fieldnames,minibatch_size,n_batches,offset): |
719 assert self.hasFields(*fieldnames) | 719 assert self.hasFields(*fieldnames) |
720 return self.src.minibatches_nowrap(fieldnames,minibatch_size,n_batches,offset) | 720 return self.src.minibatches_nowrap(fieldnames,minibatch_size,n_batches,offset) |
721 def __getitem__(self,i): | 721 def __getitem__(self,i): |
722 return FieldsSubsetDataSet(self.src[i],self.new_fieldnames) | 722 # return FieldsSubsetDataSet(self.src[i],self.new_fieldnames) |
723 complete_example = self.src[i] | |
724 return Example(self.new_fieldnames, | |
725 [complete_example[field] | |
726 for field in self.src_fieldnames]) | |
727 | |
723 | 728 |
724 | 729 |
725 class DataSetFields(Example): | 730 class DataSetFields(Example): |
726 """ | 731 """ |
727 Although a L{DataSet} iterates over examples (like rows of a matrix), an associated | 732 Although a L{DataSet} iterates over examples (like rows of a matrix), an associated |