{"id":56711,"date":"2025-08-14T22:35:08","date_gmt":"2025-08-14T14:35:08","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/56711.html"},"modified":"2025-08-14T22:35:08","modified_gmt":"2025-08-14T14:35:08","slug":"%e6%b7%b1%e5%ba%a6%e5%ad%a6%e4%b9%a0-%e5%8d%b7%e7%a7%af%e7%a5%9e%e7%bb%8f%e7%bd%91%e7%bb%9ccnn-%e6%89%b9%e9%87%8f%e5%bd%92%e4%b8%80%e5%8c%96-batchnorm","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/56711.html","title":{"rendered":"\u6df1\u5ea6\u5b66\u4e60-\u5377\u79ef\u795e\u7ecf\u7f51\u7edcCNN-\u6279\u91cf\u5f52\u4e00\u5316 BatchNorm"},"content":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u9700\u8981\u6279\u91cf\u89c4\u8303\u5316\u5c42\u5462&#xff1f;<\/p>\n<p>\u8ba9\u6211\u4eec\u6765\u56de\u987e\u4e00\u4e0b\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u65f6\u51fa\u73b0\u7684\u4e00\u4e9b\u5b9e\u9645\u6311\u6218&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u9996\u5148&#xff0c;\u6570\u636e\u9884\u5904\u7406\u7684\u65b9\u5f0f\u901a\u5e38\u4f1a\u5bf9\u6700\u7ec8\u7ed3\u679c\u4ea7\u751f\u5de8\u5927\u5f71\u54cd\u3002 \u56de\u60f3\u4e00\u4e0b\u6211\u4eec\u5e94\u7528\u591a\u5c42\u611f\u77e5\u673a\u6765\u9884\u6d4b\u623f\u4ef7\u7684\u4f8b\u5b50\u3002\u4f7f\u7528\u771f\u5b9e\u6570\u636e\u65f6&#xff0c;\u6211\u4eec\u7684\u7b2c\u4e00\u6b65\u662f\u6807\u51c6\u5316\u8f93\u5165\u7279\u5f81&#xff0c;\u4f7f\u5176\u5e73\u5747\u503c\u4e3a0&#xff0c;\u65b9\u5dee\u4e3a1\u3002 \u76f4\u89c2\u5730\u8bf4&#xff0c;\u8fd9\u79cd\u6807\u51c6\u5316\u53ef\u4ee5\u5f88\u597d\u5730\u4e0e\u6211\u4eec\u7684\u4f18\u5316\u5668\u914d\u5408\u4f7f\u7528&#xff0c;\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5c06\u53c2\u6570\u7684\u91cf\u7ea7\u8fdb\u884c\u7edf\u4e00\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c&#xff0c;\u5bf9\u4e8e\u5178\u578b\u7684\u591a\u5c42\u611f\u77e5\u673a\u6216\u5377\u79ef\u795e\u7ecf\u7f51\u7edc&#xff0c;\u5f53\u6211\u4eec\u8bad\u7ec3\u65f6&#xff0c;\u4e2d\u95f4\u5c42\u4e2d\u7684\u53d8\u91cf&#xff08;\u4f8b\u5982&#xff0c;\u591a\u5c42\u611f\u77e5\u673a\u4e2d\u7684\u4eff\u5c04\u53d8\u6362\u8f93\u51fa&#xff09;\u53ef\u80fd\u5177\u6709\u66f4\u5e7f\u7684\u53d8\u5316\u8303\u56f4&#xff1a;\u4e0d\u8bba\u662f\u6cbf\u7740\u4ece\u8f93\u5165\u5230\u8f93\u51fa\u7684\u5c42&#xff0c;\u8de8\u540c\u4e00\u5c42\u4e2d\u7684\u5355\u5143&#xff0c;\u6216\u662f\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb&#xff0c;\u6a21\u578b\u53c2\u6570\u7684\u968f\u7740\u8bad\u7ec3\u66f4\u65b0\u53d8\u5e7b\u83ab\u6d4b\u3002 \u6279\u91cf\u89c4\u8303\u5316\u7684\u53d1\u660e\u8005\u975e\u6b63\u5f0f\u5730\u5047\u8bbe&#xff0c;\u8fd9\u4e9b\u53d8\u91cf\u5206\u5e03\u4e2d\u7684\u8fd9\u79cd\u504f\u79fb\u53ef\u80fd\u4f1a\u963b\u788d\u7f51\u7edc\u7684\u6536\u655b\u3002 \u76f4\u89c2\u5730\u8bf4&#xff0c;\u6211\u4eec\u53ef\u80fd\u4f1a\u731c\u60f3&#xff0c;\u5982\u679c\u4e00\u4e2a\u5c42\u7684\u53ef\u53d8\u503c\u662f\u53e6\u4e00\u5c42\u7684100\u500d&#xff0c;\u8fd9\u53ef\u80fd\u9700\u8981\u5bf9\u5b66\u4e60\u7387\u8fdb\u884c\u8865\u507f\u8c03\u6574\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e09&#xff0c;\u66f4\u6df1\u5c42\u7684\u7f51\u7edc\u5f88\u590d\u6742&#xff0c;\u5bb9\u6613\u8fc7\u62df\u5408\u3002 \u8fd9\u610f\u5473\u7740\u6b63\u5219\u5316\u53d8\u5f97\u66f4\u52a0\u91cd\u8981\u3002<\/p>\n<\/li>\n<\/ul>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"386\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814143503-689df417d6def.png\" width=\"930\" \/><\/p>\n<p>\u6279\u91cf\u89c4\u8303\u5316\u5e94\u7528\u4e8e\u5355\u4e2a\u53ef\u9009\u5c42&#xff08;\u4e5f\u53ef\u4ee5\u5e94\u7528\u5230\u6240\u6709\u5c42&#xff09;&#xff0c;\u5176\u539f\u7406\u5982\u4e0b&#xff1a;<\/p>\n<p>\u5728\u6bcf\u6b21\u8bad\u7ec3\u8fed\u4ee3\u4e2d&#xff0c;\u6211\u4eec\u9996\u5148\u89c4\u8303\u5316\u8f93\u5165&#xff0c;\u5373\u901a\u8fc7\u51cf\u53bb\u5176\u5747\u503c\u5e76\u9664\u4ee5\u5176\u6807\u51c6\u5dee&#xff0c;\u5176\u4e2d\u4e24\u8005\u5747\u57fa\u4e8e\u5f53\u524d\u5c0f\u6279\u91cf\u5904\u7406\u3002 \u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u5e94\u7528\u6bd4\u4f8b\u7cfb\u6570\u548c\u6bd4\u4f8b\u504f\u79fb\u3002 \u6b63\u662f\u7531\u4e8e\u8fd9\u4e2a\u57fa\u4e8e\u6279\u91cf\u7edf\u8ba1\u7684\u6807\u51c6\u5316&#xff0c;\u624d\u6709\u4e86\u6279\u91cf\u89c4\u8303\u5316\u7684\u540d\u79f0\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"421\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814143505-689df41957b21.png\" width=\"1234\" \/><\/p>\n<ul>\n<li>\n<p>BatchNorm \u5728 \u4e00\u4e2a batch \u7684\u540c\u4e00\u901a\u9053 \u5185\u505a\u5f52\u4e00\u5316<\/p>\n<\/li>\n<li>\n<p>LayerNorm \u5728 \u6bcf\u6761\u6837\u672c\u7684 \u6240\u6709\u901a\u9053\/\u7279\u5f81 \u5185\u505a\u5f52\u4e00\u5316<\/p>\n<\/li>\n<\/ul>\n<p>\u4f5c\u7528&#xff1a;\u628a\u8f93\u5165\u5206\u5e03\u5f3a\u884c\u538b\u6210 \u96f6\u5747\u503c\u3001\u5355\u4f4d\u65b9\u5dee&#xff0c;\u51cf\u8f7b Internal Covariate Shift \u5185\u90e8\u534f\u53d8\u91cf\u504f\u79fb&#xff0c;\u4f7f\u4f18\u5316\u66f2\u9762\u66f4\u5e73\u6ed1&#xff0c;\u4ece\u800c\u8ba9\u68af\u5ea6\u66f4\u7a33\u5b9a\u3001\u8bad\u7ec3\u66f4\u5feb\u3001\u66f4\u6613\u6536\u655b\u5230\u8f83\u4f18\u7684\u6cdb\u5316\u89e3\u3002<\/p>\n<\/p>\n<h3>\u8ba1\u7b97\u4f8b\u5b50<\/h3>\n<p>\u4e0b\u9762\u7528 3\u00d74 \u7684 RGB \u5c0f\u6279\u6b21\u5f20\u91cf\u4e3e\u4f8b&#xff0c;\u5e76\u7ed9\u51fa\u8ba1\u7b97\u8fc7\u7a0b\u4e0e\u5dee\u5f02\u5bf9\u7167&#xff1a;<\/p>\n<p>\u6570\u636e\u5f62\u72b6\u7ea6\u5b9a&#xff1a;\u8bbe\u8f93\u5165 x \u5f62\u72b6\u4e3a (B, C, H, W) &#061; (2, 3, 2, 2)&#xff1a;<\/p>\n<li>\n<p>2 \u5f20\u56fe\u7247<\/p>\n<\/li>\n<li>\n<p>3 \u4e2a\u901a\u9053 (R, G, B)<\/p>\n<\/li>\n<li>\n<p>\u6bcf\u901a\u9053 2\u00d72 \u50cf\u7d20<\/p>\n<\/li>\n<p>\u628a\u6bcf\u5f20\u56fe\u7247\u5c55\u5e73\u540e&#xff0c;\u5f20\u91cf\u53d8\u6210&#xff1a;<\/p>\n<p>batch0-0<br \/>\n  R: [[1, 3], [5, 7]]    \u2192 4 \u4e2a\u6807\u91cf 1 3 5 7<br \/>\n  G: [[2, 4], [6, 8]]    \u2192 2 4 6 8<br \/>\n  B: [[0, 2], [4, 6]]    \u2192 0 2 4 6<\/p>\n<p>batch0-1<br \/>\n  R: [[2, 4], [6, 8]]<br \/>\n  G: [[3, 5], [7, 9]]<br \/>\n  B: [[1, 3], [5, 7]]<\/p>\n<p>BatchNorm \u7684\u8ba1\u7b97&#xff1a;BN\u662f\u5728\u540c\u4e00\u4e2abatch\u4e2d\u4e0d\u540c\u6837\u672c\u4e4b\u95f4\u7684\u540c\u4e00\u4f4d\u7f6e\u7684\u795e\u7ecf\u5143\u4e4b\u95f4\u8fdb\u884c\u5f52\u4e00\u5316\u3002<\/p>\n<ul>\n<li>\n<p>\u5f52\u4e00\u5316\u7ef4\u5ea6&#xff1a;\u5728 (B, H, W) \u4e09\u4e2a\u7ef4\u5ea6\u4e0a\u6c42\u5747\u503c\/\u65b9\u5dee&#xff0c;\u6bcf\u4e2a\u901a\u9053\u4e00\u7ec4\u7edf\u8ba1\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p>\u4ee5 R \u901a\u9053\u4e3a\u4f8b&#xff1a; \u5171\u6709 2\u00d72\u00d72 &#061; 8 \u4e2a\u50cf\u7d20\u503c&#xff1a;{1, 3, 5, 7, 2, 4, 6, 8}<\/p>\n<ul>\n<li>\n<p>\u03bc_R &#061; (1&#043;3&#043;5&#043;7&#043;2&#043;4&#043;6&#043;8)\/8 &#061; 4.5<\/p>\n<\/li>\n<li>\n<p>\u03c3\u00b2_R &#061; \u5e73\u5747((x\u22124.5)\u00b2) &#061; 5.25<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5f52\u4e00\u5316\u540e\u6bcf\u4e2a\u50cf\u7d20\u5148\u505a (x\u2212\u03bc)\/\u221a(\u03c3\u00b2&#043;\u03b5)&#xff0c;\u518d\u8fdb\u884c \u03b3\u00b7x &#043; \u03b2 \u7684\u4eff\u5c04\u3002 G\u3001B \u901a\u9053\u540c\u7406&#xff0c;\u5404\u81ea\u72ec\u7acb\u62e5\u6709\u4e00\u7ec4 \u03bc\u3001\u03c3\u3001\u03b3\u3001\u03b2\u3002<\/p>\n<\/li>\n<li>\n<p>\u53c2\u6570&#xff1a;\u6bcf\u4e2a\u901a\u9053\u4e00\u5bf9 (\u03b3, \u03b2)&#xff0c;\u5171 3\u00d72 &#061; 6 \u4e2a\u53ef\u5b66\u4e60\u6807\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p>\u63a8\u7406\u9636\u6bb5&#xff1a;\u7528\u6ed1\u52a8\u5e73\u5747\u4fdd\u5b58\u7684\u5168\u5c40 \u03bc\u3001\u03c3&#xff0c;\u4e0d\u518d\u4f9d\u8d56 batch\u3002<\/p>\n<\/li>\n<\/ul>\n<p>LayerNorm \u7684\u8ba1\u7b97&#xff1a;LN\u662f\u5728\u540c\u4e00\u4e2a\u6837\u672c\u4e2d\u4e0d\u540c\u795e\u7ecf\u5143\u4e4b\u95f4\u8fdb\u884c\u5f52\u4e00\u5316\u3002<\/p>\n<ul>\n<li>\n<p>\u5f52\u4e00\u5316\u7ef4\u5ea6&#xff1a;\u5728 (C, H, W) \u4e09\u4e2a\u7ef4\u5ea6\u4e0a\u6c42\u5747\u503c\/\u65b9\u5dee&#xff0c;\u6bcf\u6761\u6837\u672c\u4e00\u7ec4\u7edf\u8ba1\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p>\u4ee5 batch-0 \u4e3a\u4f8b&#xff1a; \u628a 3\u00d72\u00d72 &#061; 12 \u4e2a\u6570\u62c9\u6210\u4e00\u6761\u5411\u91cf&#xff1a; {1, 3, 5, 7, 2, 4, 6, 8, 0, 2, 4, 6}<\/p>\n<ul>\n<li>\n<p>\u03bc &#061; 4.0<\/p>\n<\/li>\n<li>\n<p>\u03c3\u00b2 &#061; \u5e73\u5747((x\u22124)\u00b2) &#061; 5.0<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5f52\u4e00\u5316\u540e\u518d\u7528 \u8be5\u6837\u672c\u72ec\u6709 \u7684 \u03b3\u3001\u03b2 \u505a\u4eff\u5c04\u3002 batch-1 \u540c\u7406&#xff0c;\u7528 batch-1 \u81ea\u5df1\u7684 12 \u4e2a\u6570\u91cd\u65b0\u7b97 \u03bc\u3001\u03c3\u3002<\/p>\n<\/li>\n<li>\n<p>\u53c2\u6570&#xff1a;\u6bcf\u6761\u6837\u672c\u4e00\u5bf9 (\u03b3, \u03b2)&#xff0c;\u53ef\u5171\u4eab\u6216\u4e0d\u5171\u4eab&#xff0c;\u4e0e BatchNorm \u4e0d\u540c\u3002<\/p>\n<\/li>\n<\/ul>\n<h3>\u4e3a\u4ec0\u4e48\u6709\u6548&#xff1f;<\/h3>\n<ul>\n<li>\n<p>\u8f93\u5165&#xff1a;\u624b\u5199\u6570\u5b57\u7070\u5ea6\u56fe&#xff0c;\u53ea\u4fdd\u7559 2 \u4e2a\u50cf\u7d20 \u2192 \u8f93\u5165 x \u5f62\u72b6 (batch, 2)\u3002<\/p>\n<\/li>\n<li>\n<p>\u7f51\u7edc&#xff1a;2 \u5c42\u7ebf\u6027 y &#061; W\u2082 ReLU(W\u2081x)\u3002<\/p>\n<\/li>\n<li>\n<p>\u4efb\u52a1&#xff1a;\u4e8c\u5206\u7c7b 0\/1&#xff0c;\u7528 Sigmoid &#043; BCE \u635f\u5931\u3002<\/p>\n<\/li>\n<li>\n<p>\u5047\u8bbe batch &#061; 4&#xff0c;\u50cf\u7d20\u503c\u5982\u4e0b&#xff08;\u6545\u610f\u628a\u8303\u56f4\u62c9\u5927&#xff09;&#xff1a;<\/p>\n<p>x &#061; [[200, 190],<br \/>\n     [10,  5],<br \/>\n     [180, 170],<br \/>\n     [8,   4]]<\/p>\n<\/li>\n<li>\n<p>\u771f\u5b9e\u6807\u7b7e y &#061; [0,\u00a0 1,\u00a0 0,\u00a0 1]<\/p>\n<\/li>\n<\/ul>\n<p>\u6ca1\u6709\u5f52\u4e00\u5316\u65f6&#xff08;\u88f8\u7f51\u7edc&#xff09;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u5c42\u8f93\u51fa z\u2081 &#061; W\u2081x&#xff0c;\u5047\u8bbe W\u2081 \u968f\u673a\u521d\u59cb\u5316\u540e&#xff0c; z\u2081 \u7684\u5747\u503c\u2248180&#xff0c;\u65b9\u5dee\u22486000\u3002<\/p>\n<\/li>\n<li>\n<p>\u7ecf\u8fc7 ReLU \u540e&#xff0c;\u5927\u591a\u6570\u503c\u843d\u5728 0 \u6216 &gt;100 \u7684\u533a\u95f4 \u2192 \u68af\u5ea6\u5728\u53cd\u5411\u4f20\u64ad\u65f6&#xff1a; \u2013 \u5f88\u5927\u503c\u90a3\u4e00\u7aef \u2192 \u68af\u5ea6\u7206\u70b8&#xff1b; \u2013 \u5f88\u591a 0 \u2192 \u68af\u5ea6\u6d88\u5931\u3002 \u7ed3\u679c&#xff1a;Loss \u9707\u8361\u5267\u70c8&#xff0c;\u8bad\u7ec3 10 \u4e2a epoch \u4ecd\u964d\u4e0d\u4e0b\u6765\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u52a0\u4e0a BatchNorm&#xff08;\u653e\u5728\u7b2c\u4e00\u5c42\u4e4b\u540e&#xff09;&#xff1a;<\/p>\n<li>\n<p>\u8ba1\u7b97 batch \u5185\u6bcf\u4e2a\u901a\u9053\u7684\u5747\u503c \u03bc\u3001\u65b9\u5dee \u03c3\u00b2&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u03bc\u2081 &#061; (200&#043;10&#043;180&#043;8)\/4 &#061; 99.5<\/p>\n<\/li>\n<li>\n<p>\u03bc\u2082 &#061; (190&#043;5&#043;170&#043;4)\/4 &#061; 92.25<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5f52\u4e00\u5316&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u1e91\u2081 &#061; (z\u2081 \u2212 \u03bc\u2081)\/\u221a(\u03c3\u2081\u00b2&#043;\u03b5)<\/p>\n<\/li>\n<li>\n<p>\u1e91\u2082 &#061; (z\u2082 \u2212 \u03bc\u2082)\/\u221a(\u03c3\u2082\u00b2&#043;\u03b5)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u73b0\u5728\u6240\u6709\u503c\u7f29\u653e\u5230 \u2248[-1,1] \u533a\u95f4\u3002<\/p>\n<\/li>\n<li>\n<p>\u518d\u4e58\u53ef\u5b66\u4e60 \u03b3\u3001\u03b2 \u505a\u4eff\u5c04&#xff0c;\u4fdd\u6301\u8868\u8fbe\u80fd\u529b\u3002<\/p>\n<\/li>\n<li>\n<p>\u6548\u679c&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u5c42\u8f93\u51fa\u65b9\u5dee\u22481&#xff0c;ReLU \u540e\u7684\u5206\u5e03\u4e0d\u518d\u6781\u7aef\u3002<\/p>\n<\/li>\n<li>\n<p>\u53cd\u5411\u4f20\u64ad\u65f6\u68af\u5ea6\u5927\u5c0f\u7a33\u5b9a&#xff0c;loss \u5355\u8c03\u4e0b\u964d&#xff0c;3 \u4e2a epoch \u5c31\u6536\u655b\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<p>\u52a0\u4e0a LayerNorm&#xff08;\u653e\u5728\u7b2c\u4e00\u5c42\u4e4b\u540e&#xff09;<\/p>\n<ul>\n<li>\n<p>\u5bf9\u6bcf\u6761\u6837\u672c\u7684\u6240\u6709\u7279\u5f81\u4e00\u8d77\u7b97 \u03bc\u3001\u03c3\u00b2&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u6837\u672c 0&#xff1a;\u03bc &#061; (200&#043;190)\/2 &#061; 195<\/p>\n<\/li>\n<li>\n<p>\u6837\u672c 1&#xff1a;\u03bc &#061; (10&#043;5)\/2 &#061; 7.5<\/p>\n<\/li>\n<li>\n<p>\u2026\u2026\u2026\u2026<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6bcf\u6761\u6837\u672c\u5185\u90e8\u505a (x\u2212\u03bc)\/\u03c3&#xff0c;\u518d \u03b3\u3001\u03b2\u3002<\/p>\n<ul>\n<li>\n<p>\u6548\u679c&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5373\u4f7f batch \u5927\u5c0f\u53d8\u6210 1 \u4e5f\u80fd\u7528&#xff08;LN \u4e0d\u4f9d\u8d56 batch&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u8f93\u5165\u5c3a\u5ea6\u88ab\u62c9\u9f50&#xff0c;\u68af\u5ea6\u540c\u6837\u7a33\u5b9a&#xff0c;\u6536\u655b\u901f\u5ea6\u4e0e BN \u76f8\u8fd1\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<table>\n<tbody>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u6bd4\u8f83\u70b9<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>BatchNorm<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>LayerNorm<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5f52\u4e00\u5316\u8303\u56f4<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u8de8 batch \u7684\u540c\u4e00\u901a\u9053<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5355\u6761\u6837\u672c \u5185\u7684\u5168\u90e8\u7279\u5f81<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5747\u503c\/\u65b9\u5dee\u7ef4\u5ea6<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>(B, H, W)<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>(C, H, W)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u4f9d\u8d56 batch \u5927\u5c0f<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u662f&#xff08;\u63a8\u7406\u65f6\u7528\u6ed1\u52a8\u5e73\u5747&#xff09;<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5426<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5178\u578b\u573a\u666f<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>CNN\u3001\u5927 batch<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>RNN\u3001Transformer\u3001\u5c0f batch<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u53c2\u6570\u91cf<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u6bcf\u901a\u9053\u4e00\u5bf9 \u03b3\u03b2<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u6bcf\u5c42\/\u6bcf\u6837\u672c\u4e00\u5bf9 \u03b3\u03b2<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u56e0\u6b64&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5728 CNN \u91cc\u7528 BatchNorm&#xff0c;\u4f60\u4f1a\u770b\u5230\u201c\u6240\u6709\u56fe\u7247\u7684 R \u901a\u9053\u4e00\u8d77\u5f52\u4e00\u5316\u201d&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\u5728 Transformer \u91cc\u7528 LayerNorm&#xff0c;\u4f60\u4f1a\u770b\u5230\u201c\u6bcf\u4e2a token \u7684\u6240\u6709\u7ef4\u4e00\u8d77\u5f52\u4e00\u5316\u201d\u3002<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb254\u6b21\uff0c\u70b9\u8d5e4\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u4ee5 batch-0 \u4e3a\u4f8b\uff1a \u628a 3\u00d72\u00d72 = 12 \u4e2a\u6570\u62c9\u6210\u4e00\u6761\u5411\u91cf\uff1a {1, 3, 5, 7, 2, 4, 6, 8, 0, 2, 4, 6}\u4ee5 R \u901a\u9053\u4e3a\u4f8b\uff1a \u5171\u6709 2\u00d72\u00d72 = 8 \u4e2a\u50cf\u7d20\u503c\uff1a{1, 3, 5, 7, 2, 4, 6, 8}\u8f93\u5165\uff1a\u624b\u5199\u6570\u5b57\u7070\u5ea6\u56fe\uff0c\u53ea\u4fdd\u7559 2 \u4e2a\u50cf\u7d20 \u2192 \u8f93\u5165 x \u5f62\u72b6 (batch, 2)\u3002\u5f52\u4e00\u5316\u7ef4\u5ea6\uff1a\u5728 (B, H, W) \u4e09\u4e2a\u7ef4\u5ea6\u4e0a\u6c42\u5747\u503c\/\u65b9\u5dee\uff0c\u6bcf\u4e2a\u901a\u9053\u4e00\u7ec4\u7edf\u8ba1\u91cf\u3002\u5f52\u4e00\u5316\u7ef4\u5ea6\uff1a\u5728 (C, H, W) \u4e09\u4e2a\u7ef4\u5ea6\u4e0a\u6c42\u5747\u503c\/\u65b9\u5dee\uff0c\u6bcf\u6761\u6837\u672c\u4e00\u7ec4\u7edf\u8ba1\u91cf\u3002<\/p>\n","protected":false},"author":2,"featured_media":56709,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[587,66,2394,50,207,86],"topic":[],"class_list":["post-56711","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-587","tag-ai","tag-cnn","tag-50","tag-207","tag-86"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6df1\u5ea6\u5b66\u4e60-\u5377\u79ef\u795e\u7ecf\u7f51\u7edcCNN-\u6279\u91cf\u5f52\u4e00\u5316 BatchNorm - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/56711.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6df1\u5ea6\u5b66\u4e60-\u5377\u79ef\u795e\u7ecf\u7f51\u7edcCNN-\u6279\u91cf\u5f52\u4e00\u5316 BatchNorm - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb254\u6b21\uff0c\u70b9\u8d5e4\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u4ee5 batch-0 \u4e3a\u4f8b\uff1a \u628a 3\u00d72\u00d72 = 12 \u4e2a\u6570\u62c9\u6210\u4e00\u6761\u5411\u91cf\uff1a {1, 3, 5, 7, 2, 4, 6, 8, 0, 2, 4, 6}\u4ee5 R \u901a\u9053\u4e3a\u4f8b\uff1a \u5171\u6709 2\u00d72\u00d72 = 8 \u4e2a\u50cf\u7d20\u503c\uff1a{1, 3, 5, 7, 2, 4, 6, 8}\u8f93\u5165\uff1a\u624b\u5199\u6570\u5b57\u7070\u5ea6\u56fe\uff0c\u53ea\u4fdd\u7559 2 \u4e2a\u50cf\u7d20 \u2192 \u8f93\u5165 x \u5f62\u72b6 (batch, 2)\u3002\u5f52\u4e00\u5316\u7ef4\u5ea6\uff1a\u5728 (B, H, W) \u4e09\u4e2a\u7ef4\u5ea6\u4e0a\u6c42\u5747\u503c\/\u65b9\u5dee\uff0c\u6bcf\u4e2a\u901a\u9053\u4e00\u7ec4\u7edf\u8ba1\u91cf\u3002\u5f52\u4e00\u5316\u7ef4\u5ea6\uff1a\u5728 (C, H, W) \u4e09\u4e2a\u7ef4\u5ea6\u4e0a\u6c42\u5747\u503c\/\u65b9\u5dee\uff0c\u6bcf\u6761\u6837\u672c\u4e00\u7ec4\u7edf\u8ba1\u91cf\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/56711.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-14T14:35:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814143503-689df417d6def.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/56711.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/56711.html\",\"name\":\"\u6df1\u5ea6\u5b66\u4e60-\u5377\u79ef\u795e\u7ecf\u7f51\u7edcCNN-\u6279\u91cf\u5f52\u4e00\u5316 BatchNorm - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-14T14:35:08+00:00\",\"dateModified\":\"2025-08-14T14:35:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/56711.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/56711.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/56711.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6df1\u5ea6\u5b66\u4e60-\u5377\u79ef\u795e\u7ecf\u7f51\u7edcCNN-\u6279\u91cf\u5f52\u4e00\u5316 BatchNorm\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u6df1\u5ea6\u5b66\u4e60-\u5377\u79ef\u795e\u7ecf\u7f51\u7edcCNN-\u6279\u91cf\u5f52\u4e00\u5316 BatchNorm - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/56711.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6df1\u5ea6\u5b66\u4e60-\u5377\u79ef\u795e\u7ecf\u7f51\u7edcCNN-\u6279\u91cf\u5f52\u4e00\u5316 BatchNorm - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb254\u6b21\uff0c\u70b9\u8d5e4\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u4ee5 batch-0 \u4e3a\u4f8b\uff1a \u628a 3\u00d72\u00d72 = 12 \u4e2a\u6570\u62c9\u6210\u4e00\u6761\u5411\u91cf\uff1a {1, 3, 5, 7, 2, 4, 6, 8, 0, 2, 4, 6}\u4ee5 R \u901a\u9053\u4e3a\u4f8b\uff1a \u5171\u6709 2\u00d72\u00d72 = 8 \u4e2a\u50cf\u7d20\u503c\uff1a{1, 3, 5, 7, 2, 4, 6, 8}\u8f93\u5165\uff1a\u624b\u5199\u6570\u5b57\u7070\u5ea6\u56fe\uff0c\u53ea\u4fdd\u7559 2 \u4e2a\u50cf\u7d20 \u2192 \u8f93\u5165 x \u5f62\u72b6 (batch, 2)\u3002\u5f52\u4e00\u5316\u7ef4\u5ea6\uff1a\u5728 (B, H, W) \u4e09\u4e2a\u7ef4\u5ea6\u4e0a\u6c42\u5747\u503c\/\u65b9\u5dee\uff0c\u6bcf\u4e2a\u901a\u9053\u4e00\u7ec4\u7edf\u8ba1\u91cf\u3002\u5f52\u4e00\u5316\u7ef4\u5ea6\uff1a\u5728 (C, H, W) \u4e09\u4e2a\u7ef4\u5ea6\u4e0a\u6c42\u5747\u503c\/\u65b9\u5dee\uff0c\u6bcf\u6761\u6837\u672c\u4e00\u7ec4\u7edf\u8ba1\u91cf\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/56711.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-14T14:35:08+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814143503-689df417d6def.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/56711.html","url":"https:\/\/www.wsisp.com\/helps\/56711.html","name":"\u6df1\u5ea6\u5b66\u4e60-\u5377\u79ef\u795e\u7ecf\u7f51\u7edcCNN-\u6279\u91cf\u5f52\u4e00\u5316 BatchNorm - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-14T14:35:08+00:00","dateModified":"2025-08-14T14:35:08+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/56711.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/56711.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/56711.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6df1\u5ea6\u5b66\u4e60-\u5377\u79ef\u795e\u7ecf\u7f51\u7edcCNN-\u6279\u91cf\u5f52\u4e00\u5316 BatchNorm"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/56711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=56711"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/56711\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/56709"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=56711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=56711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=56711"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=56711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}