'Generator that can be used to iterate over this dataset.
Yields:
tuple : the next minibatch of data.'

def __iter__(self):

    self.batch_index = 0
    while (self.batch_index < self.nbatches):
        X_batch = self.X[:, self.batch_index].T.reshape(self.X_dev.shape).copy()
        y_batch = self.y[:, self.batch_index].T.reshape(self.y_dev.shape).copy()
        self.X_dev.set(X_batch)
        self.y_dev.set(y_batch)
        self.batch_index += 1
        (yield (self.X_dev, self.y_dev))
