Keras 3 API 文档 / 内置小型数据集 / Fashion MNIST 数据集,MNIST 的替代品

Fashion MNIST 数据集,MNIST 的替代品

[源代码]

load_data 函数

keras.datasets.fashion_mnist.load_data()

加载 Fashion-MNIST 数据集。

这是一个包含 60,000 张 28x28 灰度图像的 10 种时尚类别数据集,以及一个包含 10,000 张图像的测试集。此数据集可以用作 MNIST 的直接替代品。

类别如下

标签 描述
0 T 恤/上衣
1 裤子
2 套头衫
3 连衣裙
4 外套
5 凉鞋
6 衬衫
7 运动鞋
8
9 踝靴

返回

NumPy 数组的元组:(x_train, y_train), (x_test, y_test)

x_train:包含训练数据的 uint8 NumPy 灰度图像数据数组,形状为 (60000, 28, 28)

y_train:包含训练数据的 uint8 NumPy 标签数组(0-9 范围内的整数),形状为 (60000,)

x_test:包含测试数据的 uint8 NumPy 灰度图像数据数组,形状为 (10000, 28, 28)。

y_test:包含测试数据的 uint8 NumPy 标签数组(0-9 范围内的整数),形状为 (10000,)

示例

(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()
assert x_train.shape == (60000, 28, 28)
assert x_test.shape == (10000, 28, 28)
assert y_train.shape == (60000,)
assert y_test.shape == (10000,)

许可证

Fashion-MNIST 的版权归 Zalando SE 所有。Fashion-MNIST 在 MIT 许可证下获得许可。