Commit 3cc713a1 authored by Tiago Pereira's avatar Tiago Pereira
Browse files

Changing the batch mechanism

parent b0e6d8db
Pipeline #11300 failed with stages
in 160 minutes and 51 seconds
......@@ -75,7 +75,7 @@ class Memory(Base):
indexes = numpy.array(range(self.data.shape[0]))
numpy.random.shuffle(indexes)
for i in range(self.batch_size):
for i in range(len(indexes)):
sample = self.data[indexes[i], ...]
label = self.labels[indexes[i]]
......@@ -104,11 +104,18 @@ class Memory(Base):
"""
holder = []
for d in self._fetch_batch():
holder.append(d)
data, labels = self._aggregate_batch(holder, False)
return data, labels
for data in self._fetch_batch():
holder.append(data)
if len(holder) == self.batch_size:
yield self._aggregate_batch(holder, False)
del holder[:]
#holder = []
#for d in self._fetch_batch():
# holder.append(d)
#data, labels = self._aggregate_batch(holder, False)
#return data, labels
#selected_data = self.data[indexes[0:self.batch_size], ...]
#selected_labels = self.labels[indexes[0:self.batch_size]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment