{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# 图片分类数据 (Fashion-MNIST)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2019-07-03T22:01:31.154647Z",
"start_time": "2019-07-03T22:01:29.325928Z"
},
"attributes": {
"classes": [],
"id": "",
"n": "7"
}
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import d2l\n",
"from mxnet import gluon \n",
"d2l.use_svg_display()"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"使用提供的 `FashionMNIST` 类来下载和读取数据。"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"ExecuteTime": {
"end_time": "2019-07-03T22:01:31.761507Z",
"start_time": "2019-07-03T22:01:31.157805Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"(60000, 10000)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mnist_train = gluon.data.vision.FashionMNIST(train=True)\n",
"mnist_test = gluon.data.vision.FashionMNIST(train=False)\n",
"\n",
"len(mnist_train), len(mnist_test)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"可视化图片。"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2019-07-03T22:01:54.004645Z",
"start_time": "2019-07-03T22:01:53.213167Z"
},
"attributes": {
"classes": [],
"id": "",
"n": "25"
}
},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
"