﻿{"id":3272,"date":"2025-08-27T10:19:59","date_gmt":"2025-08-27T02:19:59","guid":{"rendered":"https:\/\/www.leexinghai.com\/aic\/?p=3272"},"modified":"2025-08-27T10:26:51","modified_gmt":"2025-08-27T02:26:51","slug":"3-8%e5%90%8e%e5%90%91%e4%bc%a0%e6%92%ad%e7%ae%97%e6%b3%95%e7%9a%84%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.leexinghai.com\/aic\/3-8%e5%90%8e%e5%90%91%e4%bc%a0%e6%92%ad%e7%ae%97%e6%b3%95%e7%9a%84%e5%ba%94%e7%94%a8\/","title":{"rendered":"3.8\u540e\u5411\u4f20\u64ad\u7b97\u6cd5\u7684\u5e94\u7528"},"content":{"rendered":"\n<p>\u9636\u8dc3\u51fd\u6570sigmoid\u7684\u5bfc\u6570\u6709\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><msup><mi>\u03c6<\/mi><mo>\u2032<\/mo><\/msup><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><msup><mrow data-mjx-texclass=\"INNER\"><mo data-mjx-texclass=\"OPEN\">(<\/mo><mfrac><mn>1<\/mn><mrow><mn>1<\/mn><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><\/mrow><\/mfrac><mo data-mjx-texclass=\"CLOSE\">)<\/mo><\/mrow><mo>\u2032<\/mo><\/msup><mo>=<\/mo><mfrac><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><mrow><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><msup><mo stretchy=\"false\">)<\/mo><mn>2<\/mn><\/msup><\/mrow><\/mfrac><mo>=<\/mo><mrow data-mjx-texclass=\"INNER\"><mo data-mjx-texclass=\"OPEN\">[<\/mo><mn>1<\/mn><mo>\u2212<\/mo><mfrac><mn>1<\/mn><mrow><mn>1<\/mn><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><\/mrow><\/mfrac><mo data-mjx-texclass=\"CLOSE\">]<\/mo><\/mrow><mfrac><mn>1<\/mn><mrow><mn>1<\/mn><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><\/mrow><\/mfrac><mo>=<\/mo><mi>\u03c6<\/mi><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo stretchy=\"false\">[<\/mo><mn>1<\/mn><mo>\u2212<\/mo><mi>\u03c6<\/mi><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo stretchy=\"false\">]<\/mo><\/math>\n\n\n\n<p>\u8fd9\u4e2a\u53ef\u4ee5\u7528\u6765\u4ee3\u66ff\u9636\u8dc3\u51fd\u6570\u3002<\/p>\n\n\n\n<p>\u5e38\u7528\u7684\u975e\u7ebf\u6027\u51fd\u6570\u53cc\u66f2\u6b63\u5207tah\u51fd\u6570\u8868\u8fbe\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mi>\u03c6<\/mi><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mfrac><mrow><msup><mi>e<\/mi><mi>x<\/mi><\/msup><mo>\u2212<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><\/mrow><mrow><msup><mi>e<\/mi><mi>x<\/mi><\/msup><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><\/mrow><\/mfrac><\/math>\n\n\n\n<p>\u8fd9\u4e2atanh\u7684\u5bfc\u6570\u6709\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><msup><mi>\u03c6<\/mi><mo>\u2032<\/mo><\/msup><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><msup><mrow data-mjx-texclass=\"INNER\"><mo data-mjx-texclass=\"OPEN\">(<\/mo><mfrac><mrow><msup><mi>e<\/mi><mi>x<\/mi><\/msup><mo>\u2212<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><\/mrow><mrow><msup><mi>e<\/mi><mi>x<\/mi><\/msup><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><\/mrow><\/mfrac><mo data-mjx-texclass=\"CLOSE\">)<\/mo><\/mrow><mo>\u2032<\/mo><\/msup><mo>=<\/mo><mfrac><mrow><mo stretchy=\"false\">(<\/mo><msup><mi>e<\/mi><mi>x<\/mi><\/msup><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><msup><mo stretchy=\"false\">)<\/mo><mn>2<\/mn><\/msup><mo>\u2212<\/mo><mo stretchy=\"false\">(<\/mo><msup><mi>e<\/mi><mi>x<\/mi><\/msup><mo>\u2212<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><msup><mo stretchy=\"false\">)<\/mo><mn>2<\/mn><\/msup><\/mrow><mrow><mo stretchy=\"false\">(<\/mo><msup><mi>e<\/mi><mi>x<\/mi><\/msup><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><msup><mo stretchy=\"false\">)<\/mo><mn>2<\/mn><\/msup><\/mrow><\/mfrac><mo>=<\/mo><mn>1<\/mn><mo>\u2212<\/mo><msup><mrow data-mjx-texclass=\"INNER\"><mo data-mjx-texclass=\"OPEN\">[<\/mo><mfrac><mrow><msup><mi>e<\/mi><mi>x<\/mi><\/msup><mo>\u2212<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><\/mrow><mrow><msup><mi>e<\/mi><mi>x<\/mi><\/msup><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>x<\/mi><\/mrow><\/msup><\/mrow><\/mfrac><mo data-mjx-texclass=\"CLOSE\">]<\/mo><\/mrow><mn>2<\/mn><\/msup><mo>=<\/mo><mn>1<\/mn><mo>\u2212<\/mo><mo stretchy=\"false\">[<\/mo><mi>\u03c6<\/mi><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><msup><mo stretchy=\"false\">]<\/mo><mn>2<\/mn><\/msup><\/math>\n\n\n\n<p>\u5bf9\u4e8e\u76ee\u6807\u51fd\u6570\uff0c\u53ef\u4ee5\u7528\u9884\u6d4b\u503cy\u548c\u771f\u5b9e\u503cY\u5dee\u7684\u6a21\u7684\u5e73\u65b9\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mi>E<\/mi><mo>=<\/mo><mfrac><mn>1<\/mn><mn>2<\/mn><\/mfrac><mrow><mo stretchy=\"false\">|<\/mo><\/mrow><mi>y<\/mi><mo>\u2212<\/mo><mi>Y<\/mi><msup><mo stretchy=\"false\">|<\/mo><mn>2<\/mn><\/msup><\/math>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f46\u901a\u5e38\u7528\u57fa\u4e8esoftmax\u548c\u4ea4\u53c9\u71b5\uff08cross-entropy\uff09\u7684\u76ee\u6807\u51fd\u6570\u3002<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">\u8fd9\u4e9b\u662f\u4ec0\u4e48\u4e1c\u897f\uff1f<\/mark><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001Softmax \u51fd\u6570\u662f\u4ec0\u4e48\uff1f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u5b9a\u4e49\uff1a<\/h3>\n\n\n\n<p>Softmax \u662f\u4e00\u4e2a<strong>\u5c06\u5b9e\u6570\u5411\u91cf\u53d8\u6362\u4e3a\u6982\u7387\u5206\u5e03<\/strong>\u7684\u51fd\u6570\u3002\u8bbe\u8f93\u5165\u4e3a\u5411\u91cf z = [z<sub>1<\/sub>, z<sub>2<\/sub>, ......, z<sub>n<\/sub>]\uff0cSoftmax \u8f93\u51fa\u4e3a\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mrow><mi>S<\/mi><mi>o<\/mi><mi>f<\/mi><mi>t<\/mi><mi>m<\/mi><mi>a<\/mi><mi>x<\/mi><\/mrow><mo stretchy=\"false\">(<\/mo><msub><mi>z<\/mi><mi>i<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mfrac><msup><mi>e<\/mi><mrow><msub><mi>z<\/mi><mi>i<\/mi><\/msub><\/mrow><\/msup><mrow><munderover><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>j<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mrow><mi>n<\/mi><\/mrow><\/munderover><msup><mi>e<\/mi><mrow><msub><mi>z<\/mi><mi>j<\/mi><\/msub><\/mrow><\/msup><\/mrow><\/mfrac><\/math>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u7279\u70b9\uff1a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8f93\u51fa\u503c\u8303\u56f4\u5728 (0, 1) \u4e4b\u95f4\uff1b<\/li>\n\n\n\n<li>\u6240\u6709\u8f93\u51fa\u503c\u52a0\u8d77\u6765\u662f 1\uff0c\u6240\u4ee5\u53ef\u4ee5\u770b\u4f5c\u662f\u4e00\u4e2a\u6982\u7387\u5206\u5e03\uff1b<\/li>\n\n\n\n<li>\u6700\u5927\u503c\u5bf9\u5e94\u7684\u7c7b\u7684\u6982\u7387\u6700\u5927\uff0c\u9002\u7528\u4e8e\u5206\u7c7b\u95ee\u9898\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u5e94\u7528\u573a\u666f\uff1a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u591a\u5206\u7c7b\u795e\u7ecf\u7f51\u7edc\u7684\u8f93\u51fa\u5c42\uff1b<\/li>\n\n\n\n<li>\u5f3a\u5316\u5b66\u4e60\u4e2d\u7684\u7b56\u7565\u5206\u5e03\uff1b<\/li>\n\n\n\n<li>\u6ce8\u610f\u529b\u673a\u5236\u4e2d\u7684\u5f52\u4e00\u5316\u6743\u91cd\uff08softmax attention\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u4ea4\u53c9\u71b5\u51fd\u6570\u662f\u4ec0\u4e48\uff1f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u5b9a\u4e49\uff1a<\/h3>\n\n\n\n<p>\u4ea4\u53c9\u71b5\u8861\u91cf\u7684\u662f\u4e24\u4e2a\u6982\u7387\u5206\u5e03\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c\u5e38\u7528\u4e8e\u5ea6\u91cf\u6a21\u578b\u8f93\u51fa\u7684\u6982\u7387\u5206\u5e03\u4e0e\u771f\u5b9e\u6807\u7b7e\u4e4b\u95f4\u7684\u8ddd\u79bb\u3002<\/p>\n\n\n\n<p>\u8bbe\u771f\u5b9e\u6807\u7b7e\u4e3a one-hot \u7f16\u7801\u7684\u5411\u91cf Y\uff0c\u9884\u6d4b\u8f93\u51fa\u4e3a softmax \u6982\u7387 y\uff0c\u4ea4\u53c9\u71b5\u635f\u5931\u51fd\u6570\u5b9a\u4e49\u4e3a\uff1a <\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mtext>CrossEntropy<\/mtext><mo stretchy=\"false\">(<\/mo><mrow><mi mathvariant=\"bold\">Y<\/mi><\/mrow><mo>,<\/mo><mrow><mrow><mi mathvariant=\"bold\">y<\/mi><\/mrow><\/mrow><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mo>\u2212<\/mo><munderover><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mrow><mi>n<\/mi><\/mrow><\/munderover><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><mi>log<\/mi><mo data-mjx-texclass=\"NONE\">\u2061<\/mo><mo stretchy=\"false\">(<\/mo><msub><mi>y<\/mi><mi>i<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><\/math>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u5b9e\u9645\u6548\u679c\uff1a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5982\u679c\u9884\u6d4b y<sub>i<\/sub> \u8d8b\u8fd1\u4e8e\u771f\u5b9e\u6807\u7b7e\u5bf9\u5e94\u7684 1\uff0c\u5219\u635f\u5931\u8d8b\u8fd1\u4e8e 0\uff1b<\/li>\n\n\n\n<li>\u5982\u679c\u9884\u6d4b\u9519\u8bef\uff08\u5373\u771f\u5b9e\u6807\u7b7e\u5bf9\u5e94\u7684 y<sub>i<\/sub> \u8d8b\u8fd1\u4e8e 0\uff09\uff0c\u5219\u635f\u5931\u8d8b\u8fd1\u4e8e +\u221e\uff1b<\/li>\n\n\n\n<li>\u56e0\u6b64\u5b83\u9f13\u52b1\u6a21\u578b\u201c\u81ea\u4fe1\u4e14\u6b63\u786e\u201d\u5730\u505a\u51fa\u5206\u7c7b\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">\u2193\u90a3\u4e48\u5c31\u53ef\u4ee5\u7528softmax+\u4ea4\u53c9\u71b5\u6765\u8bc1\u660e\u4e00\u4e2a\u975e\u5e38\u7b80\u6d01\u7684\u6c42\u504f\u5bfc\u516c\u5f0f\u2193<\/h2>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001Softmax + CrossEntropy \u7684\u7ec4\u5408\uff1a\u4e3a\u4ec0\u4e48\u8981\u4e00\u8d77\u7528\uff1f<\/h2>\n\n\n\n<p>\u5728 PyTorch\u3001TensorFlow \u7b49\u6846\u67b6\u4e2d\uff0c\u8fd9\u4e24\u4e2a\u901a\u5e38<strong>\u5408\u5e76\u4e3a\u4e00\u4e2a\u51fd\u6570<\/strong>\uff08\u5982 <code>F.cross_entropy()<\/code>\uff09\uff0c\u539f\u56e0\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6570\u503c\u7a33\u5b9a\u6027<\/strong>\uff1a\u5355\u72ec\u8ba1\u7b97 softmax \u540e\u518d\u8ba1\u7b97 log\uff0c\u5bb9\u6613\u9020\u6210\u68af\u5ea6\u7206\u70b8\u6216 underflow\uff1b<\/li>\n\n\n\n<li><strong>\u4f18\u5316\u6548\u7387<\/strong>\uff1a\u5408\u5e76\u540e\u7684\u51fd\u6570\u53ef\u4ee5\u76f4\u63a5\u7528\u66f4\u5feb\u66f4\u7a33\u5b9a\u7684\u7b97\u6cd5\u5b9e\u73b0\uff1b<\/li>\n\n\n\n<li><strong>\u68af\u5ea6\u7b80\u6d01<\/strong>\uff1a\u53cd\u5411\u4f20\u64ad\u65f6\uff0cSoftmax + CrossEntropy \u7684\u68af\u5ea6\u7b80\u6d01\u4f18\u96c5\uff0c\u4fbf\u4e8e\u5b66\u4e60\u548c\u5b9e\u73b0\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u53cd\u5411\u4f20\u64ad\u7684\u68af\u5ea6\uff08\u591a\u5206\u7c7b\uff09\uff1a<\/h3>\n\n\n\n<p>\u8bbe L \u4e3a\u4ea4\u53c9\u71b5\u635f\u5931\uff0cz<sub>i<\/sub> \u4e3a softmax \u8f93\u5165\uff0cY<sub>i<\/sub> \u4e3a\u771f\u5b9e\u6807\u7b7e\uff08one-hot\uff09\uff0c\u5219\uff1a <\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>L<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mi>z<\/mi><mi>i<\/mi><\/msub><\/mrow><\/mfrac><mo>=<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><mo>\u2212<\/mo><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><\/math>\n\n\n\n<p>\u8fd9\u610f\u5473\u7740\u53cd\u5411\u4f20\u64ad\u65f6\uff0c\u53ea\u9700<strong>\u9884\u6d4b\u6982\u7387 - \u5b9e\u9645\u6807\u7b7e<\/strong>\uff0c\u975e\u5e38\u9ad8\u6548\uff01<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u4e3e\u4e2a\u4f8b\u5b50<\/h2>\n\n\n\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e09\u4e2a\u7c7b\u522b\uff0c\u6a21\u578b\u8f93\u51fa logits \u662f\uff1a z=[2.0,1.0,0.1]<\/p>\n\n\n\n<p>\u7528 softmax \u5f97\u5230\uff1a y=Softmax(z)=[0.659,0.242,0.099]<\/p>\n\n\n\n<p>\u5047\u8bbe\u771f\u5b9e\u6807\u7b7e\u662f\u7b2c\u4e00\u7c7b\uff08\u5373 Y = [1, 0, 0]\uff09\uff0c\u90a3\u4e48\u4ea4\u53c9\u71b5\u635f\u5931\u662f\uff1a \u2212log\u2061(0.659)\u22480.417<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u800c\u5bf9\u4e8e\u6b64\u5904\u7684\u3010\u4e09\u3011\uff0c\u63a8\u7406\u8bc1\u660e\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u7b80\u6d01\u4f18\u96c5\u7684\u504f\u5bfc\u516c\u5f0f\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>E<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mi>z<\/mi><mi>i<\/mi><\/msub><\/mrow><\/mfrac><mo>=<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><mo>\u2212<\/mo><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><\/math>\n\n\n\n<p>\u6216\u8005\u5411\u91cf\u5f62\u5f0f\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>E<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mrow><mi mathvariant=\"bold\">z<\/mi><\/mrow><\/mrow><\/mfrac><mo>=<\/mo><mrow><mrow><mi mathvariant=\"bold\">y<\/mi><\/mrow><\/mrow><mo>\u2212<\/mo><mrow><mi mathvariant=\"bold\">Y<\/mi><\/mrow><\/math>\n\n\n\n<p>\u662f Softmax + CrossEntropy \u7684\u7ec4\u5408\u5728\u53cd\u5411\u4f20\u64ad\u4e2d\u7684<strong>\u9ec4\u91d1\u516c\u5f0f<\/strong>\uff0c\u6211\u4eec\u4e0b\u9762\u7528<strong>\u9010\u6b65\u63a8\u5bfc\u6cd5<\/strong>\u6765\u8be6\u7ec6\u8bc1\u660e\u5b83\uff0c\u903b\u8f91\u6e05\u6670\uff0c\u7ed3\u679c\u7cbe\u786e\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\udde0 \u524d\u63d0\u5b9a\u4e49<\/h2>\n\n\n\n<p>\u8bbe\uff1a<\/p>\n\n\n\n<p>\u6a21\u578b\u8f93\u51fa logits \u5411\u91cf\u4e3a z = [z<sub>1<\/sub>, z<sub>2<\/sub>, ......, z<sub>n<\/sub>]<\/p>\n\n\n\n<p>softmax \u8f93\u51fa\u4e3a <\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><mo>=<\/mo><mfrac><msup><mi>e<\/mi><mrow><msub><mi>z<\/mi><mi>i<\/mi><\/msub><\/mrow><\/msup><mrow><munderover><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>j<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mrow><mi>n<\/mi><\/mrow><\/munderover><msup><mi>e<\/mi><mrow><msub><mi>z<\/mi><mi>j<\/mi><\/msub><\/mrow><\/msup><\/mrow><\/mfrac><\/math>\n\n\n\n<p>\u771f\u5b9e\u6807\u7b7e\u4e3a one-hot \u5411\u91cf Y = [Y<sub>1<\/sub>, Y<sub>2<\/sub>, ......., Y<sub>n<\/sub>]<\/p>\n\n\n\n<p>\u635f\u5931\u51fd\u6570\u4e3a\u4ea4\u53c9\u71b5\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mi>E<\/mi><mo>=<\/mo><mo>\u2212<\/mo><munderover><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mrow><mi>n<\/mi><\/mrow><\/munderover><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><mi>log<\/mi><mo data-mjx-texclass=\"NONE\">\u2061<\/mo><mo stretchy=\"false\">(<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><\/math>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u76ee\u6807\uff1a\u6c42 E\u5bf9z<sub>k<\/sub>\u7684\u504f\u5bfc<\/h2>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd36 \u7b2c\u4e00\u6b65\uff1a\u94fe\u5f0f\u6cd5\u5219\u5206\u6b65\u8ba1\u7b97<\/h3>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>E<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mi>z<\/mi><mi>k<\/mi><\/msub><\/mrow><\/mfrac><mo>=<\/mo><munderover><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mrow><mi>n<\/mi><\/mrow><\/munderover><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>E<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><\/mrow><\/mfrac><mo>\u22c5<\/mo><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mi>z<\/mi><mi>k<\/mi><\/msub><\/mrow><\/mfrac><\/math>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd36 \u7b2c\u4e8c\u6b65\uff1a\u5206\u522b\u6c42\u5bfc<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u2460 \u4ea4\u53c9\u71b5\u5bf9 softmax \u8f93\u51fa\u7684\u5bfc\u6570<\/h4>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>E<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><\/mrow><\/mfrac><mo>=<\/mo><mo>\u2212<\/mo><mfrac><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><\/mfrac><\/math>\n\n\n\n<h4 class=\"wp-block-heading\">\u2461 softmax \u8f93\u51fa\u5bf9 z \u7684\u504f\u5bfc<\/h4>\n\n\n\n<p>\u5206\u60c5\u51b5\u8ba8\u8bba\uff08\u8fd9\u662f\u5173\u952e\uff09\uff1a <\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mi>z<\/mi><mi>k<\/mi><\/msub><\/mrow><\/mfrac><mo>=<\/mo><mrow data-mjx-texclass=\"INNER\"><mo data-mjx-texclass=\"OPEN\">{<\/mo><mtable columnalign=\"left left\" columnspacing=\"1em\" rowspacing=\".2em\"><mtr><mtd><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><\/mtd><mtd><mtext>if&nbsp;<\/mtext><mi>i<\/mi><mo>=<\/mo><mi>k<\/mi><\/mtd><\/mtr><mtr><mtd><mo>\u2212<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><\/mtd><mtd><mtext>if&nbsp;<\/mtext><mi>i<\/mi><mo>\u2260<\/mo><mi>k<\/mi><\/mtd><\/mtr><\/mtable><mo data-mjx-texclass=\"CLOSE\" fence=\"true\" stretchy=\"true\" symmetric=\"true\"><\/mo><\/mrow><\/math>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd36 \u7b2c\u4e09\u6b65\uff1a\u5408\u5e76\u4e24\u90e8\u5206<\/h3>\n\n\n\n<p>\u5c06\u4e0a\u9762\u4e24\u9879\u76f8\u4e58\u5e76\u76f8\u52a0\uff1a <\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>E<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mi>z<\/mi><mi>k<\/mi><\/msub><\/mrow><\/mfrac><mo>=<\/mo><munderover><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mrow><mi>n<\/mi><\/mrow><\/munderover><mrow data-mjx-texclass=\"INNER\"><mo data-mjx-texclass=\"OPEN\">(<\/mo><mo>\u2212<\/mo><mfrac><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><\/mfrac><mo data-mjx-texclass=\"CLOSE\">)<\/mo><\/mrow><mo>\u22c5<\/mo><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mi>z<\/mi><mi>k<\/mi><\/msub><\/mrow><\/mfrac><\/math>\n\n\n\n<p>\u6211\u4eec\u5c06\u5b83\u62c6\u5206\u4e3a\u4e24\u90e8\u5206\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u5f53 i = k\uff1a<\/h4>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mrow data-mjx-texclass=\"INNER\"><mo data-mjx-texclass=\"OPEN\">(<\/mo><mo>\u2212<\/mo><mfrac><msub><mi>Y<\/mi><mi>k<\/mi><\/msub><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><\/mfrac><mo data-mjx-texclass=\"CLOSE\">)<\/mo><\/mrow><mo>\u22c5<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mo>\u2212<\/mo><msub><mi>Y<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><\/math>\n\n\n\n<h4 class=\"wp-block-heading\">\u5f53 i \u2260 k\uff1a<\/h4>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><munder><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>i<\/mi><mo>\u2260<\/mo><mi>k<\/mi><\/mrow><\/munder><mrow data-mjx-texclass=\"INNER\"><mo data-mjx-texclass=\"OPEN\">(<\/mo><mo>\u2212<\/mo><mfrac><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><\/mfrac><mo data-mjx-texclass=\"CLOSE\">)<\/mo><\/mrow><mo>\u22c5<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>i<\/mi><\/msub><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><munder><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>i<\/mi><mo>\u2260<\/mo><mi>k<\/mi><\/mrow><\/munder><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><mo>=<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><munder><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>i<\/mi><mo>\u2260<\/mo><mi>k<\/mi><\/mrow><\/munder><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><\/math>\n\n\n\n<p>\u800c one-hot \u7f16\u7801\u4e0b <\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><munder><mo data-mjx-texclass=\"OP\">\u2211<\/mo><mrow><mi>i<\/mi><mo>\u2260<\/mo><mi>k<\/mi><\/mrow><\/munder><msub><mi>Y<\/mi><mi>i<\/mi><\/msub><mo>=<\/mo><mn>1<\/mn><mo>\u2212<\/mo><msub><mi>Y<\/mi><mi>k<\/mi><\/msub><\/math>\n\n\n\n<p>\uff0c\u56e0\u6b64\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>E<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mi>z<\/mi><mi>k<\/mi><\/msub><\/mrow><\/mfrac><mo>=<\/mo><mo>\u2212<\/mo><msub><mi>Y<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><msub><mi>Y<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><mo>\u2212<\/mo><msub><mi>Y<\/mi><mi>k<\/mi><\/msub><\/math>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u603b\u7ed3\u7ed3\u679c<\/h2>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>E<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><msub><mi>z<\/mi><mi>k<\/mi><\/msub><\/mrow><\/mfrac><mo>=<\/mo><msub><mrow><mi>y<\/mi><\/mrow><mi>k<\/mi><\/msub><mo>\u2212<\/mo><msub><mi>Y<\/mi><mi>k<\/mi><\/msub><mstyle scriptlevel=\"0\"><mspace width=\"1em\"><\/mspace><\/mstyle><mo stretchy=\"false\">\u21d2<\/mo><mstyle scriptlevel=\"0\"><mspace width=\"1em\"><\/mspace><\/mstyle><mfrac><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mi>E<\/mi><\/mrow><mrow><mi mathvariant=\"normal\">\u2202<\/mi><mrow><mi mathvariant=\"bold\">z<\/mi><\/mrow><\/mrow><\/mfrac><mo>=<\/mo><mrow><mrow><mi mathvariant=\"bold\">y<\/mi><\/mrow><\/mrow><mo>\u2212<\/mo><mrow><mi mathvariant=\"bold\">Y<\/mi><\/mrow><\/math>\n\n\n\n<p>\u8fd9\u4e2a\u63a8\u5bfc\u6210\u7acb\u7684\u524d\u63d0\u662f<strong>\u4f7f\u7528 softmax + cross entropy \u7684\u7ec4\u5408\uff0c\u5e76\u4e14\u6807\u7b7e\u662f one-hot \u5411\u91cf<\/strong>\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83c\udf93 \u5ef6\u4f38\u8bf4\u660e\uff1a\u4e3a\u4ec0\u4e48\u8fd9\u5f88\u91cd\u8981\uff1f<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8fd9\u4e2a\u516c\u5f0f\u4f7f\u5f97\u53cd\u5411\u4f20\u64ad\u6781\u5176\u9ad8\u6548\uff0c\u907f\u514d\u4e86\u663e\u5f0f\u6c42\u5bfc\u548c\u94fe\u5f0f\u5c55\u5f00\uff1b<\/li>\n\n\n\n<li>\u6846\u67b6\u5982 PyTorch\u3001TensorFlow \u5728 <code>CrossEntropyLoss<\/code> \u4e2d\u81ea\u52a8\u878d\u5408\u4e86 softmax \u548c log \u64cd\u4f5c\uff0c\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u7cbe\u786e\u6c42\u5bfc\uff1b<\/li>\n\n\n\n<li>\u4e5f\u8bf4\u660e\u4e86 softmax \u8f93\u51fa\u5df2\u7ecf\u662f\u6982\u7387\u5206\u5e03\uff0c\u635f\u5931\u7684\u68af\u5ea6\u672c\u8d28\u4e0a\u5c31\u662f\u201c\u9884\u6d4b\u8bef\u5dee\u201d\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4e0a\u9762\u5c31\u662f\u591a\u5c42\u795e\u7ecf\u7f51\u7edc\u7684\u7b2c\u4e8c\u4e2a\u6539\u8fdb\uff0c\u8fd9\u4e2a\u662f\u6bd4\u539f\u6765\u7684E\u8981\u597d\u7684\uff08\u2193\uff09<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mi>E<\/mi><mo>=<\/mo><mfrac><mn>1<\/mn><mn>2<\/mn><\/mfrac><mrow><mo stretchy=\"false\">|<\/mo><\/mrow><mi>y<\/mi><mo>\u2212<\/mo><mi>Y<\/mi><msup><mo stretchy=\"false\">|<\/mo><mn>2<\/mn><\/msup><\/math>\n\n\n\n<p>\u591a\u5c42\u795e\u7ecf\u7f51\u7edc\u7684\u7b2c\u4e09\u4e2a\u6539\u8fdb\u662f\u968f\u673a\u68af\u5ea6\u4e0b\u964d\u6cd5SGD\uff0c\u8981\u70b9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4e0d\u7528\u8f93\u5165\u6bcf\u4e2a\u6837\u672c\u5c31\u53bb\u66f4\u65b0\u53c2\u6570\uff1b\u800c\u662f\u8f93\u5165\u4e00\u6279\u6837\u672c\uff08BATCH\/MINI-MATCH)\uff0c\u6c42\u51fa\u8fd9\u4e9b\u6837\u672c\u7684\u68af\u5ea6\u5e73\u5747\u503c\u540e\uff0c\u6839\u636e\u5e73\u5747\u503c\u6765\u6539\u53d8\u53c2\u6570\u3002<\/li>\n\n\n\n<li><strong><mark style=\"background-color:#f78da7\" class=\"has-inline-color has-black-color\">\u5728\u795e\u7ecf\u7f51\u7edc\u8bad\u7ec3\u4e2d\uff0c\u6837\u672c\u6570\uff08BATCH-SIZE\uff09\u5927\u6982\u8bbe\u7f6e\u572850-200\u4e4b\u95f4<\/mark><\/strong>\n<ul class=\"wp-block-list\">\n<li><mark style=\"background-color:#f78da7\" class=\"has-inline-color\">\u6309\u7167BATCH\u904d\u5386\u6240\u6709\u8bad\u7ec3\u6837\u672c\u4e00\u6b21\uff0c\u8fd9\u4e00\u6b21\u79f0\u4e3a\u4e00\u4e2a<strong>EPOCH<\/strong>\u3002<\/mark><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u5bf9\u4e8e\u6240\u6709\u8bad\u7ec3\u6570\u636e\uff0c\u6839\u636eBATCH-SIZE\u5206\u5272\u4e3a\u4e0d\u540c\u7684BATCH\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>\u5b9e\u9645\u8bad\u7ec3\u4e2d\uff0c\u6839\u636eBATCH\u591a\u6b21\u904d\u5386\u6240\u6709\u8bad\u7ec3\u6837\u672c\uff0c\u5373\u8bad\u7ec3\u4e0d\u6b62\u4e00\u4e2aEPOCH\uff0c\u589e\u52a0BATCH\u4e2d\u8bad\u7ec3\u6837\u672c\u7684\u968f\u673a\u6027\u3002<\/strong><\/p>\n\n\n\n<p><em>\u672c\u7ae0\u8282\u7684\u601d\u8003\u90e8\u5206\uff0c\u8bf7\u81f3\u7b2c\u4e8c\u9875\u7ee7\u7eed\u9605\u8bfb\ud83d\udc47<\/em><\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<p class=\"has-medium-font-size\">\u601d\u8003\uff1a\u5728\u673a\u5668\u5b66\u4e60\u4e2d\uff0c\u5c42\u4e0e\u5c42\u4e4b\u95f4\u7684\u975e\u7ebf\u6027\u51fd\u6570sigmoid\u4e3af(x)=1\/[1+e<sup>(-x)<\/sup>]\u3002\u8fd9\u4e2a\u51fd\u6570\u57280\u5904\u7684\u5bfc\u6570\u4e3a0.25\u3002\u5b83\u4e0d\u80fd\u5f88\u597d\u7684\u6a21\u62df\u9636\u8dc3\u51fd\u6570\u3002\u56e0\u4e3a\u9636\u8dc3\u51fd\u6570\u57280\u5904\u7684\u5bfc\u6570\u662f\u65e0\u9650\u5927\u3002\u56e0\u6b64\u6709\u4eba\u63d0\u51fa\u4e86\u5e26\u53c2\u6570\u03b2\u7684sigmoid\u51fd\u6570sigmoid\u4e3af(x)=1\/[1+e<sup>(-\u03b2x)<\/sup>]\uff0c\u5f53\u03b2\u8d8a\u5927\uff0csigmoid\u4e0a\u5347\u7684\u5c31\u8d8a\u5feb\u3002\u4e5f\u5c31\u662f\u66f4\u597d\u7684\u6a21\u62df\u4e86\u9636\u8dc3\u51fd\u6570\u3002\u90a3\u4e3a\u4ec0\u4e48\u6211\u4eec\u4e0d\u628a\u03b2\u53d6\u5f97\u5f88\u5927\uff0c\u8fd9\u6837sigmoid\u5c31\u66f4\u52a0\u50cf\u9636\u8dc3\u51fd\u6570\u4e86\u3002\u5728\u5b9e\u9645\u4e2d\u5374\u4ece\u4e0d\u91c7\u7528\u3002\u8bf7\u95ee\u9664\u4e86\u591a\u4e86\u4e00\u4e2a\u53c2\u6570\u5bfc\u81f4\u7684\u4e0d\u65b9\u4fbf\u5916\uff0c\u8fd8\u6709\u5176\u4ed6\u7406\u7531\u8bf4\u660e\u4e3a\u4ec0\u4e48\u6211\u4eec\u4e0d\u91c7\u7528\u8fd9\u6837\u7684\u975e\u7ebf\u6027\u51fd\u6570\u5417\uff1f<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u6df1\u523b\u800c\u7ecf\u5178\u7684\u95ee\u9898\uff0c\u6d89\u53ca\u795e\u7ecf\u7f51\u7edc\u4e2d<strong>\u6fc0\u6d3b\u51fd\u6570\u7684\u53ef\u5bfc\u6027\u3001\u68af\u5ea6\u4f20\u64ad\u3001\u6570\u503c\u7a33\u5b9a\u6027\u548c\u8bad\u7ec3\u6548\u7387<\/strong>\u7b49\u6838\u5fc3\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u4e8b\u5b9e\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>\u03b2 \u8d8a\u5927\uff0cSigmoid \u8d8a\u63a5\u8fd1\u9636\u8dc3\u51fd\u6570\uff1b\u4f46\u6211\u4eec\u5b9e\u9645\u4e0a\u5e76\u4e0d\u4f1a\u8ba9 \u03b2 \u5f88\u5927\u3002\u4e3a\u4ec0\u4e48\uff1f<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p>\u9664\u4e86\u63d0\u5230\u7684\u201c\u591a\u4e86\u4e00\u4e2a\u53c2\u6570 \u03b2 \u4e0d\u65b9\u4fbf\u8c03\u6574\u201d\u8fd9\u4e2a\u8868\u9762\u539f\u56e0\uff0c<strong>\u5b9e\u9645\u4e0a\u6709\u66f4\u5173\u952e\u7684\u3001\u7406\u8bba\u4e0e\u5b9e\u8df5\u4e0a\u7684\u6df1\u5c42\u7406\u7531<\/strong>\u3002\u4e0b\u9762\u6211\u4eec\u6765\u9010\u4e00\u5206\u6790\uff1a<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u03b2 \u8fc7\u5927\u5bfc\u81f4\u68af\u5ea6\u6d88\u5931\uff08Gradient Vanishing\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u5148\u770b\u5bfc\u6570\uff1a<\/h3>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mfrac><mn>1<\/mn><mrow><mn>1<\/mn><mo>+<\/mo><msup><mi>e<\/mi><mrow><mo>\u2212<\/mo><mi>\u03b2<\/mi><mi>x<\/mi><\/mrow><\/msup><\/mrow><\/mfrac><mstyle scriptlevel=\"0\"><mspace width=\"1em\"><\/mspace><\/mstyle><mo stretchy=\"false\">\u21d2<\/mo><mstyle scriptlevel=\"0\"><mspace width=\"1em\"><\/mspace><\/mstyle><msup><mi>f<\/mi><mo>\u2032<\/mo><\/msup><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>\u03b2<\/mi><mo>\u22c5<\/mo><mi>f<\/mi><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo>\u22c5<\/mo><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><mi>f<\/mi><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo stretchy=\"false\">)<\/mo><\/math>\n\n\n\n<p>\u6700\u5927\u5bfc\u6570\u51fa\u73b0\u5728 x = 0 \u65f6\uff1a<\/p>\n\n\n\n<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mi>f<\/mi><mo stretchy=\"false\">(<\/mo><mn>0<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mfrac><mn>1<\/mn><mn>2<\/mn><\/mfrac><mstyle scriptlevel=\"0\"><mspace width=\"1em\"><\/mspace><\/mstyle><mo stretchy=\"false\">\u21d2<\/mo><mstyle scriptlevel=\"0\"><mspace width=\"1em\"><\/mspace><\/mstyle><msup><mi>f<\/mi><mo>\u2032<\/mo><\/msup><mo stretchy=\"false\">(<\/mo><mn>0<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>\u03b2<\/mi><mo>\u22c5<\/mo><mfrac><mn>1<\/mn><mn>4<\/mn><\/mfrac><\/math>\n\n\n\n<p>\u867d\u7136\u5728 x = 0 \u9644\u8fd1\u5bfc\u6570\u53d8\u5927\u4e86\uff0c\u4f46\u5173\u952e\u5728\u4e8e<strong>\u8fdc\u79bb 0 \u7684\u533a\u57df\u4f1a\u53d1\u751f\u4ec0\u4e48\uff1f<\/strong><\/p>\n\n\n\n<p>\u5f53 |x| \u589e\u5927\u65f6\uff0cf(x) \u8d8b\u8fd1\u4e8e 0 \u6216 1\uff0c\u6b64\u65f6\uff1a f(x)(1\u2212f(x))\u21920\u21d2f\u2032(x)\u21920<\/p>\n\n\n\n<p>\u800c\u4e14\u968f\u7740 \u03b2 \u8d8a\u5927\uff0c\u6536\u655b\u5f97\u8d8a\u5feb\uff0c<strong>\u7edd\u5927\u591a\u6570\u8f93\u5165\u90fd\u4f1a\u843d\u5165\u6781\u5c0f\u7684\u68af\u5ea6\u533a\u57df<\/strong>\u3002\u8fd9\u4f1a\u5bfc\u81f4\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53cd\u5411\u4f20\u64ad\u65f6\u68af\u5ea6\u63a5\u8fd1\u4e8e 0\uff1b<\/li>\n\n\n\n<li>\u7f51\u7edc\u6743\u91cd\u51e0\u4e4e\u65e0\u6cd5\u66f4\u65b0\uff1b<\/li>\n\n\n\n<li>\u7f51\u7edc\u9677\u5165\u201c\u5b66\u4e60\u762b\u75ea\u201d\u72b6\u6001\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u6b63\u662f<strong>\u68af\u5ea6\u6d88\u5931<\/strong>\u95ee\u9898\u7684\u5178\u578b\u6765\u6e90\u4e4b\u4e00\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u03b2 \u8d8a\u5927\uff0c\u6570\u503c\u4e0d\u7a33\u5b9a\uff08Numerical Instability\uff09<\/h2>\n\n\n\n<p>\u5f53 \u03b2 \u5f88\u5927\u65f6\uff0csigmoid \u4e2d\u7684\u6307\u6570\u9879\uff1a e<sup>\u2212\u03b2x<\/sup><\/p>\n\n\n\n<p>\u5f88\u5bb9\u6613<strong>\u6ea2\u51fa\u6216\u4e0b\u6ea2<\/strong>\uff0c\u5c24\u5176\u5f53 \u03b2 \u662f\u51e0\u5341\u3001\u51e0\u767e\u65f6\uff0c\u5728 float32 \u7cbe\u5ea6\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5bf9\u4e8e\u8f83\u5927\u8d1f\u6570\uff0ce<sup>\u2212\u03b2x<\/sup> -&gt; \u221e\uff0c\u9020\u6210 \u6ea2\u51fa\uff1b<\/li>\n\n\n\n<li>\u5bf9\u4e8e\u8f83\u5927\u6b63\u6570\uff0ce<sup>\u2212\u03b2x<\/sup>  -&gt; 0\uff0c\u9020\u6210 \u4e0b\u6ea2\uff1b<\/li>\n\n\n\n<li>\u6700\u7ec8\u7ed3\u679c\u8981\u4e48\u662f 0\u3001\u8981\u4e48\u662f 1\uff0c\u5b8c\u5168\u5931\u53bb\u8fde\u7eed\u6027\u548c\u53ef\u5bfc\u6027\uff1b<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u4f1a\u76f4\u63a5\u5bfc\u81f4\u6a21\u578b\u7684\u6570\u503c\u4e0d\u7a33\u5b9a\u6216\u8bad\u7ec3\u7206\u70b8\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u4e0d\u5229\u4e8e\u68af\u5ea6\u4e0b\u964d\u7684\u52a8\u6001\u8c03\u6574\uff08\u4f18\u5316\u56f0\u96be\uff09<\/h2>\n\n\n\n<p>\u5f53\u6fc0\u6d3b\u51fd\u6570\u63a5\u8fd1\u9636\u8dc3\u51fd\u6570\u65f6\uff0c\u7f51\u7edc\u672c\u8d28\u4e0a\u53d8\u6210\u4e86\u4e00\u4e2a\u201c\u7ec4\u5408\u903b\u8f91\u7f51\u7edc\u201d\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53ea\u5728\u6781\u5c11\u6570\u8fb9\u754c\u9644\u8fd1\u53ef\u8c03\u6574\uff1b<\/li>\n\n\n\n<li>\u5927\u591a\u6570\u795e\u7ecf\u5143\u8f93\u51fa\u51e0\u4e4e\u6052\u5b9a\uff080\u62161\uff09\uff1b<\/li>\n\n\n\n<li>\u5bfc\u81f4\u6574\u4e2a\u7f51\u7edc\u7684\u53c2\u6570\u7a7a\u95f4\u53d8\u5f97<strong>\u975e\u5e38\u4e0d\u8fde\u7eed<\/strong>\uff0c\u6781\u96be\u4f18\u5316\uff1b<\/li>\n\n\n\n<li>\u4f18\u5316\u5668\u5982 SGD\u3001Adam \u65e0\u6cd5\u627e\u5230\u6709\u6548\u7684\u4e0b\u964d\u65b9\u5411\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u76f8\u5f53\u4e8e\u4f60\u7ed9\u7f51\u7edc\u8bbe\u7f6e\u4e86\u4e00\u4e2a\u201c\u975e\u5e38\u9661\u5ced\u7684\u5c71\u201d\uff0c\u4f46\u53c8\u4e0d\u7ed9\u5b83\u7ef3\u7d22\u2014\u2014\u68af\u5ea6\uff01<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u8868\u8fbe\u80fd\u529b\u53cd\u800c\u4e0d\u5347\u53cd\u964d\uff08\u53ef\u7ec4\u5408\u6027\u4e0b\u964d\uff09<\/h2>\n\n\n\n<p>\u867d\u7136 \u03b2 \u5927\u7684 sigmoid \u66f4\u63a5\u8fd1\u9636\u8dc3\u51fd\u6570\uff0c\u4f46\u795e\u7ecf\u7f51\u7edc\u7684\u5f3a\u5927\u80fd\u529b<strong>\u4e0d\u5728\u4e8e\u7cbe\u786e\u6a21\u62df\u9636\u8dc3\u51fd\u6570<\/strong>\uff0c\u800c\u5728\u4e8e<strong>\u901a\u8fc7\u591a\u4e2a\u5149\u6ed1\u3001\u975e\u7ebf\u6027\u5c42\u7ec4\u5408\u51fa\u590d\u6742\u51fd\u6570<\/strong>\u3002<\/p>\n\n\n\n<p>\u03b2 \u592a\u5927 \u2192 \u51fd\u6570\u51e0\u4e4e\u53d8\u6210\u786c\u95e8\u9650 \u2192 \u7f51\u7edc\u9000\u5316\u6210\u4e86\u201c\u786c\u7f16\u7801\u7684\u89c4\u5219\u7cfb\u7edf\u201d\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7f3a\u4e4f\u5fae\u8c03\u80fd\u529b\uff1b<\/li>\n\n\n\n<li>\u53ef\u5fae\u6027\u4e0b\u964d\uff1b<\/li>\n\n\n\n<li>\u6cdb\u5316\u80fd\u529b\u4e5f\u53d8\u5dee\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u73b0\u4ee3\u66ff\u4ee3\u54c1\u8fdc\u4f18\u4e8e\u5b83\uff08\u5982 ReLU\uff09<\/h2>\n\n\n\n<p>\u6b63\u56e0\u4e3a\u4e0a\u9762\u8fd9\u4e9b\u95ee\u9898\uff0c\u73b0\u4ee3\u6df1\u5ea6\u5b66\u4e60\u4e2d<strong>\u57fa\u672c\u4e0d\u4f1a\u7528 sigmoid\uff08\u65e0\u8bba\u662f\u5426\u5e26 \u03b2\uff09\u4f5c\u4e3a\u9690\u85cf\u5c42\u6fc0\u6d3b\u51fd\u6570<\/strong>\uff0c\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ReLU<\/strong>: \u7b80\u5355\u9ad8\u6548\uff0c\u89e3\u51b3\u68af\u5ea6\u6d88\u5931\uff1b<\/li>\n\n\n\n<li><strong>Leaky ReLU \/ ELU<\/strong>\uff1a\u5f15\u5165\u8d1f\u503c\uff0c\u589e\u5f3a\u8868\u8fbe\u529b\uff1b<\/li>\n\n\n\n<li><strong>GELU \/ Swish<\/strong>\uff1a\u7ed3\u5408 ReLU \u7684\u7a00\u758f\u6027\u4e0e sigmoid \u7684\u5e73\u6ed1\u6027\uff1b<\/li>\n\n\n\n<li><strong>Softmax<\/strong>\uff1a\u7528\u4e8e\u8f93\u51fa\u5c42\u6982\u7387\u5efa\u6a21\uff0c\u4e0d\u53c2\u4e0e\u4e2d\u95f4\u5c42\u6fc0\u6d3b\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u603b\u7ed3\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u91c7\u7528 \u03b2 \u5f88\u5927\u7684 sigmoid\uff1f<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u95ee\u9898<\/th><th>\u539f\u56e0<\/th><\/tr><\/thead><tbody><tr><td><strong>\u68af\u5ea6\u6d88\u5931<\/strong><\/td><td>\u8fdc\u79bb 0 \u533a\u57df\u68af\u5ea6\u8d8b\u8fd1 0\uff0c\u8bad\u7ec3\u505c\u6ede<\/td><\/tr><tr><td><strong>\u6570\u503c\u4e0d\u7a33\u5b9a<\/strong><\/td><td>\u5927\u6307\u6570\u9879\u9020\u6210 overflow\/underflow<\/td><\/tr><tr><td><strong>\u4f18\u5316\u56f0\u96be<\/strong><\/td><td>\u975e\u7ebf\u6027\u592a\u5f3a \u2192 \u4e0d\u53ef\u5fae \u2192 \u5b66\u4e0d\u52a8<\/td><\/tr><tr><td><strong>\u8868\u8fbe\u80fd\u529b\u5dee<\/strong><\/td><td>\u4e0d\u80fd\u5fae\u8c03\u3001\u53ef\u7ec4\u5408\u6027\u5dee<\/td><\/tr><tr><td><strong>\u5df2\u6709\u66ff\u4ee3\u65b9\u6848\u66f4\u4f18<\/strong><\/td><td>ReLU\/GELU\/Swish \u66f4\u5feb\u66f4\u7a33\u5b9a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><em>\u7528Python\u7684PyTorch\/Numpy \u7684\u6a21\u62df\u4f8b\u5b50\u6765\u76f4\u89c2\u611f\u53d7\u8fd9\u4e9b\u95ee\u9898\uff0c\u8bf7\u5230\u7b2c3\u9875\u7ee7\u7eed\u9605\u8bfb\ud83d\udc47<\/em><\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<p>Python\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import matplotlib\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport platform\nsystem = platform.system()\nif system == \"Windows\":\n    matplotlib.rcParams&#91;'font.family'] = 'Microsoft YaHei'\nelif system == \"Darwin\":\n    matplotlib.rcParams&#91;'font.family'] = 'Arial Unicode MS'\nelse:\n    matplotlib.rcParams&#91;'font.family'] = 'SimHei'\nmatplotlib.rcParams&#91;'axes.unicode_minus'] = False\n# \u5b9a\u4e49\u4e0d\u540c \u03b2 \u503c\u4e0b\u7684 sigmoid \u51fd\u6570\ndef sigmoid_beta(x, beta):\n    return 1 \/ (1 + np.exp(-beta * x))\n\ndef sigmoid_derivative(x, beta):\n    s = sigmoid_beta(x, beta)\n    return beta * s * (1 - s)\n\n# \u8bbe\u7f6e \u03b2 \u503c\u5217\u8868\nbetas = &#91;0.5, 1, 5, 10, 50]\nx = np.linspace(-6, 6, 500)\n\n# \u4f5c\u56fe\uff1aSigmoid \u66f2\u7ebf\nplt.figure(figsize=(10, 6))\nfor beta in betas:\n    y = sigmoid_beta(x, beta)\n    plt.plot(x, y, label=f\"\u03b2 = {beta}\")\nplt.title(\"\u4e0d\u540c \u03b2 \u503c\u4e0b\u7684 Sigmoid \u51fd\u6570\")\nplt.xlabel(\"x\")\nplt.ylabel(\"sigmoid(x)\")\nplt.legend()\nplt.grid(True)\nplt.tight_layout()\nplt.show()\n\n# \u4f5c\u56fe\uff1aSigmoid \u5bfc\u6570\u66f2\u7ebf\nplt.figure(figsize=(10, 6))\nfor beta in betas:\n    dy = sigmoid_derivative(x, beta)\n    plt.plot(x, dy, label=f\"\u03b2 = {beta}\")\nplt.title(\"\u4e0d\u540c \u03b2 \u503c\u4e0b\u7684 Sigmoid \u51fd\u6570\u5bfc\u6570\")\nplt.xlabel(\"x\")\nplt.ylabel(\"sigmoid'(x)\")\nplt.legend()\nplt.grid(True)\nplt.tight_layout()\nplt.show()\n<\/code><\/pre>\n\n\n\n<p>\u6548\u679c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1504\" height=\"997\" src=\"https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-67.png\" alt=\"\" class=\"wp-image-3277\" srcset=\"https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-67.png 1504w, https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-67-300x199.png 300w, https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-67-1024x679.png 1024w, https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-67-768x509.png 768w\" sizes=\"auto, (max-width: 1504px) 100vw, 1504px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1504\" height=\"997\" src=\"https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-68.png\" alt=\"\" class=\"wp-image-3278\" srcset=\"https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-68.png 1504w, https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-68-300x199.png 300w, https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-68-1024x679.png 1024w, https:\/\/www.leexinghai.com\/aic\/wp-content\/uploads\/2025\/08\/image-68-768x509.png 768w\" sizes=\"auto, (max-width: 1504px) 100vw, 1504px\" \/><\/figure>\n\n\n\n<p>\u4e0a\u9762\u662f\u4e24\u4e2a\u56fe\uff0c\u5c55\u793a\u4e86\u4e0d\u540c \u03b2 \u503c\u4e0b\u7684 sigmoid \u51fd\u6570\u53ca\u5176\u5bfc\u6570\uff1a<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcc8 \u56fe\u4e00\uff1a<strong>Sigmoid \u51fd\u6570\u968f \u03b2 \u7684\u53d8\u5316<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5f53 \u03b2 \u8d8a\u5927\uff0csigmoid \u8d8b\u8fd1\u4e8e\u9636\u8dc3\u51fd\u6570\uff1b<\/li>\n\n\n\n<li>\u03b2 = 50 \u65f6\uff0c\u51fd\u6570\u51e0\u4e4e\u53ea\u5728 x=0 \u9644\u8fd1\u53d1\u751f\u5267\u70c8\u8df3\u8dc3\uff0c\u5176\u5b83\u533a\u57df\u51e0\u4e4e\u4e3a 0 \u6216 1\uff1b<\/li>\n\n\n\n<li>\u8fd9\u5c31\u9020\u6210\u4e86\u591a\u6570\u8f93\u5165\u4e0b\u7684\u8f93\u51fa\u201c\u6241\u5e73\u201d\u6216\u201c\u9971\u548c\u201d\uff0c\u65e0\u6cd5\u6709\u6548\u533a\u5206\u6837\u672c\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcc9 \u56fe\u4e8c\uff1a<strong>Sigmoid \u5bfc\u6570\u968f \u03b2 \u7684\u53d8\u5316<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u03b2 \u8d8a\u5927\uff0c\u5bfc\u6570\u5cf0\u503c\u8d8a\u9ad8\uff0c\u4f46<strong>\u53ea\u96c6\u4e2d\u5728 x=0 \u9644\u8fd1\u4e00\u5c0f\u6bb5\u8303\u56f4\u5185<\/strong>\uff1b<\/li>\n\n\n\n<li>\u5176\u4f59\u533a\u57df\u5bfc\u6570\u51e0\u4e4e\u4e3a 0 \u2192 \u53cd\u5411\u4f20\u64ad\u65e0\u68af\u5ea6 \u2192 <strong>\u8bad\u7ec3\u505c\u6ede<\/strong>\uff1b<\/li>\n\n\n\n<li>\u6240\u4ee5\u867d\u7136\u7406\u8bba\u4e0a\u201c\u53d8\u9661\u66f4\u50cf\u9636\u8dc3\u201d\uff0c\u4f46\u5b9e\u9645\u4e0a\u53d8\u5f97\u201c\u4e0d\u53ef\u5b66\u4e60\u201d\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd27 \u5c0f\u7ed3\uff1a<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u03b2 \u503c<\/th><th>Sigmoid \u5f62\u72b6<\/th><th>\u5bfc\u6570\u884c\u4e3a<\/th><th>\u5b9e\u9645\u540e\u679c<\/th><\/tr><\/thead><tbody><tr><td>\u5c0f\uff08\u5982 0.5\uff09<\/td><td>\u975e\u7ebf\u6027\u5f31\u3001\u8fd1\u4f3c\u7ebf\u6027<\/td><td>\u5bfc\u6570\u5c0f\u4f46\u5e73\u6ed1<\/td><td>\u53ef\u5b66\u4e60\uff0c\u4f46\u8868\u8fbe\u529b\u4e0d\u8db3<\/td><\/tr><tr><td>\u4e2d\uff08\u5982 1\uff09<\/td><td>\u9002\u4e2d<\/td><td>\u5bfc\u6570\u9002\u4e2d\u3001\u5206\u5e03\u5e7f<\/td><td>\u5e38\u7528\u4e8e\u8f93\u51fa\u5c42\u6982\u7387<\/td><\/tr><tr><td>\u5927\uff08\u5982 10, 50\uff09<\/td><td>\u8fd1\u4f3c\u9636\u8dc3<\/td><td>\u4ec5\u5728 x=0 \u9644\u8fd1\u6709\u68af\u5ea6<\/td><td>\u68af\u5ea6\u6d88\u5931\uff0c\u8bad\u7ec3\u762b\u75ea<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u9636\u8dc3\u51fd\u6570sigmoid\u7684\u5bfc\u6570\u6709\uff1a \u03c6\u2032(x)=(11+e\u2212x)\u2032=e\u2212x(1+e\u2212x)2=[1\u221211+e\u2212x] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3045,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63],"tags":[],"class_list":["post-3272","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mlsh"],"_links":{"self":[{"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/posts\/3272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/comments?post=3272"}],"version-history":[{"count":4,"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/posts\/3272\/revisions"}],"predecessor-version":[{"id":3279,"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/posts\/3272\/revisions\/3279"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/media\/3045"}],"wp:attachment":[{"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/media?parent=3272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/categories?post=3272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.leexinghai.com\/aic\/wp-json\/wp\/v2\/tags?post=3272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}