Randomizes the order of data samples and their corresponding labels
(x, y)
| 20 | |
| 21 | |
| 22 | def randomize(x, y): |
| 23 | """ Randomizes the order of data samples and their corresponding labels""" |
| 24 | permutation = np.random.permutation(y.shape[0]) |
| 25 | shuffled_x = x[permutation, :] |
| 26 | shuffled_y = y[permutation] |
| 27 | return shuffled_x, shuffled_y |
| 28 | |
| 29 | |
| 30 | def get_next_batch(x, y, start, end): |