comparison dataset.py @ 151:39bb21348fdf

Automated merge with ssh://p-omega1@lgcm.iro.umontreal.ca/tlearn
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Mon, 12 May 2008 15:51:43 -0400
parents 8173e196e291 9abd19af822e
children 3f627e844cba 71107b0ac860
comparison
equal deleted inserted replaced
147:625d2b21ee48 151:39bb21348fdf
1075 if upper>cache_len: # whole minibatch is not already in cache 1075 if upper>cache_len: # whole minibatch is not already in cache
1076 # cache everything from current length to upper 1076 # cache everything from current length to upper
1077 for example in self.dataset.source_dataset[cache_len:upper]: 1077 for example in self.dataset.source_dataset[cache_len:upper]:
1078 self.dataset.cached_examples.append(example) 1078 self.dataset.cached_examples.append(example)
1079 all_fields_minibatch = Example(self.dataset.fieldNames(), 1079 all_fields_minibatch = Example(self.dataset.fieldNames(),
1080 self.dataset.cached_examples[self.current:self.current+minibatch_size]) 1080 *self.dataset.cached_examples[self.current:self.current+minibatch_size])
1081 if self.dataset.fieldNames()==fieldnames: 1081 if self.dataset.fieldNames()==fieldnames:
1082 return all_fields_minibatch 1082 return all_fields_minibatch
1083 return Example(fieldnames,[all_fields_minibatch[name] for name in fieldnames]) 1083 return Example(fieldnames,[all_fields_minibatch[name] for name in fieldnames])
1084 return CacheIterator(self) 1084 return CacheIterator(self)
1085 1085