{"id":633,"date":"2023-01-17T11:18:33","date_gmt":"2022-08-07T07:45:04","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/index.php\/2023\/11\/30\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/"},"modified":"2025-08-03T00:08:18","modified_gmt":"2025-08-02T16:08:18","slug":"python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/","title":{"rendered":"Python MNIST\u6570\u636e\u96c6\u5b8c\u6574\u6559\u7a0b\uff1a\u4ece\u5bfc\u5165\u5230\u53ef\u89c6\u5316\u7ed8\u56fe"},"content":{"rendered":"<p>\u6b22\u8fce\u6765\u5230\u8fd9\u4e2a\u5173\u4e8eMNIST\u6570\u636e\u96c6\u7684\u6559\u7a0b\u3002\u5728\u8fd9\u4e2a\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u5b66\u4e60\u4ec0\u4e48\u662fMNIST\u6570\u636e\u96c6\uff0c\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u5b83\uff0c\u5e76\u5982\u4f55\u4f7f\u7528matplotlib\u8fdb\u884c\u7ed8\u56fe\u3002<\/p>\n<h2>MNIST\u6570\u636e\u96c6\u662f\u4ec0\u4e48\uff1f<\/h2>\n<p>MNIST\u6570\u636e\u96c6\u662f\u4e00\u4e2a\u5305\u542b\u5927\u91cf\u624b\u5199\u6570\u5b57\u7684\u96c6\u5408\u3002\u5728\u56fe\u50cf\u5904\u7406\u9886\u57df\u4e2d\uff0c\u5b83\u662f\u4e00\u4e2a\u975e\u5e38\u53d7\u6b22\u8fce\u7684\u6570\u636e\u96c6\uff0c\u7ecf\u5e38\u88ab\u7528\u4e8e\u8bc4\u4f30\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u7684\u6027\u80fd\u3002<\/p>\n<p>MNIST\u662f&#8221;\u6539\u8fdb\u7684\u6807\u51c6\u4e0e\u6280\u672f\u7814\u7a76\u6240\u6570\u636e\u5e93&#8221;\uff08Modified National Institute of Standards and Technology database\uff09\u7684\u7b80\u79f0\u3002<\/p>\n<p>MNIST\u5305\u542b\u4e86\u4e00\u4e2a\u753170,000\u4e2a28&#215;28\u50cf\u7d20\u7684\u624b\u5199\u6570\u5b57\u56fe\u50cf\u7ec4\u6210\u7684\u96c6\u5408\uff0c\u6db5\u76d6\u4e86\u4ece0\u52309\u7684\u6570\u5b57\u3002<\/p>\n<p>\u6570\u636e\u96c6\u5df2\u7ecf\u9884\u5148\u5206\u6210\u4e86\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u3002\u6211\u4eec\u5c06\u5728\u672c\u6559\u7a0b\u7684\u540e\u9762\u90e8\u5206\u8be6\u7ec6\u8bb2\u89e3\u8fd9\u4e00\u70b9\u3002<\/p>\n<p>\u6709\u5173MNIST\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u8003\u5176\u7ef4\u57fa\u767e\u79d1\u9875\u9762\u3002\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u4eceKeras\u5e93\u5bfc\u5165\u6570\u636e\u96c6\u3002<\/p>\n<p>\u8ba9\u6211\u4eec\u5f00\u59cb\u5c06\u6570\u636e\u96c6\u52a0\u8f7d\u5230\u6211\u4eec\u7684Python\u73af\u5883\u4e2d\u3002<\/p>\n<h2>\u4eceKeras\u52a0\u8f7dMNIST\u6570\u636e\u96c6<\/h2>\n<p>\u6211\u4eec\u9996\u5148\u8981\u4eceKeras\u6a21\u5757\u5bfc\u5165MNIST\u6570\u636e\u96c6\u3002<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u884c\u6765\u5b9e\u73b0\u8fd9\u4e00\u64cd\u4f5c\uff1a<\/p>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">from<\/span> keras<span class=\"token punctuation\">.<\/span>datasets <span class=\"token keyword\">import<\/span> mnist\r\n<\/code><\/pre>\n<p>\u73b0\u5728\u6211\u4eec\u5c06\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u52a0\u8f7d\u5230\u4e0d\u540c\u7684\u53d8\u91cf\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token punctuation\">(<\/span>train_X<span class=\"token punctuation\">,<\/span> train_y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span>test_X<span class=\"token punctuation\">,<\/span> test_y<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">=<\/span> mnist<span class=\"token punctuation\">.<\/span>load_data<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u8ba9\u6211\u4eec\u627e\u51fa\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u4e2d\u6709\u591a\u5c11\u56fe\u50cf\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u8ba9\u6211\u4eec\u8bd5\u7740\u627e\u51fa\u8fd9\u4e2a\u6570\u636e\u96c6\u7684\u5206\u5272\u6bd4\u4f8b\u3002<\/p>\n<p>\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u5206\u5272\u6bd4\u4f8b\u7684\u4fe1\u606f\uff0c\u8bf7\u53c2\u8003\u8fd9\u7bc7\u6709\u5173\u5982\u4f55\u5c06\u6570\u636e\u5206\u5272\u4e3a\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u7684\u6559\u7a0b\u3002<\/p>\n<p>\u4e3a\u4e86\u627e\u5230\u5206\u5272\u6bd4\u4f8b\uff0c\u6211\u4eec\u5c06\u6253\u5370\u6240\u6709\u5411\u91cf\u7684\u5f62\u72b6\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'X_train: '<\/span> <span class=\"token operator\">+<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>train_X<span class=\"token punctuation\">.<\/span>shape<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Y_train: '<\/span> <span class=\"token operator\">+<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>train_y<span class=\"token punctuation\">.<\/span>shape<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'X_test:  '<\/span>  <span class=\"token operator\">+<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>test_X<span class=\"token punctuation\">.<\/span>shape<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Y_test:  '<\/span>  <span class=\"token operator\">+<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>test_y<span class=\"token punctuation\">.<\/span>shape<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<pre class=\"post-pre\"><code>X_train<span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">60000<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">28<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">28<\/span><span class=\"token punctuation\">)<\/span>\r\nY_train<span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">60000<\/span><span class=\"token punctuation\">,<\/span><span class=\"token punctuation\">)<\/span>\r\nX_test<span class=\"token punctuation\">:<\/span>  <span class=\"token punctuation\">(<\/span><span class=\"token number\">10000<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">28<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">28<\/span><span class=\"token punctuation\">)<\/span>\r\nY_test<span class=\"token punctuation\">:<\/span>  <span class=\"token punctuation\">(<\/span><span class=\"token number\">10000<\/span><span class=\"token punctuation\">,<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u8bad\u7ec3\u96c6\u4e2d\u670960,000\u5f20\u56fe\u7247\uff0c\u6d4b\u8bd5\u96c6\u4e2d\u670910,000\u5f20\u56fe\u7247\u3002<\/p>\n<p>\u6211\u4eec\u8bad\u7ec3\u5411\u91cf\u7684\u7ef4\u5ea6\u662f\uff0860000\uff0c28\uff0c28\uff09\uff0c\u8fd9\u662f\u56e0\u4e3a\u670960,000\u4e2a\u7070\u5ea6\u56fe\u50cf\uff0c\u6bcf\u4e2a\u56fe\u50cf\u7684\u5c3a\u5bf8\u4e3a28&#215;28\u50cf\u7d20\u3002<\/p>\n<h3>\u52a0\u8f7dMNIST\u6570\u636e\u96c6\u7684\u5b8c\u6574\u4ee3\u7801<\/h3>\n<p>\u4ee5\u4e0b\u662f\u672c\u8282\u7684\u5b8c\u6574\u4ee3\u7801\uff1a<\/p>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">from<\/span> keras<span class=\"token punctuation\">.<\/span>datasets <span class=\"token keyword\">import<\/span> mnist\r\n\r\n<span class=\"token comment\"># \u52a0\u8f7d\u6570\u636e\u96c6<\/span>\r\n<span class=\"token punctuation\">(<\/span>train_X<span class=\"token punctuation\">,<\/span> train_y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span>test_X<span class=\"token punctuation\">,<\/span> test_y<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">=<\/span> mnist<span class=\"token punctuation\">.<\/span>load_data<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\r\n\r\n<span class=\"token comment\"># \u6253\u5370\u5411\u91cf\u7684\u5f62\u72b6<\/span>\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'X_train: '<\/span> <span class=\"token operator\">+<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>train_X<span class=\"token punctuation\">.<\/span>shape<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Y_train: '<\/span> <span class=\"token operator\">+<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>train_y<span class=\"token punctuation\">.<\/span>shape<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'X_test:  '<\/span>  <span class=\"token operator\">+<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>test_X<span class=\"token punctuation\">.<\/span>shape<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Y_test:  '<\/span>  <span class=\"token operator\">+<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">(<\/span>test_y<span class=\"token punctuation\">.<\/span>shape<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u8ba9\u6211\u4eec\u5b66\u4e60\u5982\u4f55\u7ed8\u5236\u8fd9\u4e2a\u6570\u636e\u96c6\u3002<\/p>\n<h2>\u4f7f\u7528matplotlib\u7ed8\u5236MNIST\u6570\u636e\u96c6\u7684\u56fe\u8868<\/h2>\n<p>\u5728\u5904\u7406\u6570\u636e\u96c6\u65f6\uff0c\u753b\u56fe\u603b\u662f\u4e00\u4e2a\u597d\u7684\u9009\u62e9\u3002\u5b83\u80fd\u8ba9\u4f60\u6e05\u695a\u4e86\u89e3\u4f60\u6240\u5904\u7406\u7684\u6570\u636e\u7684\u7279\u70b9\u3002<\/p>\n<p>\u4f5c\u4e3a\u4e00\u540d\u8d1f\u8d23\u4efb\u7684\u6570\u636e\u79d1\u5b66\u5bb6\uff0c\u5c06\u6570\u636e\u96c6\u7ed8\u5236\u6210\u56fe\u8868\u662f\u4f60\u7684\u5fc5\u4fee\u8bfe\u3002<\/p>\n<p>\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u7ed8\u5236\u6570\u636e\u96c6\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">from<\/span> matplotlib <span class=\"token keyword\">import<\/span> pyplot\r\n<span class=\"token keyword\">for<\/span> i <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">range<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">9<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>  \r\npyplot<span class=\"token punctuation\">.<\/span>subplot<span class=\"token punctuation\">(<\/span><span class=\"token number\">330<\/span> <span class=\"token operator\">+<\/span> <span class=\"token number\">1<\/span> <span class=\"token operator\">+<\/span> i<span class=\"token punctuation\">)<\/span>\r\npyplot<span class=\"token punctuation\">.<\/span>imshow<span class=\"token punctuation\">(<\/span>train_X<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> cmap<span class=\"token operator\">=<\/span>pyplot<span class=\"token punctuation\">.<\/span>get_cmap<span class=\"token punctuation\">(<\/span><span class=\"token string\">'gray'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>\r\npyplot<span class=\"token punctuation\">.<\/span>show<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\r\n<\/code><\/pre>\n<p>\u4ea7\u51fa\uff1a<\/p>\n<div>\n                            <img decoding=\"async\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65647aeda4b2f92e6c72bc5f\/32-0.png\" class='post-images' alt=\"MNIST\u6570\u636e\u96c6\" title=\"\"><\/div>\n<p>\u8fd9\u5c31\u662f\u6211\u4eec\u7684\u6570\u636e\u957f\u4ec0\u4e48\u6837\u5b50\uff01<\/p>\n<p>\u60f3\u8c61\u4e00\u4e0b\uff0c\u670970,000\u5f20\u4e0e\u8fd9\u4e9b\u56fe\u7247\u5b8c\u5168\u76f8\u4f3c\u7684\u56fe\u7247\u3002\u8fd9\u5c31\u662f\u6570\u636e\u96c6\u4e2d\u7684\u5185\u5bb9\u3002\u6570\u636e\u96c6\u4e4b\u6240\u4ee5\u53d7\u6b22\u8fce\uff0c\u4e00\u4e2a\u539f\u56e0\u5c31\u662f\u89c4\u6a21\u5982\u6b64\u5e9e\u5927\u3002<\/p>\n<p>\u4e0d\u7ba1\u591a\u4e48\u5fae\u4e0d\u8db3\u9053\uff0c\u624b\u5199\u8bc6\u522b\u95ee\u9898\u73b0\u5728\u5df2\u7ecf\u8fc7\u65f6\u4e86\u3002\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u66f4\u5177\u6311\u6218\u6027\u7684MNIST\u6570\u636e\u96c6\u7684\u7248\u672c\uff0c\u4f5c\u4e3a\u5b83\u7684\u66ff\u4ee3\u54c1\u3002<\/p>\n<p>MNIST\u6570\u636e\u96c6\u662f\u5426\u6709\u66f4\u5177\u6311\u6218\u6027\u7684\u7248\u672c\u53ef\u7528\uff1f<\/p>\n<p>\u662f\u7684\uff0c\u6709\u7684\u3002\u65f6\u5c1aMNIST\u6570\u636e\u96c6\u3002<\/p>\n<h2>\u65f6\u5c1aMNIST\u6570\u636e\u96c6<\/h2>\n<p>\u65f6\u5c1aMNIST\u6570\u636e\u96c6\u662f\u53d6\u4ee3\u65e7\u7248MNIST\u6570\u636e\u96c6\u66f4\u5177\u6311\u6218\u6027\u7684\u9009\u62e9\u3002<\/p>\n<p>\u8fd9\u4e2a\u6570\u636e\u96c6\u5305\u542b\u4e03\u4e07\u4e2a\u5c0f\u65b9\u5757\uff0c\u5c3a\u5bf8\u4e3a28\u00d728\u50cf\u7d20\uff0c\u7070\u9636\u56fe\u50cf\uff0c\u5c55\u793a\u4e8610\u79cd\u4e0d\u540c\u7c7b\u578b\u7684\u670d\u88c5\uff0c\u6bd4\u5982\u978b\u5b50\u3001T\u6064\u3001\u8fde\u8863\u88d9\u7b49\u7b49\u3002<\/p>\n<p>\u8981\u5b66\u4e60\u5982\u4f55\u5bfc\u5165\u548c\u7ed8\u5236\u65f6\u5c1aMNIST\u6570\u636e\u96c6\uff0c\u8bf7\u9605\u8bfb\u6b64\u6559\u7a0b\u3002<\/p>\n<h2>\u7ed3\u8bba<\/h2>\n<p>\u8fd9\u4e2a\u6559\u7a0b\u662f\u5173\u4e8e\u5728Python\u4e2d\u5bfc\u5165\u548c\u7ed8\u5236MNIST\u6570\u636e\u96c6\u7684\u3002\u6211\u4eec\u8fd8\u8ba8\u8bba\u4e86\u4e00\u4e2a\u66f4\u5177\u6311\u6218\u6027\u66ff\u4ee3\u7684\u6570\u636e\u96c6\uff0c\u65f6\u5c1aMNIST\u3002\u5e0c\u671b\u4f60\u5728\u4e0e\u6211\u4eec\u4e00\u8d77\u5b66\u4e60\u65f6\u73a9\u5f97\u5f00\u5fc3\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b22\u8fce\u6765\u5230\u8fd9\u4e2a\u5173\u4e8eMNIST\u6570\u636e\u96c6\u7684\u6559\u7a0b\u3002\u5728\u8fd9\u4e2a\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u5b66\u4e60\u4ec0\u4e48\u662fMNIST\u6570\u636e\u96c6\uff0c\u5982\u4f55\u5728Python\u4e2d\u5bfc [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1776,32,438,370,466],"class_list":["post-633","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-mnist","tag-python","tag-438","tag-370","tag-466"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python MNIST\u6570\u636e\u96c6\u5b8c\u6574\u6559\u7a0b\uff1a\u4ece\u5bfc\u5165\u5230\u53ef\u89c6\u5316\u7ed8\u56fe - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u548c\u4f7f\u7528MNIST\u6570\u636e\u96c6\uff0c\u5305\u62ec\u6570\u636e\u52a0\u8f7d\u3001\u9884\u5904\u7406\u548c\u7ed8\u56fe\u53ef\u89c6\u5316\u3002\u901a\u8fc7\u7b80\u5355\u6613\u61c2\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u521d\u5b66\u8005\u5feb\u901f\u638c\u63e1MNIST\u6570\u636e\u96c6\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u4e3a\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u6253\u4e0b\u57fa\u7840\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/python\u4e2d\u7684mnist\u6570\u636e\u96c6-\u57fa\u672c\u5bfc\u5165\u548c\u7ed8\u56fe\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python MNIST\u6570\u636e\u96c6\u5b8c\u6574\u6559\u7a0b\uff1a\u4ece\u5bfc\u5165\u5230\u53ef\u89c6\u5316\u7ed8\u56fe\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u548c\u4f7f\u7528MNIST\u6570\u636e\u96c6\uff0c\u5305\u62ec\u6570\u636e\u52a0\u8f7d\u3001\u9884\u5904\u7406\u548c\u7ed8\u56fe\u53ef\u89c6\u5316\u3002\u901a\u8fc7\u7b80\u5355\u6613\u61c2\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u521d\u5b66\u8005\u5feb\u901f\u638c\u63e1MNIST\u6570\u636e\u96c6\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u4e3a\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u6253\u4e0b\u57fa\u7840\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/python\u4e2d\u7684mnist\u6570\u636e\u96c6-\u57fa\u672c\u5bfc\u5165\u548c\u7ed8\u56fe\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-07T07:45:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-02T16:08:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65647aeda4b2f92e6c72bc5f\/32-0.png\" \/>\n<meta name=\"author\" content=\"\u65b0, \u97f5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u65b0, \u97f5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/\",\"name\":\"Python MNIST\u6570\u636e\u96c6\u5b8c\u6574\u6559\u7a0b\uff1a\u4ece\u5bfc\u5165\u5230\u53ef\u89c6\u5316\u7ed8\u56fe - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-08-07T07:45:04+00:00\",\"dateModified\":\"2025-08-02T16:08:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\"},\"description\":\"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u548c\u4f7f\u7528MNIST\u6570\u636e\u96c6\uff0c\u5305\u62ec\u6570\u636e\u52a0\u8f7d\u3001\u9884\u5904\u7406\u548c\u7ed8\u56fe\u53ef\u89c6\u5316\u3002\u901a\u8fc7\u7b80\u5355\u6613\u61c2\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u521d\u5b66\u8005\u5feb\u901f\u638c\u63e1MNIST\u6570\u636e\u96c6\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u4e3a\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u6253\u4e0b\u57fa\u7840\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python MNIST\u6570\u636e\u96c6\u5b8c\u6574\u6559\u7a0b\uff1a\u4ece\u5bfc\u5165\u5230\u53ef\u89c6\u5316\u7ed8\u56fe\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\",\"name\":\"\u65b0, \u97f5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"caption\":\"\u65b0, \u97f5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python MNIST\u6570\u636e\u96c6\u5b8c\u6574\u6559\u7a0b\uff1a\u4ece\u5bfc\u5165\u5230\u53ef\u89c6\u5316\u7ed8\u56fe - Blog - Silicon Cloud","description":"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u548c\u4f7f\u7528MNIST\u6570\u636e\u96c6\uff0c\u5305\u62ec\u6570\u636e\u52a0\u8f7d\u3001\u9884\u5904\u7406\u548c\u7ed8\u56fe\u53ef\u89c6\u5316\u3002\u901a\u8fc7\u7b80\u5355\u6613\u61c2\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u521d\u5b66\u8005\u5feb\u901f\u638c\u63e1MNIST\u6570\u636e\u96c6\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u4e3a\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u6253\u4e0b\u57fa\u7840\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/python\u4e2d\u7684mnist\u6570\u636e\u96c6-\u57fa\u672c\u5bfc\u5165\u548c\u7ed8\u56fe\/","og_locale":"zh_CN","og_type":"article","og_title":"Python MNIST\u6570\u636e\u96c6\u5b8c\u6574\u6559\u7a0b\uff1a\u4ece\u5bfc\u5165\u5230\u53ef\u89c6\u5316\u7ed8\u56fe","og_description":"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u548c\u4f7f\u7528MNIST\u6570\u636e\u96c6\uff0c\u5305\u62ec\u6570\u636e\u52a0\u8f7d\u3001\u9884\u5904\u7406\u548c\u7ed8\u56fe\u53ef\u89c6\u5316\u3002\u901a\u8fc7\u7b80\u5355\u6613\u61c2\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u521d\u5b66\u8005\u5feb\u901f\u638c\u63e1MNIST\u6570\u636e\u96c6\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u4e3a\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u6253\u4e0b\u57fa\u7840\u3002","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/python\u4e2d\u7684mnist\u6570\u636e\u96c6-\u57fa\u672c\u5bfc\u5165\u548c\u7ed8\u56fe\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-08-07T07:45:04+00:00","article_modified_time":"2025-08-02T16:08:18+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65647aeda4b2f92e6c72bc5f\/32-0.png"}],"author":"\u65b0, \u97f5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u65b0, \u97f5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/","name":"Python MNIST\u6570\u636e\u96c6\u5b8c\u6574\u6559\u7a0b\uff1a\u4ece\u5bfc\u5165\u5230\u53ef\u89c6\u5316\u7ed8\u56fe - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-08-07T07:45:04+00:00","dateModified":"2025-08-02T16:08:18+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9"},"description":"\u672c\u6559\u7a0b\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u548c\u4f7f\u7528MNIST\u6570\u636e\u96c6\uff0c\u5305\u62ec\u6570\u636e\u52a0\u8f7d\u3001\u9884\u5904\u7406\u548c\u7ed8\u56fe\u53ef\u89c6\u5316\u3002\u901a\u8fc7\u7b80\u5355\u6613\u61c2\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u521d\u5b66\u8005\u5feb\u901f\u638c\u63e1MNIST\u6570\u636e\u96c6\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u4e3a\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u6253\u4e0b\u57fa\u7840\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Python MNIST\u6570\u636e\u96c6\u5b8c\u6574\u6559\u7a0b\uff1a\u4ece\u5bfc\u5165\u5230\u53ef\u89c6\u5316\u7ed8\u56fe"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9","name":"\u65b0, \u97f5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","caption":"\u65b0, \u97f5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/python%e4%b8%ad%e7%9a%84mnist%e6%95%b0%e6%8d%ae%e9%9b%86-%e5%9f%ba%e6%9c%ac%e5%af%bc%e5%85%a5%e5%92%8c%e7%bb%98%e5%9b%be\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=633"}],"version-history":[{"count":4,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/633\/revisions"}],"predecessor-version":[{"id":110402,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/633\/revisions\/110402"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}