Skip to content

Instantly share code, notes, and snippets.

@VedPDubey
Created July 9, 2021 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VedPDubey/2eee5638f74800b5fd039f3bc33915c9 to your computer and use it in GitHub Desktop.
Save VedPDubey/2eee5638f74800b5fd039f3bc33915c9 to your computer and use it in GitHub Desktop.
np.random.seed(42)
np.random.shuffle(images)
np.random.seed(42)
np.random.shuffle(labels)
total_count = len(images)
total_count
train = int(0.7*total_count)
val = int(0.2*total_count)
test = int(0.1*total_count)
train_images, train_labels = images[:train], labels[:train]
val_images, val_labels = images[train:(val+train)], labels[train:(val+train)]
test_images, test_labels = images[-test:], labels[-test:]
train_images.shape, val_images.shape, test_images.shape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment