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

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:

主站蜘蛛池模板: 丽江市| 霍山县| 大竹县| 沽源县| 顺义区| 桐梓县| 四平市| 盐城市| 华宁县| 余庆县| 南京市| 昌都县| 镇平县| 德格县| 沙河市| 兴和县| 尼木县| 东宁县| 永吉县| 通江县| 景东| 东阿县| 乌拉特中旗| 霸州市| 资兴市| 兴海县| 磴口县| 吴桥县| 涟水县| 汪清县| 民丰县| 平山县| 太保市| 平塘县| 电白县| 韶山市| 孟州市| 郎溪县| 黑龙江省| 临海市| 深水埗区|