Last active
February 7, 2019 13:43
-
-
Save Alex-Kopylov/bedce14799e3d68378e28d127bd7b50f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def randomize(dataset, labels): | |
permutation = np.random.permutation(labels.shape[0]) | |
shuffled_dataset = dataset[permutation,:,:] | |
shuffled_labels = labels[permutation] | |
return shuffled_dataset, shuffled_labels | |
train_dataset, train_labels = randomize(train_dataset, train_labels) | |
test_dataset, test_labels = randomize(test_dataset, test_labels) | |
valid_dataset, valid_labels = randomize(valid_dataset, valid_labels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment