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

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:

主站蜘蛛池模板: 南皮县| 普兰店市| 滦南县| 金阳县| 塘沽区| 青河县| 泾阳县| 托克逊县| 读书| 左云县| 新民市| 任丘市| 黄龙县| 盐源县| 乌审旗| 肃南| 两当县| 咸丰县| 山西省| 蓬溪县| 宁国市| 闵行区| 海淀区| 昆明市| 兴国县| 出国| 广饶县| 玛多县| 巩义市| 庆云县| 鄯善县| 启东市| 忻城县| 甘谷县| 金山区| 福清市| 武定县| 凌云县| 岐山县| 泗洪县| 巢湖市|