{"id":8740,"date":"2024-05-28T17:01:01","date_gmt":"2024-05-28T09:01:01","guid":{"rendered":""},"modified":"2024-05-28T17:01:01","modified_gmt":"2024-05-28T09:01:01","slug":"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled","status":"publish","type":"post","link":"https:\/\/mushiming.com\/8740.html","title":{"rendered":"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled"},"content":{"rendered":"

\u8bba\u6587\u4e2d\u89e3\u91ca\u662f\uff1a\u5411\u91cf\u7684\u70b9\u79ef\u7ed3\u679c\u4f1a\u5f88\u5927\uff0c\u5c06softmax\u51fd\u6570push\u5230\u68af\u5ea6\u5f88\u5c0f\u7684\u533a\u57df\uff0cscaled\u4f1a\u7f13\u89e3\u8fd9\u79cd\u73b0\u8c61\u3002\u600e\u4e48\u7406\u89e3\u5c06sotfmax\u51fd\u6570push\u5230\u68af\u5ea6\u5f88\u5c0f\u533a\u57df\uff1f\u8fd8\u6709\u4e3a\u4ec0\u4e48scaled\u662f\u7ef4\u5ea6\u7684\u6839\u53f7\uff0c\u4e0d\u662f\u5176\u4ed6\u7684\u6570\uff1f<\/p>\n

\n

\u7b54\u6848\uff1aq\uff0ck\u5411\u91cf\u70b9\u79ef\u540e\u7684\u7ed3\u679c\u6570\u91cf\u7ea7\u53d8\u5927\uff0c\u7ecf\u5386\u8fc7softmax\u51fd\u6570\u7684\u5f52\u4e00\u5316\u4e4b\u540e\uff0c\u540e\u7eed\u53cd\u5411\u4f20\u64ad\u7684\u8fc7\u7a0b\u4e2d\u68af\u5ea6\u4f1a\u5f88\u5c0f\uff0c\u9020\u6210\u68af\u5ea6\u6d88\u5931\u3002\u8fdb\u884cscaled\u80fd\u591f\u7f13\u89e3\u8fd9\u79cd\u60c5\u51b5\u3002<\/strong><\/span><\/p>\n<\/blockquote>\n

Multi-head Attention\u4e3a\u4ec0\u4e48\u8981\u505ascaled - \u5377\u738b\u674e\u72d7\u86cb\u7684\u6587\u7ae0 - \u77e5\u4e4e<\/p>\n

\u76ee\u5f55<\/strong><\/p>\n

\u4e3a\u4ec0\u4e48\u4f1a\u68af\u5ea6\u6d88\u5931\u7684\u539f\u56e0\uff1f<\/p>\n

\u5728self-attention\u4e2d\u4e3a\u4ec0\u4e48\u8981\u9664\u4ee5\uff1f<\/p>\n

\u4e3a\u4ec0\u4e48\u8981\u5047\u8bbe\u4e3a\u5747\u503c\u4e3a0\uff0c\u65b9\u5dee\u4e3a1\uff1f<\/p>\n

\u4e3a\u4ec0\u4e48\u5728\u5176\u4ed6 softmax \u7684\u5e94\u7528\u573a\u666f\uff0c\u4e0d\u9700\u8981\u505a scaled\uff1f<\/p>\n

\u4e3a\u4ec0\u4e48\u5728\u5206\u7c7b\u5c42\uff08\u6700\u540e\u4e00\u5c42\uff09\uff0c\u4f7f\u7528\u975e scaled \u7684 softmax\uff1f<\/p>\n

\u6ce8\u610f\u529b\u673a\u5236\u7684softmax\u6ea2\u51fa\u600e\u4e48\u89e3\u51b3\uff1f<\/p>\n


\n

\u4e3a\u4ec0\u4e48\u4f1a\u68af\u5ea6\u6d88\u5931\u7684\u539f\u56e0\uff1f<\/strong><\/span><\/h4>\n

\u6570\u91cf\u7ea7\u5bf9softmax\u5f97\u5230\u7684\u5206\u5e03\u5f71\u54cd\u975e\u5e38\u5927\u3002\u5728\u6570\u91cf\u7ea7\u8f83\u5927\u65f6\uff0csoftmax\u5c06\u51e0\u4e4e\u5168\u90e8\u7684\u6982\u7387\u5206\u5e03\u90fd\u5206\u914d\u7ed9\u4e86\u6700\u5927\u503c\u5bf9\u5e94\u7684\u6807\u7b7e\u3002<\/strong><\/p>\n

\u70b9\u79ef\u540e\u7684\u7ed3\u679c\u6570\u91cf\u7ea7\u5927\u4f1a\u5bfc\u81f4\u53cd\u5411\u4f20\u64ad\u68af\u5ea6\u53d8\u5c0f\u3002\u9020\u6210\u68af\u5ea6\u6d88\u5931\uff0c\u53c2\u6570\u66f4\u65b0\u56f0\u96be\u3002<\/strong><\/p>\n

\"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled\u5f53\u8f93\u5165g(x)\u51fd\u6570\u7684logits\u7684\u6570\u91cf\u7ea7\u5f88\u5927\u65f6\uff0cg(x)\u8f93\u51fa\u7684\u662f\u4e00\u4e2a\u975e\u5e38\u63a5\u8fd1one-hot\u7684\u5411\u91cf[0,0,...1,...0,0]\u3002<\/p>\n

\u5728self-attention\u4e2d\u4e3a\u4ec0\u4e48\u8981\u9664\u4ee5\"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled\uff1f<\/span><\/strong><\/h4>\n

\"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled<\/p>\n

\u65b9\u5dee\u8d8a\u5927\u4e5f\u5c31\u8bf4\u660e\uff0c\u70b9\u79ef\u7684\u6570\u91cf\u7ea7\u8d8a\u5927\uff08\u4ee5\u8d8a\u5927\u7684\u6982\u7387\u53d6\u5927\u503c\uff09<\/strong>\u3002\u90a3\u4e48\u4e00\u4e2a\u81ea\u7136\u7684\u505a\u6cd5\u5c31\u662f\u628a\u65b9\u5dee\u7a33\u5b9a\u52301\uff0c\u505a\u6cd5\u662f\u5c06\u70b9\u79ef\u9664\u4ee5\"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled\uff0c\u5c06\u65b9\u5dee\u63a7\u5236\u4e3a1\uff0c\u4e5f\u5c31\u6709\u6548\u5730\u63a7\u5236\u4e86\u524d\u9762\u63d0\u5230\u7684\u68af\u5ea6\u6d88\u5931\u7684\u95ee\u9898<\/strong>\u3002<\/p>\n

\u4e3a\u4ec0\u4e48\u8981\u5047\u8bbe\u4e3a\u5747\u503c\u4e3a0\uff0c\u65b9\u5dee\u4e3a1\uff1f<\/span><\/strong><\/h4>\n

\u6d45\u8c08Transformer\u7684\u521d\u59cb\u5316\u3001\u53c2\u6570\u5316\u4e0e\u6807\u51c6\u5316 - \u79d1\u5b66\u7a7a\u95f4|Scientific Spaces<\/p>\n

\u5728\u4e00\u822c\u7684\u6559\u7a0b\u4e2d\uff0c\u63a8\u5bfc\u521d\u59cb\u5316\u65b9\u6cd5\u7684\u601d\u60f3\u662f\u5c3d\u91cf\u8ba9\u8f93\u5165\u8f93\u51fa\u5177\u6709\u540c\u6837\u7684\u5747\u503c\u548c\u65b9\u5dee\uff0c\u901a\u5e38\u4f1a\u5047\u8bbe\u8f93\u5165\u662f\u5747\u503c\u4e3a0\u3001\u65b9\u5dee\u4e3a1\u7684\u968f\u673a\u5411\u91cf\uff0c\u7136\u540e\u8bd5\u56fe\u8ba9\u8f93\u51fa\u7684\u5747\u503c\u4e3a0\u3001\u65b9\u5dee\u4e3a1\u3002<\/p>\n

\u521d\u59cb\u5316\u81ea\u7136\u662f\u968f\u673a\u91c7\u6837\u7684\u7684\uff0c\u6240\u4ee5\u8fd9\u91cc\u5148\u4ecb\u7ecd\u4e00\u4e0b\u5e38\u7528\u7684\u91c7\u6837\u5206\u5e03\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u90fd\u662f\u4ece\u6307\u5b9a\u5747\u503c\u548c\u65b9\u5dee\u7684\u968f\u673a\u5206\u5e03\u4e2d\u8fdb\u884c\u91c7\u6837\u6765\u521d\u59cb\u5316\u3002\u5176\u4e2d\u5e38\u7528\u7684\u968f\u673a\u5206\u5e03\u6709\u4e09\u4e2a\uff1a\u6b63\u6001\u5206\u5e03\uff08Normal\uff09\u3001\u5747\u5300\u5206\u5e03\uff08Uniform\uff09\u548c\u622a\u5c3e\u6b63\u6001\u5206\u5e03\uff08Truncated Normal\uff09\u3002<\/p>\n

\n

\u6838\u5fc3\u662f\u8ba9\u8f93\u5165\u8f93\u51fa\u5177\u6709\u540c\u6837\u7684\u5747\u503c\u548c\u65b9\u5dee\uff0c\u4fdd\u6301\u76f8\u540c\u7684\u6570\u636e\u5206\u5e03\u3002<\/strong><\/span>\u6311\u6b63\u6001\u5206\u5e03\u53ef\u80fd\u56e0\u4e3a\u5e38\u89c1\uff0c\u5747\u503c\u4e3a0\u3001\u65b9\u5dee\u4e3a1\u3002\u56e0\u4e3a\u7b80\u5355\uff1f<\/p>\n<\/blockquote>\n

\u4e3a\u4ec0\u4e48\u5728\u5176\u4ed6 softmax \u7684\u5e94\u7528\u573a\u666f\uff0c\u4e0d\u9700\u8981\u505a scaled\uff1f<\/strong><\/span><\/h4>\n

transformer\u4e2d\u7684attention\u4e3a\u4ec0\u4e48scaled? - \u5c0f\u83b2\u5b50\u7684\u56de\u7b54 - \u77e5\u4e4e<\/p>\n

\"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled<\/p>\n

\"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled<\/p>\n

\u4e3a\u4ec0\u4e48\u5728\u5206\u7c7b\u5c42\uff08\u6700\u540e\u4e00\u5c42\uff09\uff0c\u4f7f\u7528\u975e scaled \u7684 softmax\uff1f<\/strong><\/span><\/h4>\n
\n

\u56e0\u4e3a\u6728\u6709\u4e24\u4e2a\u968f\u673a\u53d8\u91cf\u76f8\u4e58\u7684\u60c5\u51b5\uff0c\u6240\u4ee5\u4e0d\u5b58\u5728\u70b9\u79ef\u540e\u7684\u7ed3\u679c\u6570\u91cf\u7ea7\u5927\u4f1a\u5bfc\u81f4\u53cd\u5411\u4f20\u64ad\u68af\u5ea6\u53d8\u5c0f\uff01<\/strong><\/p>\n<\/blockquote>\n

\"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled<\/p>\n

\u6ce8\u610f\u529b\u673a\u5236\u7684softmax\u6ea2\u51fa\u600e\u4e48\u89e3\u51b3\uff1f<\/h4>\n

\"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled<\/p>\n<\/p>\n

\u539f\u6587\u94fe\u63a5<\/p>\n

transformer\u4e2d\u7684attention\u4e3a\u4ec0\u4e48scaled? - TniL\u7684\u56de\u7b54 - \u77e5\u4e4e<\/p>\n

transformer\u4e2d\u7684attention\u4e3a\u4ec0\u4e48scaled? - \u5c0f\u83b2\u5b50\u7684\u56de\u7b54 - \u77e5\u4e4e<\/p>\n

\u6d45\u8c08Transformer\u7684\u521d\u59cb\u5316\u3001\u53c2\u6570\u5316\u4e0e\u6807\u51c6\u5316 - \u79d1\u5b66\u7a7a\u95f4|Scientific Spaces<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"\u3010\u6df1\u5ea6\u5b66\u4e60\u3011transformer\u4e2dsoftmax\u4e3a\u4ec0\u4e48\u8981scaled\u8bba\u6587\u4e2d\u89e3\u91ca\u662f\uff1a\u5411\u91cf\u7684\u70b9\u79ef\u7ed3\u679c\u4f1a\u5f88\u5927\uff0c\u5c06softmax\u51fd\u6570push\u5230\u68af\u5ea6\u5f88\u5c0f\u7684\u533a\u57df\uff0c...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8740"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=8740"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8740\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=8740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=8740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=8740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}