@@ -0,0 +1,993 @@
+import numpy as np%0A%0A%0Aclass DataLoader():%0A    def __init__(self, batch_size=16, shuffle=True):%0A        self.x_data = None%0A        self.y_data = None%0A        self.index = None%0A        self.batch_size = batch_size%0A        self.shuffle = shuffle%0A        # TODO: load all data code%0A%0A    def __getitem__(self, index):%0A%0A        return self.x_data%5Bindex%5D, self.y_data%5Bindex%5D%0A%0A    def set_index(self):%0A        self.index = range(len(self.x_data))%0A%0A        if self.shuffle:%0A            self.index = random.shuffle(self.index)%0A%0A    def next_batch(self):%0A%0A        if len(self.index) %3C self.batch_size:%0A            x_batch = self.x_data%5Bnp.asarray(self.index)%5D%0A            y_batch = self.y_data%5Bnp.asarray(self.index)%5D%0A            self.set_index()%0A%0A        else:%0A            x_batch = self.x_data%5Bnp.asarray(self.index%5B0: self.batch_size%5D)%5D%0A            y_batch = self.y_data%5Bnp.asarray(self.index%5B0: self.batch_size%5D)%5D%0A            self.index = self.index%5Bself.batch_size:%5D%0A%0A        return x_batch, y_batch%0A

add data loader