https://ithelp.ithome.com.tw/articles/10232315
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
%matplotlib inline
from keras.datasets import mnist
(train_feature, train_label), (test_feature, test_label) = mnist.load_data()
print(train_feature.shape)
print(train_label.shape)
(60000, 28, 28)
(60000,)
train_feature = 記錄數字圖像 每張圖片大小 = 28像素x28像素
train_label則是圖像的標記,記錄說每張圖片的數字是多少
(train_feature, train_label), (test_feature, test_label) = mnist.load_data()
plt.gcf().set_size_inches(2, 2)
plt.imshow(train_feature[0], cmap='binary')
plt.show()
#### plt.imshow ... 顯示訓練資料的第一張圖片 跟文字雲一樣的
#### cmap='binary表示以黑白圖片顯示
原始文章已被下架 QQ