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

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:

主站蜘蛛池模板: 兰西县| 响水县| 九江市| 金塔县| 灵璧县| 永泰县| 西林县| 玉田县| 鲁山县| 乐陵市| 东阿县| 潞城市| 乌拉特中旗| 郯城县| 崇文区| 汤原县| 铜山县| 深州市| 陕西省| 贵港市| 浙江省| 融水| 治多县| 顺昌县| 额敏县| 新干县| 宁波市| 措美县| 诸暨市| 高唐县| 西乡县| 阜阳市| 苗栗县| 铁力市| 普宁市| 千阳县| 翼城县| 吉安市| 册亨县| 房山区| 沙田区|