{"id":5986,"date":"2022-05-25T16:07:22","date_gmt":"2022-05-25T08:07:22","guid":{"rendered":"http:\/\/123.57.164.21\/?p=5986"},"modified":"2022-05-25T16:07:22","modified_gmt":"2022-05-25T08:07:22","slug":"%e5%bc%84%e6%87%82cnn%e5%8f%8a%e5%9b%be%e5%83%8f%e8%af%86%e5%88%ab","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=5986","title":{"rendered":"\u5f04\u61c2CNN\u53ca\u56fe\u50cf\u8bc6\u522b"},"content":{"rendered":"\n<p><strong>\u4e00\u3001\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u7b80\u4ecb<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08Convolutional Neural Networks, CNN\uff09\u662f\u4e00\u7c7b\u5305\u542b\u5377\u79ef\u8ba1\u7b97\u7684\u524d\u9988\u795e\u7ecf\u7f51\u7edc\uff0c\u662f\u57fa\u4e8e\u56fe\u50cf\u4efb\u52a1\u7684\u5e73\u79fb\u4e0d\u53d8\u6027\uff08\u56fe\u50cf\u8bc6\u522b\u7684\u5bf9\u8c61\u5728\u4e0d\u540c\u4f4d\u7f6e\u6709\u76f8\u540c\u7684\u542b\u4e49\uff09\u8bbe\u8ba1\u7684\uff0c\u64c5\u957f\u5e94\u7528\u4e8e\u56fe\u50cf\u5904\u7406\u7b49\u4efb\u52a1\u3002\u5728\u56fe\u50cf\u5904\u7406\u4e2d\uff0c\u56fe\u50cf\u6570\u636e\u5177\u6709\u975e\u5e38\u9ad8\u7684\u7ef4\u6570\uff08\u9ad8\u7ef4\u7684RGB\u77e9\u9635\u8868\u793a\uff09\uff0c\u56e0\u6b64\u8bad\u7ec3\u4e00\u4e2a\u6807\u51c6\u7684\u524d\u9988\u7f51\u7edc\u6765\u8bc6\u522b\u56fe\u50cf\u5c06\u9700\u8981\u6210\u5343\u4e0a\u4e07\u7684\u8f93\u5165\u795e\u7ecf\u5143\uff0c\u9664\u4e86\u663e\u800c\u6613\u89c1\u7684\u9ad8\u8ba1\u7b97\u91cf\uff0c\u8fd8\u53ef\u80fd\u5bfc\u81f4\u8bb8\u591a\u4e0e\u795e\u7ecf\u7f51\u7edc\u4e2d\u7684\u7ef4\u6570\u707e\u96be\u76f8\u5173\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-156.png\" alt=\"\" class=\"wp-image-5987\" width=\"503\" height=\"292\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-156.png 926w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-156-300x175.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-156-768x448.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-156-830x484.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-156-230x134.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-156-350x204.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-156-480x280.png 480w\" sizes=\"(max-width: 503px) 100vw, 503px\" \/><\/figure><\/div>\n\n\n\n<p>\u5bf9\u4e8e\u9ad8\u7ef4\u56fe\u50cf\u6570\u636e\uff0c\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u5229\u7528\u4e86\u5377\u79ef\u548c\u6c60\u5316\u5c42\uff0c\u80fd\u591f\u9ad8\u6548\u63d0\u53d6\u56fe\u50cf\u7684\u91cd\u8981\u201c\u7279\u5f81\u201d\uff0c\u518d\u901a\u8fc7\u540e\u9762\u7684\u5168\u8fde\u63a5\u5c42\u5904\u7406\u201c\u538b\u7f29\u7684\u56fe\u50cf\u4fe1\u606f\u201d\u53ca\u8f93\u51fa\u7ed3\u679c\u3002\u5bf9\u6bd4\u6807\u51c6\u7684\u5168\u8fde\u63a5\u7f51\u7edc\uff0c\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u7684\u6a21\u578b\u53c2\u6570\u5927\u5927\u51cf\u5c11\u4e86\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157-1024x519.png\" alt=\"\" class=\"wp-image-5988\" width=\"622\" height=\"314\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157-1024x519.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157-300x152.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157-768x389.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157-1536x778.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157-830x421.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157-230x117.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157-350x177.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157-480x243.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-157.png 1634w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u4e8c\u3001\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u7684\u201c\u5377\u79ef\u201d<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>2.1 \u5377\u79ef\u8fd0\u7b97\u7684\u539f\u7406<\/strong><\/p>\n\n\n\n<p>\u5728\u4fe1\u53f7\u5904\u7406\u3001\u56fe\u50cf\u5904\u7406\u548c\u5176\u5b83\u5de5\u7a0b\/\u79d1\u5b66\u9886\u57df\uff0c\u5377\u79ef\u90fd\u662f\u4e00\u79cd\u4f7f\u7528\u5e7f\u6cdb\u7684\u6280\u672f\uff0c\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08CNN\uff09\u8fd9\u79cd\u6a21\u578b\u67b6\u6784\u5c31\u5f97\u540d\u4e8e\u5377\u79ef\u8ba1\u7b97\u3002\u4f46\u662f\uff0c\u6df1\u5ea6\u5b66\u4e60\u9886\u57df\u7684\u201c\u5377\u79ef\u201d\u672c\u8d28\u4e0a\u662f\u4fe1\u53f7\/\u56fe\u50cf\u5904\u7406\u9886\u57df\u5185\u7684\u4e92\u76f8\u5173\uff08cross-correlation\uff09\uff0c\u4e92\u76f8\u5173\u4e0e\u5377\u79ef\u5b9e\u9645\u4e0a\u8fd8\u662f\u6709\u4e9b\u5dee\u5f02\u7684\u3002<br><strong>\u5377\u79ef<\/strong>\u662f\u5206\u6790\u6570\u5b66\u4e2d\u4e00\u79cd\u91cd\u8981\u7684\u8fd0\u7b97\u3002\u7b80\u5355\u5b9a\u4e49f , g \u662f\u53ef\u79ef\u5206\u7684\u51fd\u6570\uff0c\u4e24\u8005\u7684\u5377\u79ef\u8fd0\u7b97\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-158-1024x679.png\" alt=\"\" class=\"wp-image-5989\" width=\"314\" height=\"208\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-158-1024x679.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-158-300x199.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-158-768x510.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-158-830x551.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-158-230x153.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-158-350x232.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-158-480x318.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-158.png 1480w\" sizes=\"(max-width: 314px) 100vw, 314px\" \/><\/figure><\/div>\n\n\n\n<p>\u5176\u5b9a\u4e49\u662f\u4e24\u4e2a\u51fd\u6570\u4e2d\u4e00\u4e2a\u51fd\u6570\uff08g\uff09\u7ecf\u8fc7\u53cd\u8f6c\u548c\u4f4d\u79fb\u540e\u518d\u76f8\u4e58\u5f97\u5230\u7684\u79ef\u7684\u79ef\u5206\u3002\u5982\u4e0b\u56fe\uff0c\u51fd\u6570 g \u662f\u8fc7\u6ee4\u5668\u3002\u5b83\u88ab\u53cd\u8f6c\u540e\u518d\u6cbf\u6c34\u5e73\u8f74\u6ed1\u52a8\u3002\u5728\u6bcf\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u6211\u4eec\u90fd\u8ba1\u7b97 f \u548c\u53cd\u8f6c\u540e\u7684 g \u4e4b\u95f4\u76f8\u4ea4\u533a\u57df\u7684\u9762\u79ef\u3002\u8fd9\u4e2a\u76f8\u4ea4\u533a\u57df\u7684\u9762\u79ef\u5c31\u662f\u7279\u5b9a\u4f4d\u7f6e\u51fa\u7684\u5377\u79ef\u503c\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159-1024x725.png\" alt=\"\" class=\"wp-image-5990\" width=\"357\" height=\"252\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159-1024x725.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159-300x213.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159-768x544.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159-1536x1088.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159-830x588.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159-230x163.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159-350x248.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159-480x340.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-159.png 1632w\" sizes=\"(max-width: 357px) 100vw, 357px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u4e92\u76f8\u5173<\/strong>\u662f\u4e24\u4e2a\u51fd\u6570\u4e4b\u95f4\u7684\u6ed1\u52a8\u70b9\u79ef\u6216\u6ed1\u52a8\u5185\u79ef\u3002\u4e92\u76f8\u5173\u4e2d\u7684\u8fc7\u6ee4\u5668<strong>\u4e0d\u7ecf\u8fc7\u53cd\u8f6c<\/strong>\uff0c\u800c\u662f\u76f4\u63a5\u6ed1\u8fc7\u51fd\u6570 f\uff0cf \u4e0e g \u4e4b\u95f4\u7684\u4ea4\u53c9\u533a\u57df\u5373\u662f\u4e92\u76f8\u5173\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-160-1024x556.png\" alt=\"\" class=\"wp-image-5991\" width=\"326\" height=\"177\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-160-1024x556.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-160-300x163.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-160-768x417.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-160-830x450.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-160-230x125.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-160-350x190.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-160-480x260.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-160.png 1386w\" sizes=\"(max-width: 326px) 100vw, 326px\" \/><\/figure><\/div>\n\n\n\n<p>\u4e0b\u56fe\u5c55\u793a\u4e86\u5377\u79ef\u4e0e\u4e92\u76f8\u5173\u8fd0\u7b97\u8fc7\u7a0b\uff0c\u76f8\u4ea4\u533a\u57df\u7684\u9762\u79ef\u53d8\u5316\u7684\u5dee\u5f02\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161-1024x716.png\" alt=\"\" class=\"wp-image-5992\" width=\"354\" height=\"247\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161-1024x716.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161-300x210.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161-768x537.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161-1536x1074.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161-830x580.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161-230x161.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161-350x245.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161-480x336.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-161.png 1636w\" sizes=\"(max-width: 354px) 100vw, 354px\" \/><\/figure><\/div>\n\n\n\n<p>\u5728\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u4e2d\uff0c\u5377\u79ef\u4e2d\u7684\u8fc7\u6ee4\u5668\u4e0d\u7ecf\u8fc7\u53cd\u8f6c\u3002\u4e25\u683c\u6765\u8bf4\uff0c\u8fd9\u662f\u79bb\u6563\u5f62\u5f0f\u7684\u4e92\u76f8\u5173\u8fd0\u7b97\uff0c<strong>\u672c\u8d28\u4e0a\u662f\u6267\u884c\u9010\u5143\u7d20\u4e58\u6cd5\u548c\u6c42\u548c<\/strong>\u3002\u4f46\u4e24\u8005\u7684\u6548\u679c\u662f\u4e00\u81f4\uff0c\u56e0\u4e3a\u8fc7\u6ee4\u5668\u7684\u6743\u91cd\u53c2\u6570\u662f\u5728\u8bad\u7ec3\u9636\u6bb5\u5b66\u4e60\u5230\u7684\uff0c\u7ecf\u8fc7\u8bad\u7ec3\u540e\uff0c\u5b66\u4e60\u5f97\u5230\u7684\u8fc7\u6ee4\u5668\u770b\u8d77\u6765\u5c31\u4f1a\u50cf\u662f\u53cd\u8f6c\u540e\u7684\u51fd\u6570\u3002<\/p>\n\n\n\n<p><strong>2.2 \u5377\u79ef\u8fd0\u7b97\u7684\u4f5c\u7528<\/strong><\/p>\n\n\n\n<p>CNN\u901a\u8fc7\u8bbe\u8ba1\u7684\u5377\u79ef\u6838\uff08convolution filter\uff0c\u4e5f\u79f0\u4e3akernel\uff09\u4e0e\u56fe\u7247\u505a\u5377\u79ef\u8fd0\u7b97\uff08\u5e73\u79fb\u5377\u79ef\u6838\u53bb\u9010\u6b65\u505a\u4e58\u79ef\u5e76\u6c42\u548c\uff09\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162-1024x582.png\" alt=\"\" class=\"wp-image-5994\" width=\"487\" height=\"276\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162-1024x582.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162-300x170.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162-768x436.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162-1536x872.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162-830x471.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162-230x131.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162-350x199.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162-480x273.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-162.png 1574w\" sizes=\"(max-width: 487px) 100vw, 487px\" \/><\/figure><\/div>\n\n\n\n<p>\u5982\u4e0b\u793a\u4f8b\u8bbe\u8ba1\u4e00\u4e2a\uff08\u7279\u5b9a\u53c2\u6570\uff09\u76843\u00d73\u7684\u5377\u79ef\u6838\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-163.png\" alt=\"\" class=\"wp-image-5995\" width=\"206\" height=\"188\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-163.png 566w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-163-300x275.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-163-230x210.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-163-350x320.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-163-480x439.png 480w\" sizes=\"(max-width: 206px) 100vw, 206px\" \/><\/figure><\/div>\n\n\n\n<p>\u8ba9\u5b83\u53bb\u8ddf\u56fe\u7247\u505a\u5377\u79ef\uff0c\u5377\u79ef\u7684\u5177\u4f53\u8fc7\u7a0b\u662f\uff1a<\/p>\n\n\n\n<ul><li>\u7528\u8fd9\u4e2a\u5377\u79ef\u6838\u53bb\u8986\u76d6\u539f\u59cb\u56fe\u7247\uff1b<\/li><li>\u8986\u76d6\u4e00\u5757\u8ddf\u5377\u79ef\u6838\u4e00\u6837\u5927\u7684\u533a\u57df\u4e4b\u540e\uff0c\u5bf9\u5e94\u5143\u7d20\u76f8\u4e58\uff0c\u7136\u540e\u6c42\u548c\uff1b<\/li><li>\u8ba1\u7b97\u4e00\u4e2a\u533a\u57df\u4e4b\u540e\uff0c\u5c31\u5411\u5176\u4ed6\u533a\u57df\u632a\u52a8\uff08\u5047\u8bbe\u6b65\u957f\u662f1\uff09\uff0c\u7ee7\u7eed\u8ba1\u7b97\uff1b<\/li><li>\u76f4\u5230\u628a\u539f\u56fe\u7247\u7684\u6bcf\u4e00\u4e2a\u89d2\u843d\u90fd\u8986\u76d6\u5230\u4e3a\u6b62\uff1b<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164-1024x549.png\" alt=\"\" class=\"wp-image-5996\" width=\"484\" height=\"259\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164-1024x549.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164-300x161.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164-768x412.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164-1536x824.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164-830x445.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164-230x123.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164-350x188.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164-480x258.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-164.png 1558w\" sizes=\"(max-width: 484px) 100vw, 484px\" \/><\/figure><\/div>\n\n\n\n<p>\u53ef\u4ee5\u53d1\u73b0\uff0c\u901a\u8fc7\u7279\u5b9a\u7684filter\uff0c\u8ba9\u5b83\u53bb\u8ddf\u56fe\u7247\u505a\u5377\u79ef\uff0c\u5c31\u53ef\u4ee5\u63d0\u53d6\u51fa\u56fe\u7247\u4e2d\u7684\u67d0\u4e9b\u7279\u5f81\uff0c\u6bd4\u5982\u8fb9\u754c\u7279\u5f81\u3002<\/p>\n\n\n\n<p>\u8fdb\u4e00\u6b65\u7684\uff0c\u6211\u4eec\u53ef\u4ee5\u501f\u52a9\u5e9e\u5927\u7684\u6570\u636e\uff0c\u8db3\u591f\u6df1\u7684\u795e\u7ecf\u7f51\u7edc\uff0c\u4f7f\u7528\u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u8ba9\u673a\u5668\u53bb\u81ea\u52a8\u5b66\u4e60\u8fd9\u4e9b\u5377\u79ef\u6838\u53c2\u6570\uff0c\u4e0d\u540c\u53c2\u6570\u5377\u79ef\u6838\u63d0\u53d6\u7279\u5f81\u4e5f\u662f\u4e0d\u4e00\u6837\u7684\uff0c\u5c31\u80fd\u591f\u63d0\u53d6\u51fa\u5c40\u90e8\u7684\u200b\u3001\u66f4\u6df1\u5c42\u6b21\u548c\u66f4\u5168\u5c40\u7684\u7279\u5f81\u4ee5\u5e94\u7528\u4e8e\u51b3\u7b56\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165-1024x485.png\" alt=\"\" class=\"wp-image-5997\" width=\"461\" height=\"218\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165-1024x485.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165-300x142.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165-768x364.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165-1536x727.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165-830x393.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165-230x109.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165-350x166.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165-480x227.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-165.png 1618w\" sizes=\"(max-width: 461px) 100vw, 461px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u5377\u79ef\u8fd0\u7b97\u7684\u672c\u8d28\u6027\u603b\u7ed3\uff1a\u8fc7\u6ee4\u5668(g)\u5bf9\u56fe\u7247(f)\u6267\u884c\u9010\u6b65\u7684\u4e58\u6cd5\u5e76\u6c42\u548c\uff0c\u4ee5\u63d0\u53d6\u7279\u5f81\u7684\u8fc7\u7a0b<\/strong>\u3002\u5377\u79ef\u8fc7\u7a0b\u53ef\u89c6\u5316\u53ef\u8bbf\u95ee\uff1a<a href=\"https:\/\/poloclub.github.io\/cnn-explainer\/\">https:\/\/poloclub.github.io\/cnn-explainer\/<\/a> \u6216 <a href=\"https:\/\/github.com\/vdumoulin\/conv_arithmetic\">https:\/\/github.com\/vdumoulin\/conv_arithmetic<\/a><\/p>\n\n\n\n<p><strong>\u4e09\u3001\u5377\u79ef\u795e\u7ecf\u7f51\u7edc<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u901a\u5e38\u75313\u4e2a\u90e8\u5206\u6784\u6210\uff1a\u5377\u79ef\u5c42\uff0c\u6c60\u5316\u5c42\uff0c\u5168\u8fde\u63a5\u5c42\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u5377\u79ef\u5c42\u8d1f\u8d23\u63d0\u53d6\u56fe\u50cf\u4e2d\u7684\u5c40\u90e8\u53ca\u5168\u5c40\u7279\u5f81\uff1b\u6c60\u5316\u5c42\u7528\u6765\u5927\u5e45\u964d\u4f4e\u53c2\u6570\u91cf\u7ea7(\u964d\u7ef4)\uff1b\u5168\u8fde\u63a5\u5c42\u7528\u4e8e\u5904\u7406\u201c\u538b\u7f29\u7684\u56fe\u50cf\u4fe1\u606f\u201d\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166-1024x336.png\" alt=\"\" class=\"wp-image-5998\" width=\"527\" height=\"172\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166-1024x336.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166-300x99.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166-768x252.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166-1536x504.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166-830x273.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166-230x76.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166-350x115.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166-480x158.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-166.png 1638w\" sizes=\"(max-width: 527px) 100vw, 527px\" \/><\/figure><\/div>\n\n\n\n<p><strong>3.1 \u5377\u79ef\u5c42\uff08CONV\uff09<\/strong><\/p>\n\n\n\n<p><strong>3.1.1 \u5377\u79ef\u5c42\u57fa\u672c\u5c5e\u6027<\/strong><\/p>\n\n\n\n<p>\u5377\u79ef\u5c42\u4e3b\u8981\u529f\u80fd\u662f\u52a8\u6001\u5730\u63d0\u53d6\u56fe\u50cf\u7279\u5f81\uff0c\u7531\u6ee4\u6ce2\u5668filters\u548c\u6fc0\u6d3b\u51fd\u6570\u6784\u6210\u3002\u4e00\u822c\u8981\u8bbe\u7f6e\u7684\u8d85\u53c2\u6570\u5305\u62ecfilters\u7684\u6570\u91cf\u3001\u5927\u5c0f\u3001\u6b65\u957f\uff0c\u6fc0\u6d3b\u51fd\u6570\u7c7b\u578b\uff0c\u4ee5\u53capadding\u662f\u201cvalid\u201d\u8fd8\u662f\u201csame\u201d\u3002<\/p>\n\n\n\n<ul><li>\u5377\u79ef\u6838\u5927\u5c0f\uff08Kernel\uff09\uff1a\u76f4\u89c2\u7406\u89e3\u5c31\u662f\u4e00\u4e2a\u6ee4\u6ce2\u77e9\u9635\uff0c\u666e\u904d\u4f7f\u7528\u7684\u5377\u79ef\u6838\u5927\u5c0f\u4e3a3\u00d73\u30015\u00d75\u7b49\u3002\u5728\u8fbe\u5230\u76f8\u540c\u611f\u53d7\u91ce\u7684\u60c5\u51b5\u4e0b\uff0c\u5377\u79ef\u6838\u8d8a\u5c0f\uff0c\u6240\u9700\u8981\u7684\u53c2\u6570\u548c\u8ba1\u7b97\u91cf\u8d8a\u5c0f\u3002\u5377\u79ef\u6838\u5927\u5c0f\u5fc5\u987b\u5927\u4e8e1\u624d\u6709\u63d0\u5347\u611f\u53d7\u91ce\u7684\u4f5c\u7528\uff0c\u800c\u5927\u5c0f\u4e3a\u5076\u6570\u7684\u5377\u79ef\u6838\u5373\u4f7f\u5bf9\u79f0\u5730\u52a0padding\u4e5f\u4e0d\u80fd\u4fdd\u8bc1\u8f93\u5165feature map\u5c3a\u5bf8\u548c\u8f93\u51fafeature map\u5c3a\u5bf8\u4e0d\u53d8\uff08\u5047\u8bben\u4e3a\u8f93\u5165\u5bbd\u5ea6\uff0cd\u4e3apadding\u4e2a\u6570\uff0cm\u4e3a\u5377\u79ef\u6838\u5bbd\u5ea6\uff0c\u5728\u6b65\u957f\u4e3a1\u7684\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u4fdd\u6301\u8f93\u51fa\u7684\u5bbd\u5ea6\u4ecd\u4e3an\uff0c\u516c\u5f0f\uff0cn+2d-m+1=n\uff0c\u5f97\u51fam=2d+1\uff0c\u9700\u8981\u662f\u5947\u6570\uff09\uff0c\u6240\u4ee5\u4e00\u822c\u90fd\u75283\u4f5c\u4e3a\u5377\u79ef\u6838\u5927\u5c0f\u3002<\/li><li>\u5377\u79ef\u6838\u6570\u76ee\uff1a\u4e3b\u8981\u8fd8\u662f\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8c03\u6574\uff0c \u4e00\u822c\u90fd\u662f\u53d62\u7684\u6574\u6570\u6b21\u65b9\uff0c\u6570\u76ee\u8d8a\u591a\u8ba1\u7b97\u91cf\u8d8a\u5927\uff0c\u76f8\u5e94\u6a21\u578b\u62df\u5408\u80fd\u529b\u8d8a\u5f3a\u3002<\/li><li>\u6b65\u957f\uff08Stride\uff09\uff1a\u5377\u79ef\u6838\u904d\u5386\u7279\u5f81\u56fe\u65f6\u6bcf\u6b65\u79fb\u52a8\u7684\u50cf\u7d20\uff0c\u5982\u6b65\u957f\u4e3a1\u5219\u6bcf\u6b21\u79fb\u52a81\u4e2a\u50cf\u7d20\uff0c\u6b65\u957f\u4e3a2\u5219\u6bcf\u6b21\u79fb\u52a82\u4e2a\u50cf\u7d20\uff08\u5373\u8df3\u8fc71\u4e2a\u50cf\u7d20\uff09\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002\u6b65\u957f\u8d8a\u5c0f\uff0c\u63d0\u53d6\u7684\u7279\u5f81\u4f1a\u66f4\u7cbe\u7ec6\u3002<\/li><li>\u586b\u5145\uff08Padding\uff09\uff1a\u5904\u7406\u7279\u5f81\u56fe\u8fb9\u754c\u7684\u65b9\u5f0f\uff0c\u4e00\u822c\u6709\u4e24\u79cd\uff0c\u4e00\u79cd\u662f\u201cvalid\u201d\uff0c\u5bf9\u8fb9\u754c\u5916\u5b8c\u5168\u4e0d\u586b\u5145\uff0c\u53ea\u5bf9\u8f93\u5165\u50cf\u7d20\u6267\u884c\u5377\u79ef\u64cd\u4f5c\uff0c\u8fd9\u6837\u4f1a\u4f7f\u8f93\u51fa\u7279\u5f81\u56fe\u50cf\u5c3a\u5bf8\u53d8\u5f97\u66f4\u5c0f\uff0c\u4e14\u8fb9\u7f18\u4fe1\u606f\u5bb9\u6613\u4e22\u5931\uff1b\u53e6\u4e00\u79cd\u662f\u8fd8\u662f\u201csame\u201d\uff0c\u5bf9\u8fb9\u754c\u5916\u8fdb\u884c\u586b\u5145\uff08\u4e00\u822c\u586b\u5145\u4e3a0\uff09\uff0c\u518d\u6267\u884c\u5377\u79ef\u64cd\u4f5c\uff0c\u8fd9\u6837\u53ef\u4f7f\u8f93\u51fa\u7279\u5f81\u56fe\u7684\u5c3a\u5bf8\u4e0e\u8f93\u5165\u7279\u5f81\u56fe\u7684\u5c3a\u5bf8\u4e00\u81f4\uff0c\u8fb9\u7f18\u4fe1\u606f\u4e5f\u53ef\u4ee5\u591a\u6b21\u8ba1\u7b97\u3002<\/li><li>\u901a\u9053\uff08Channel\uff09\uff1a\u5377\u79ef\u5c42\u7684\u901a\u9053\u6570\uff08\u5c42\u6570\uff09\u3002\u5982\u5f69\u8272\u56fe\u50cf\u4e00\u822c\u90fd\u662fRGB\u4e09\u4e2a\u901a\u9053\uff08channel\uff09\u3002<\/li><li>\u6fc0\u6d3b\u51fd\u6570\uff1a\u4e3b\u8981\u8fd8\u662f\u6839\u636e\u5b9e\u9645\u9a8c\u8bc1\uff0c\u901a\u5e38\u9009\u62e9Relu\u3002<\/li><\/ul>\n\n\n\n<p>\u53e6\u5916\u7684\uff0c\u5377\u79ef\u7684\u7c7b\u578b\u9664\u4e86\u6807\u51c6\u5377\u79ef\uff0c\u8fd8\u6f14\u53d8\u51fa\u4e86\u53cd\u5377\u79ef\u3001\u53ef\u5206\u79bb\u5377\u79ef\u3001\u5206\u7ec4\u5377\u79ef\u7b49\u5404\u79cd\u7c7b\u578b\uff0c\u53ef\u4ee5\u81ea\u884c\u9a8c\u8bc1\u3002<\/p>\n\n\n\n<p><strong>3.1.2 \u5377\u79ef\u5c42\u7684\u7279\u70b9<\/strong><\/p>\n\n\n\n<p>\u901a\u8fc7\u5377\u79ef\u8fd0\u7b97\u7684\u4ecb\u7ecd\uff0c\u53ef\u4ee5\u53d1\u73b0\u5377\u79ef\u5c42\u6709\u4e24\u4e2a\u4e3b\u8981\u7279\u70b9\uff1a\u5c40\u90e8\u8fde\u63a5\uff08\u7a00\u758f\u8fde\u63a5\uff09\u548c\u6743\u503c\u5171\u4eab\u3002<\/p>\n\n\n\n<ul><li>\u5c40\u90e8\u8fde\u63a5\uff0c\u5c31\u662f\u5377\u79ef\u5c42\u7684\u8282\u70b9\u4ec5\u4ec5\u548c\u5176\u524d\u4e00\u5c42\u7684\u90e8\u5206\u8282\u70b9\u76f8\u8fde\u63a5\uff0c\u53ea\u7528\u6765\u5b66\u4e60\u5c40\u90e8\u533a\u57df\u7279\u5f81\u3002\uff08\u5c40\u90e8\u8fde\u63a5\u611f\u77e5\u7ed3\u6784\u7684\u7406\u5ff5\u6765\u6e90\u4e8e\u52a8\u7269\u89c6\u89c9\u7684\u76ae\u5c42\u7ed3\u6784\uff0c\u5176\u6307\u7684\u662f\u52a8\u7269\u89c6\u89c9\u7684\u795e\u7ecf\u5143\u5728\u611f\u77e5\u5916\u754c\u7269\u4f53\u7684\u8fc7\u7a0b\u4e2d\u8d77\u4f5c\u7528\u7684\u53ea\u6709\u4e00\u90e8\u5206\u795e\u7ecf\u5143\u3002\uff09<\/li><li>\u6743\u503c\u5171\u4eab\uff0c\u540c\u4e00\u5377\u79ef\u6838\u4f1a\u548c\u8f93\u5165\u56fe\u7247\u7684\u4e0d\u540c\u533a\u57df\u4f5c\u5377\u79ef\uff0c\u6765\u68c0\u6d4b\u76f8\u540c\u7684\u7279\u5f81\uff0c\u5377\u79ef\u6838\u4e0a\u9762\u7684\u6743\u91cd\u53c2\u6570\u662f\u7a7a\u95f4\u5171\u4eab\u7684\uff0c\u4f7f\u5f97\u53c2\u6570\u91cf\u5927\u5927\u51cf\u5c11\u3002<br><a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/camo.githubusercontent.com\/4dca65ae8fc6ad42043ba0cb1ea149fbbbd9de1175291396f707951befac798f\/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f31313638323237312d636164343238373433373330356636302e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430\"><\/a><\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-167-1024x464.png\" alt=\"\" class=\"wp-image-5999\" width=\"506\" height=\"229\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-167-1024x464.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-167-300x136.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-167-768x348.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-167-830x376.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-167-230x104.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-167-350x159.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-167-480x218.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-167.png 1496w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/figure><\/div>\n\n\n\n<p>\u7531\u4e8e\u5c40\u90e8\u8fde\u63a5\uff08\u7a00\u758f\u8fde\u63a5\uff09\u548c\u6743\u503c\u5171\u4eab\u7684\u7279\u70b9\uff0c\u4f7f\u5f97CNN\u5177\u6709<strong>\u4eff\u5c04\u7684\u4e0d\u53d8\u6027(\u5e73\u79fb\u3001\u7f29\u653e\u7b49\u7ebf\u6027\u53d8\u6362)<\/strong><\/p>\n\n\n\n<p><strong>3.2 \u6c60\u5316\u5c42\uff08Pooling\uff09<\/strong><\/p>\n\n\n\n<p>\u6c60\u5316\u5c42\u53ef\u5bf9\u63d0\u53d6\u5230\u7684\u7279\u5f81\u4fe1\u606f\u8fdb\u884c\u964d\u7ef4\uff0c\u4e00\u65b9\u9762\u4f7f\u7279\u5f81\u56fe\u53d8\u5c0f\uff0c\u7b80\u5316\u7f51\u7edc\u8ba1\u7b97\u590d\u6742\u5ea6\uff1b\u53e6\u4e00\u65b9\u9762\u8fdb\u884c\u7279\u5f81\u538b\u7f29\uff0c\u63d0\u53d6\u4e3b\u8981\u7279\u5f81\uff0c\u589e\u52a0\u5e73\u79fb\u4e0d\u53d8\u6027\uff0c\u51cf\u5c11\u8fc7\u62df\u5408\u98ce\u9669\u3002 \u4f46\u5176\u5b9e\u6c60\u5316\u66f4\u591a\u7a0b\u5ea6\u4e0a\u662f\u4e00\u79cd\u8ba1\u7b97\u6027\u80fd\u7684\u4e00\u4e2a\u59a5\u534f\uff0c\u5f3a\u786c\u5730\u538b\u7f29\u7279\u5f81\u7684\u540c\u65f6\u4e5f\u635f\u5931\u4e86\u4e00\u90e8\u5206\u4fe1\u606f\uff0c\u6240\u4ee5\u73b0\u5728\u7684\u7f51\u7edc\u6bd4\u8f83\u5c11\u7528\u6c60\u5316\u5c42\u6216\u8005\u4f7f\u7528\u4f18\u5316\u540e\u7684\u5982SoftPool\u3002<\/p>\n\n\n\n<p>\u6c60\u5316\u5c42\u8bbe\u5b9a\u7684\u8d85\u53c2\u6570\uff0c\u5305\u62ec\u6c60\u5316\u5c42\u7684\u7c7b\u578b\u662fMax\u8fd8\u662fAverage\uff08Average\u5bf9\u80cc\u666f\u4fdd\u7559\u66f4\u597d\uff0cMax\u5bf9\u7eb9\u7406\u63d0\u53d6\u66f4\u597d\uff09\uff0c\u7a97\u53e3\u5927\u5c0f\u4ee5\u53ca\u6b65\u957f\u7b49\u3002\u5982\u4e0b\u7684MaxPooling\uff0c\u91c7\u7528\u4e86\u4e00\u4e2a2\u00d72\u7684\u7a97\u53e3\uff0c\u5e76\u53d6\u6b65\u957fstride=2\uff0c\u63d0\u53d6\u51fa\u5404\u4e2a\u7a97\u53e3\u7684max\u503c\u7279\u5f81\uff08AveragePooling\u5c31\u662f\u5e73\u5747\u503c\uff09\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168-1024x411.png\" alt=\"\" class=\"wp-image-6000\" width=\"443\" height=\"177\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168-1024x411.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168-300x120.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168-768x308.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168-1536x616.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168-830x333.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168-230x92.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168-350x140.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168-480x192.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-168.png 1596w\" sizes=\"(max-width: 443px) 100vw, 443px\" \/><\/figure><\/div>\n\n\n\n<p><strong>3.3 \u5168\u8fde\u63a5\u5c42\uff08FC\uff09<\/strong><\/p>\n\n\n\n<p>\u5728\u7ecf\u8fc7\u6570\u6b21\u5377\u79ef\u548c\u6c60\u5316\u4e4b\u540e\uff0c\u6211\u4eec\u6700\u540e\u4f1a\u5148\u5c06\u591a\u7ef4\u7684\u56fe\u50cf\u6570\u636e\u8fdb\u884c\u538b\u7f29\u201c\u6241\u5e73\u5316\u201d\uff0c \u4e5f\u5c31\u662f\u628a (height,width,channel) \u7684\u6570\u636e\u538b\u7f29\u6210\u957f\u5ea6\u4e3a height \u00d7 width \u00d7 channel \u7684\u4e00\u7ef4\u6570\u7ec4\uff0c\u7136\u540e\u518d\u4e0e\u5168\u8fde\u63a5\u5c42\u8fde\u63a5\uff08\u8fd9\u4e5f\u5c31\u662f\u4f20\u7edf\u5168\u8fde\u63a5\u7f51\u7edc\u5c42\uff0c\u6bcf\u4e00\u4e2a\u5355\u5143\u90fd\u548c\u524d\u4e00\u5c42\u7684\u6bcf\u4e00\u4e2a\u5355\u5143\u76f8\u8fde\u63a5\uff0c\u9700\u8981\u8bbe\u5b9a\u7684\u8d85\u53c2\u6570\u4e3b\u8981\u662f\u795e\u7ecf\u5143\u7684\u6570\u91cf\uff0c\u4ee5\u53ca\u6fc0\u6d3b\u51fd\u6570\u7c7b\u578b\uff09\uff0c\u901a\u8fc7\u5168\u8fde\u63a5\u5c42\u5904\u7406\u201c\u538b\u7f29\u7684\u56fe\u50cf\u4fe1\u606f\u201d\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169-1024x565.png\" alt=\"\" class=\"wp-image-6001\" width=\"521\" height=\"287\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169-1024x565.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169-300x166.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169-768x424.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169-1536x848.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169-830x458.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169-230x127.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169-350x193.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169-480x265.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-169.png 1576w\" sizes=\"(max-width: 521px) 100vw, 521px\" \/><\/figure><\/div>\n\n\n\n<p><strong>3.4 \u793a\u4f8b\uff1a\u7ecf\u5178CNN\u7684\u6784\u5efa\uff08Lenet-5\uff09<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170-1024x341.png\" alt=\"\" class=\"wp-image-6002\" width=\"618\" height=\"205\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170-1024x341.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170-300x100.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170-768x256.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170-1536x511.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170-830x276.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170-230x77.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170-350x117.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170-480x160.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-170.png 1640w\" sizes=\"(max-width: 618px) 100vw, 618px\" \/><\/figure><\/div>\n\n\n\n<p>LeNet-5\u7531Yann LeCun\u8bbe\u8ba1\u4e8e 1998\u5e74\uff0c\u662f\u6700\u65e9\u7684\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u4e4b\u4e00\u3002\u5b83\u662f\u9488\u5bf9\u7070\u5ea6\u56fe\u8fdb\u884c\u8bad\u7ec3\u7684\uff0c\u8f93\u5165\u56fe\u50cf\u5927\u5c0f\u4e3a32<em>32<\/em>1\uff0c\u4e0d\u5305\u542b\u8f93\u5165\u5c42\u7684\u60c5\u51b5\u4e0b\u5171\u67097\u5c42\u3002\u4e0b\u9762\u9010\u5c42\u4ecb\u7ecdLeNet-5\u7684\u7ed3\u6784\uff1a<\/p>\n\n\n\n<ul><li>1\u3001C1-\u5377\u79ef\u5c42<\/li><\/ul>\n\n\n\n<p>\u7b2c\u4e00\u5c42\u662f\u5377\u79ef\u5c42\uff0c\u7528\u4e8e\u8fc7\u6ee4\u566a\u97f3\uff0c\u63d0\u53d6\u5173\u952e\u7279\u5f81\u3002\u4f7f\u75285 * 5\u5927\u5c0f\u7684\u8fc7\u6ee4\u56686\u4e2a\uff0c\u6b65\u957fs = 1\uff0cpadding = 0\u3002<\/p>\n\n\n\n<ul><li>2\u3001S2-\u91c7\u6837\u5c42\uff08\u5e73\u5747\u6c60\u5316\u5c42\uff09<\/li><\/ul>\n\n\n\n<p>\u7b2c\u4e8c\u5c42\u662f\u5e73\u5747\u6c60\u5316\u5c42\uff0c\u5229\u7528\u4e86\u56fe\u50cf\u5c40\u90e8\u76f8\u5173\u6027\u7684\u539f\u7406\uff0c\u5bf9\u56fe\u50cf\u8fdb\u884c\u5b50\u62bd\u6837\uff0c\u53ef\u4ee5\u51cf\u5c11\u6570\u636e\u5904\u7406\u91cf\u540c\u65f6\u4fdd\u7559\u6709\u7528\u4fe1\u606f\uff0c\u964d\u4f4e\u7f51\u7edc\u8bad\u7ec3\u53c2\u6570\u53ca\u6a21\u578b\u7684\u8fc7\u62df\u5408\u7a0b\u5ea6\u3002\u4f7f\u75282 * 2\u5927\u5c0f\u7684\u8fc7\u6ee4\u5668\uff0c\u6b65\u957fs = 2\uff0cpadding = 0\u3002<strong>\u6c60\u5316\u5c42\u53ea\u6709\u4e00\u7ec4\u8d85\u53c2\u6570pool_size \u548c \u6b65\u957fstrides\uff0c\u6ca1\u6709\u9700\u8981\u5b66\u4e60\u7684\u6a21\u578b\u53c2\u6570<\/strong>\u3002<\/p>\n\n\n\n<ul><li>3\u3001C3-\u5377\u79ef\u5c42<\/li><\/ul>\n\n\n\n<p>\u7b2c\u4e09\u5c42\u4f7f\u75285 * 5\u5927\u5c0f\u7684\u8fc7\u6ee4\u566816\u4e2a\uff0c\u6b65\u957fs = 1\uff0cpadding = 0\u3002<\/p>\n\n\n\n<ul><li>4\u3001S4-\u4e0b\u91c7\u6837\u5c42\uff08\u5e73\u5747\u6c60\u5316\u5c42\uff09<\/li><\/ul>\n\n\n\n<p>\u7b2c\u56db\u5c42\u4f7f\u75282 * 2\u5927\u5c0f\u7684\u8fc7\u6ee4\u5668\uff0c\u6b65\u957fs = 2\uff0cpadding = 0\u3002\u6ca1\u6709\u9700\u8981\u5b66\u4e60\u7684\u53c2\u6570\u3002<\/p>\n\n\n\n<ul><li>5\u3001C5-\u5377\u79ef\u5c42<\/li><\/ul>\n\n\n\n<p>\u7b2c\u4e94\u5c42\u662f\u5377\u79ef\u5c42\uff0c\u6709120\u4e2a5 * 5 \u7684\u5355\u5143\uff0c\u6b65\u957fs = 1\uff0cpadding = 0\u3002<\/p>\n\n\n\n<ul><li>6\u3001F6-\u5168\u8fde\u63a5\u5c42<\/li><\/ul>\n\n\n\n<p>\u670984\u4e2a\u5355\u5143\u3002\u6bcf\u4e2a\u5355\u5143\u4e0eF5\u5c42\u7684\u5168\u90e8120\u4e2a\u5355\u5143\u4e4b\u95f4\u8fdb\u884c\u5168\u8fde\u63a5\u3002<\/p>\n\n\n\n<ul><li>7\u3001Output-\u8f93\u51fa\u5c42<\/li><\/ul>\n\n\n\n<p>Output\u5c42\u4e5f\u662f\u5168\u8fde\u63a5\u5c42\uff0c\u91c7\u7528RBF\u7f51\u7edc\u7684\u8fde\u63a5\u65b9\u5f0f\uff08\u73b0\u5728\u4e3b\u8981\u7531Softmax\u53d6\u4ee3\uff0c\u5982\u4e0b\u793a\u4f8b\u4ee3\u7801\uff09\uff0c\u5171\u670910\u4e2a\u8282\u70b9\uff0c\u5206\u522b\u4ee3\u8868\u6570\u5b570\u52309\uff08\u56e0\u4e3aLenet\u7528\u4e8e\u8f93\u51fa\u8bc6\u522b\u6570\u5b57\u7684\uff09\uff0c\u5982\u679c\u8282\u70b9i\u7684\u8f93\u51fa\u503c\u4e3a0\uff0c\u5219\u7f51\u7edc\u8bc6\u522b\u7684\u7ed3\u679c\u662f\u6570\u5b57i\u3002<\/p>\n\n\n\n<p>\u5982\u4e0bKeras\u590d\u73b0Lenet-5\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171-1024x734.png\" alt=\"\" class=\"wp-image-6003\" width=\"484\" height=\"347\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171-1024x734.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171-300x215.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171-768x550.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171-1536x1101.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171-830x595.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171-230x165.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171-350x251.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171-480x344.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-171.png 1552w\" sizes=\"(max-width: 484px) 100vw, 484px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from keras.models import Sequential\nfrom keras import layers \n\nle_model = keras.Sequential()\nle_model.add(layers.Conv2D(6, kernel_size=(5, 5), strides=(1, 1), activation='tanh', input_shape=(32,32,1), padding=\"valid\"))\nle_model.add(layers.AveragePooling2D(pool_size=(2, 2), strides=(2, 2), padding='valid'))\nle_model.add(layers.Conv2D(16, kernel_size=(5, 5), strides=(1, 1), activation='tanh', padding='valid'))\nle_model.add(layers.AveragePooling2D(pool_size=(2, 2), strides=(2, 2), padding='valid'))\nle_model.add(layers.Conv2D(120, kernel_size=(5, 5), strides=(1, 1), activation='tanh', padding='valid'))\nle_model.add(layers.Flatten())\nle_model.add(layers.Dense(84, activation='tanh'))\nle_model.add(layers.Dense(10, activation='softmax'))<\/pre>\n\n\n\n<p><strong>\u56db\u3001keras\u5b9e\u6218CNN\u56fe\u50cf\u5206\u7c7b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u4ee5keras\u7ecf\u5178\u7684CIFAR10\u56fe\u50cf\u6570\u636e\u96c6\u7684\u5206\u7c7b\u4e3a\u4f8b\uff0c\u4ee3\u7801\uff1ahttps:\/\/github.com\/aialgorithm\/Blog<\/p>\n\n\n\n<ul><li>\u8bad\u7ec3\u96c6\u8f93\u5165\u6570\u636e\u7684\u6837\u5f0f\u4e3a\uff1a(50000, 32, 32, 3)\u5bf9\u5e94 (\u6837\u672c\u6570, \u56fe\u50cf\u9ad8\u5ea6\uff0c \u5bbd\u5ea6, RGB\u5f69\u8272\u56fe\u50cf\u901a\u9053\u4e3a3)<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from keras.datasets import cifar10\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Activation, Flatten\nfrom keras.layers import Conv2D, MaxPooling2D\nimport keras\nimport os\n\n# \u6570\u636e\uff0c\u5207\u5206\u4e3a\u8bad\u7ec3\u548c\u6d4b\u8bd5\u96c6\n(x_train, y_train), (x_test, y_test) = cifar10.load_data()\nprint('x_train shape:', x_train.shape)\nprint(x_train.shape[0], 'train samples')\nprint(x_test.shape[0], 'test samples')<\/pre>\n\n\n\n<ul><li>\u5c55\u793a\u6570\u636e\u96c6\uff0c\u5171\u670910\u7c7b\u56fe\u50cf\uff1a<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172-1024x578.png\" alt=\"\" class=\"wp-image-6005\" width=\"547\" height=\"309\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172-1024x578.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172-300x169.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172-768x434.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172-1536x868.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172-830x469.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172-230x130.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172-350x198.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172-480x271.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-172.png 1572w\" sizes=\"(max-width: 547px) 100vw, 547px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u5c55\u793a\u6570\u636e\u96c6\nimport matplotlib.pyplot as plt\nclass_names = ['airplane', 'automobile', 'bird', 'cat', 'deer',\n               'dog', 'frog', 'horse', 'ship', 'truck']\n\nplt.figure(figsize=(10,10))\nfor i in range(25):\n    plt.subplot(5,5,i+1)\n    plt.xticks([])\n    plt.yticks([])\n    plt.grid(False)\n    plt.imshow(x_train[i])\n    # The CIFAR labels happen to be arrays, \n    # which is why you need the extra index\n    plt.xlabel(class_names[y_train[i][0]])\nplt.show()<\/pre>\n\n\n\n<ul><li>\u6570\u636e\u53ca\u6807\u7b7e\u9884\u5904\u7406\uff1a<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u5c06\u6807\u7b7e\u5411\u91cf\u8f6c\u6362\u4e3a\u4e8c\u503c\u77e9\u9635\u3002\nnum_classes = 10  #\u56fe\u50cf\u6570\u636e\u670910\u4e2a\u5b9e\u9645\u6807\u7b7e\u7c7b\u522b\ny_train = keras.utils.to_categorical(y_train, num_classes)\ny_test = keras.utils.to_categorical(y_test, num_classes)\n\nprint(y_train.shape, 'ytrain')\n\n# \u56fe\u50cf\u6570\u636e\u5f52\u4e00\u5316\nx_train = x_train.astype('float32')\nx_test = x_test.astype('float32')\nx_train \/= 255\nx_test \/= 255<\/pre>\n\n\n\n<ul><li>\u6784\u9020\u5377\u79ef\u795e\u7ecf\u7f51\u7edc: \u8f93\u5165\u5c42->\u591a\u7ec4\u5377\u79ef\u53ca\u6c60\u5316\u5c42->\u5168\u8fde\u63a5\u7f51\u7edc->softmax\u591a\u5206\u7c7b\u8f93\u51fa\u5c42\u3002\uff08\u5982\u4e0b\u56fe\u90e8\u5206\u7f51\u7edc\u7ed3\u6784\uff09<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-173-1024x986.png\" alt=\"\" class=\"wp-image-6006\" width=\"523\" height=\"503\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-173-1024x986.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-173-300x289.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-173-768x740.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-173-830x799.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-173-230x222.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-173-350x337.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-173-480x462.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-173.png 1138w\" sizes=\"(max-width: 523px) 100vw, 523px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u6784\u9020\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\nmodel = Sequential()\n\n# \u56fe\u50cf\u8f93\u5165\u5f62\u72b6(32, 32, 3) \u5bf9\u5e94(image_height, image_width, color_channels) \nmodel.add(Conv2D(32, (3, 3), padding='same',\n                 input_shape=(32, 32, 3)))\nmodel.add(Activation('relu'))\nmodel.add(Conv2D(32, (3, 3)))\nmodel.add(Activation('relu'))\nmodel.add(MaxPooling2D(pool_size=(2, 2)))\nmodel.add(Dropout(0.25))\n\n# \u5377\u79ef\u3001\u6c60\u5316\u5c42\u8f93\u51fa\u90fd\u662f\u4e00\u4e2a\u4e09\u7ef4\u7684(height, width, channels)\n# \u8d8a\u6df1\u7684\u5c42\u4e2d\uff0c\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u90fd\u4f1a\u6536\u7f29\nmodel.add(Conv2D(64, (3, 3), padding='same'))\nmodel.add(Activation('relu'))\nmodel.add(Conv2D(64, (3, 3)))\nmodel.add(Activation('relu'))\nmodel.add(MaxPooling2D(pool_size=(2, 2)))\nmodel.add(Dropout(0.25))\n\n#  3 \u7ef4\u5c55\u5e73\u4e3a 1 \u7ef4 \uff0c\u8f93\u5165\u5168\u8fde\u63a5\u5c42\nmodel.add(Flatten())\nmodel.add(Dense(512))\nmodel.add(Activation('relu'))\nmodel.add(Dropout(0.5))\nmodel.add(Dense(num_classes))   # CIFAR\u6570\u636e\u6709 10 \u4e2a\u8f93\u51fa\u7c7b\uff0c\u4ee5softmax\u8f93\u51fa\u591a\u5206\u7c7b\nmodel.add(Activation('softmax')) <\/pre>\n\n\n\n<ul><li>\u6a21\u578b\u7f16\u8bd1\uff1a\u8bbe\u5b9aRMSprop \u4f18\u5316\u7b97\u6cd5\uff1b\u8bbe\u5b9a\u5206\u7c7b\u635f\u5931\u51fd\u6570.<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u521d\u59cb\u5316 RMSprop \u4f18\u5316\u5668\nopt = keras.optimizers.rmsprop(lr=0.001, decay=1e-6)\n\n# \u6a21\u578b\u7f16\u8bd1\uff1a\u8bbe\u5b9aRMSprop \u4f18\u5316\u7b97\u6cd5\uff1b\u8bbe\u5b9a\u5206\u7c7b\u635f\u5931\u51fd\u6570\uff1b\nmodel.compile(loss='categorical_crossentropy',\n              optimizer=opt,\n              metrics=['accuracy'])\n\n<\/pre>\n\n\n\n<ul><li>\u6a21\u578b\u8bad\u7ec3: \u7b80\u5355\u9a8c\u8bc15\u4e2aepochs<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">batch_size = 64\nepochs = 5  \n\nhistory = model.fit(x_train, y_train,\n              batch_size=batch_size,\n              epochs=epochs,\n              validation_data=(x_test, y_test),\n              shuffle=True)\n<\/pre>\n\n\n\n<ul><li>\u6a21\u578b\u8bc4\u4f30\uff1a\u6d4b\u8bd5\u96c6accuracy: 0.716\uff0c\u53ef\u89c1\u8bad\u7ec3\/\u6d4b\u8bd5\u96c6\u6574\u4f53\u7684\u51c6\u786e\u7387\u90fd\u4e0d\u592a\u9ad8\uff08\u6b20\u62df\u5408\uff09\uff0c\u53ef\u4ee5\u589e\u52a0epoch\u6570\u3001\u6a21\u578b\u8c03\u4f18\u9a8c\u8bc1\u6548\u679c\u3002<\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u9644\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u4f18\u5316\u65b9\u6cd5\uff08tricks\uff09\uff1a<br>\u8d85\u53c2\u6570\u4f18\u5316\uff1a\u53ef\u4ee5\u7528\u968f\u673a\u641c\u7d22\u3001\u8d1d\u53f6\u65af\u4f18\u5316\u3002\u63a8\u8350\u5206\u5e03\u5f0f\u8d85\u53c2\u6570\u8c03\u8bd5\u6846\u67b6Keras Tuner\u5305\u62ec\u4e86\u5e38\u7528\u7684\u4f18\u5316\u65b9\u6cd5\u3002<br>\u6570\u636e\u5c42\u9762\uff1a\u6570\u636e\u589e\u5f3a\u5e7f\u6cdb\u7528\u4e8e\u56fe\u50cf\u4efb\u52a1\uff0c\u6548\u679c\u63d0\u5347\u5927\u3002\u5e38\u7528\u6709\u56fe\u50cf\u6837\u672c\u53d8\u6362\u3001mixup\u7b49\u3002\u66f4\u591a\u4f18\u5316\u65b9\u6cd5\u5177\u4f53\u53ef\u89c1\uff1a<a href=\"https:\/\/arxiv.org\/abs\/1812.01187\">https:\/\/arxiv.org\/abs\/1812.01187<\/a><\/p><\/blockquote>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-174.png\" alt=\"\" class=\"wp-image-6007\" width=\"431\" height=\"280\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-174.png 684w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-174-300x195.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-174-230x149.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-174-350x227.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-174-480x312.png 480w\" sizes=\"(max-width: 431px) 100vw, 431px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u4fdd\u5b58\u6a21\u578b\u548c\u6743\u91cd\nnum_predictions = 20\nsave_dir = os.path.join(os.getcwd(), 'saved_models')\nmodel_name = 'keras_cifar10_trained_model.h5'\n\nif not os.path.isdir(save_dir):\n    os.makedirs(save_dir)\nmodel_path = os.path.join(save_dir, model_name)\nmodel.save(model_path)\nprint('Saved trained model at %s ' % model_path)\n\n# \u8bc4\u4f30\u8bad\u7ec3\u6a21\u578b\nscores = model.evaluate(x_test, y_test, verbose=1)\nprint('Test loss:', scores[0])\nprint('Test accuracy:', scores[1])\n\nplt.plot(history.history['accuracy'], label='accuracy')\nplt.plot(history.history['val_accuracy'], label = 'val_accuracy')\nplt.xlabel('Epoch')\nplt.ylabel('Accuracy')\nplt.ylim([0.5, 1])\nplt.legend(loc='lower right')\nplt.show()\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u7b80\u4ecb \u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08Convolutional Neural Networks, CNN\uff09\u662f\u4e00 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5986"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5986"}],"version-history":[{"count":4,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5986\/revisions"}],"predecessor-version":[{"id":6009,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5986\/revisions\/6009"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}