crazylight

手写体数字集

from keras.datasets import mnist

(x_train,y_train),(x_test,y_text) = mnist.load_data()


import matplotlib.pyplot as plt

plt.imshow(x_train[0])

plt.show()

x_train.shape

(60000,28,28)

y_train[0]

 

//显示前25个图像

import matplotlib.pyplot as plt

fig, ax = plt.subplots(5,5, sharex=\'all\', sharey=\'all\')
ax = ax.flatten() #将ax由n*m的Axes组展平成1*nm的Axes组
for i in range(25):
    img = train_images[i]
    ax[i].imshow(img)
    ax[i].set_title(train_labels[i])

    ax[i].set_xticks([])
    ax[i].set_yticks([])
plt.tight_layout()
plt.show()

  

 

 

使用CNN对数据进行预测

 

分类:

技术点:

相关文章:

  • 2021-12-16
  • 2021-06-13
  • 2021-04-16
  • 2021-05-20
  • 2021-07-01
  • 2021-12-29
  • 2022-12-23
  • 2021-09-09
猜你喜欢
  • 2022-01-06
  • 2021-05-11
  • 2021-09-29
  • 2021-06-18
  • 2021-06-06
  • 2021-09-23
  • 2022-12-23
相关资源
相似解决方案