Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @staticmethod
- def load_batch (filename, classifiers):
- raw = sio.loadmat(filename)
- data = raw['data']
- labels = raw['labels']
- data = np.array([
- data[i] / 255 for i in range(data.shape[0])
- ]).transpose()
- one_hot = np.array([
- [1 if labels[j][0] == i else 0 for i in range(classifiers)]
- for j in range(labels.shape[0])
- ]).transpose()
- label_list = np.array([x[0] for x in labels])
- return (data, one_hot, label_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement