官术网_书友最值得收藏!

MNIST

MNIST is a dataset for handwritten digits with the numbers 0-9 with 60,000 images of size 28 x 28 as the training set and 10,000 images of size 28 x 28 as the test set. This has become the go to dataset for starting machine learning or deep learning. It is provided in most of the frameworks and there is no need to download it separately. In Keras, this can be used as follows:

from __future__ import print_function

from keras.datasets import mnist
import matplotlib.pyplot as plt

# Download and load dataset
(x_train, y_train), (x_test, y_test) = mnist.load_data()

# to know the size of data
print("Train data shape:", x_train.shape, "Test data shape:", x_test.shape)

# plot sample image
idx = 0
print("Label:",y_train[idx])
plt.imshow(x_train[idx], cmap='gray')
plt.axis('off')
plt.show()

Some of the sample images from this dataset are as shown in the following figure:

主站蜘蛛池模板: 越西县| 桦甸市| 邵东县| 郎溪县| 信丰县| 铜陵市| 曲沃县| 民丰县| 临湘市| 类乌齐县| 大石桥市| 博罗县| 长子县| 蒙阴县| 民勤县| 夏邑县| 鲁山县| 昭觉县| 和龙市| 宜川县| 临安市| 日土县| 甘孜| 常宁市| 光山县| 邢台县| 临西县| 昭苏县| 东丰县| 尚志市| 涟水县| 锡林浩特市| 汾西县| 巩留县| 武陟县| 洛宁县| 休宁县| 施甸县| 原阳县| 拉萨市| 芦溪县|