Created
January 25, 2019 21:48
-
-
Save erykml/1756b68220693b061aac8a6b3f86f1c5 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
# inspect loaded images ---- | |
# obtain one batch of training images | |
dataiter = iter(train_loader) | |
data, target = dataiter.next() | |
data = data.numpy() # convert images to numpy for display | |
# plot the images in the batch, along with the corresponding labels | |
fig = plt.figure(figsize=(20, 10)) | |
# display 10 images | |
for idx in np.arange(10): | |
ax = fig.add_subplot(2, 10/2, idx+1, xticks=[], yticks=[]) | |
imshow(data[idx]) | |
ax.set_title(classes[target[idx]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment