{"id":72057,"date":"2026-02-04T20:17:50","date_gmt":"2026-02-04T12:17:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/72057.html"},"modified":"2026-02-04T20:17:50","modified_gmt":"2026-02-04T12:17:50","slug":"transformer%e5%ad%a6%e4%b9%a0%e4%ba%94%e9%97%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/72057.html","title":{"rendered":"Transformer\u5b66\u4e60\u4e94\u95ee"},"content":{"rendered":"<h3>\u4e00\u3001Transformer \u7684\u8f93\u5165\u662f\u4ec0\u4e48&#xff1f;<\/h3>\n<p>Transformer \u7684\u8f93\u5165\u662f\u6570\u5b57\u5316\u7684\u5e8f\u5217\u6570\u636e&#xff0c;\u9700\u7ecf\u8fc73 \u5c42\u7f16\u7801\u540e\u624d\u80fd\u9001\u5165\u6ce8\u610f\u529b\u5c42\u548c\u524d\u9988\u7f51\u7edc&#xff0c;Encoder \u548c Decoder \u7684\u8f93\u5165\u6709\u91cd\u53e0\u4f46\u4e0d\u5b8c\u5168\u76f8\u540c&#xff0c;\u6838\u5fc3\u8f93\u5165\u7ed3\u6784\u5982\u4e0b&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"543\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260204121749-698338ed86c15.png\" width=\"369\" \/><\/p>\n<h4>\u901a\u7528\u57fa\u7840\u8f93\u5165<\/h4>\n<li>\u8bcd\u5d4c\u5165&#xff08;Token Embedding&#xff09;&#xff1a;\u628a\u79bb\u6563\u7684\u7b26\u53f7&#xff08;\u5982\u5355\u8bcd\u3001\u5b57&#xff09;\u6620\u5c04\u4e3a\u56fa\u5b9a\u7ef4\u5ea6\u7684\u7a20\u5bc6\u5411\u91cf&#xff0c;\u89e3\u51b3\u7b26\u53f7\u65e0\u6cd5\u76f4\u63a5\u8ba1\u7b97\u7684\u95ee\u9898&#xff0c;\u662f\u6240\u6709\u5e8f\u5217\u6a21\u578b\u7684\u57fa\u7840\u3002<\/li>\n<li>\u4f4d\u7f6e\u7f16\u7801&#xff08;Positional Encoding&#xff09;&#xff1a;Transformer \u6ca1\u6709 RNN \u7684\u65f6\u5e8f\u4f9d\u8d56&#xff0c;\u65e0\u6cd5\u611f\u77e5\u5e8f\u5217\u7684\u987a\u5e8f&#xff0c;\u56e0\u6b64\u901a\u8fc7\u6b63\u5f26 \/ \u4f59\u5f26\u516c\u5f0f\u751f\u6210\u4f4d\u7f6e\u5411\u91cf&#xff0c;\u4e0e\u8bcd\u5d4c\u5165\u9010\u5143\u7d20\u76f8\u52a0&#xff0c;\u8ba9\u6a21\u578b\u5b66\u4e60\u5230 token \u7684\u4f4d\u7f6e\u4fe1\u606f\u3002\n<ul>\n<li>\u4f4d\u7f6e\u7f16\u7801\u7684\u7ef4\u5ea6\u548c\u8bcd\u5d4c\u5165\u4e00\u81f4&#xff0c;\u4fdd\u8bc1\u76f8\u52a0\u540e\u7ef4\u5ea6\u4e0d\u53d8&#xff1b;<\/li>\n<li>\u53ef\u9009\u62e9\u53ef\u5b66\u4e60\u7684\u4f4d\u7f6e\u7f16\u7801&#xff0c;\u8bad\u7ec3\u65f6\u66f4\u65b0\u53c2\u6570&#xff0c;\u6548\u679c\u548c\u6b63\u5f26\u516c\u5f0f\u76f8\u8fd1\u3002<\/li>\n<\/ul>\n<\/li>\n<h4>Encoder \u7684\u4e13\u5c5e\u8f93\u5165<\/h4>\n<p>\u4ec5\u9700\u4e0a\u8ff0\u8bcd\u5d4c\u5165 &#043; \u4f4d\u7f6e\u7f16\u7801\u7684\u7ec4\u5408\u5411\u91cf&#xff0c;\u8f93\u5165\u4e3a\u5b8c\u6574\u7684\u6e90\u5e8f\u5217&#xff0c;\u4e14 Encoder \u7684\u8f93\u5165\u5e8f\u5217\u662f\u4e00\u6b21\u6027\u5168\u90e8\u9001\u5165\u7684\u3002<\/p>\n<h4>Decoder \u7684\u4e13\u5c5e\u8f93\u5165<\/h4>\n<p>Decoder \u662f\u81ea\u56de\u5f52\u7ed3\u6784&#xff0c;\u8f93\u5165\u5206\u4e3a\u4e24\u90e8\u5206&#xff0c;\u4e14\u8bad\u7ec3 \/ \u6d4b\u8bd5\u65f6\u8f93\u5165\u5f62\u5f0f\u4e0d\u540c&#xff1a;<\/p>\n<li>\u76ee\u6807\u5e8f\u5217\u7684\u7f16\u7801\u5411\u91cf&#xff1a;\u548c Encoder \u4e00\u6837&#xff0c;\u662f\u76ee\u6807\u5e8f\u5217\u7684\u8bcd\u5d4c\u5165 &#043; \u4f4d\u7f6e\u7f16\u7801&#xff1b;<\/li>\n<li>Encoder \u7684\u8f93\u51fa&#xff1a;\u4f5c\u4e3a Decoder \u4e2d\u4ea4\u53c9\u6ce8\u610f\u529b\u5c42\u7684 \u201c\u952e&#xff08;K&#xff09;\u201d \u548c \u201c\u503c&#xff08;V&#xff09;\u201d \u8f93\u5165\u3002<\/li>\n<p>\u8f93\u5165\u7ef4\u5ea6\u603b\u7ed3&#xff1a;\u6240\u6709\u8f93\u5165\u5411\u91cf\u7684\u6838\u5fc3\u7ef4\u5ea6\u4e3a [batch_size, seq_len, d_model]&#xff08;\u6279\u6b21\u5927\u5c0f&#xff0c;\u5e8f\u5217\u957f\u5ea6&#xff0c;\u6a21\u578b\u7ef4\u5ea6&#xff09;&#xff0c;\u8fd9\u662f Transformer \u7684\u57fa\u7840\u5f20\u91cf\u5f62\u72b6\u3002<\/p>\n<h3>\u4e8c\u3001Mask \u7684\u4f5c\u7528\u662f\u4ec0\u4e48&#xff1f;Transformer \u4e2d\u6709\u54ea\u4e9b Mask&#xff1f;<\/h3>\n<p>Mask \u7ffb\u8bd1\u4e3a\u63a9\u7801&#xff0c;\u6838\u5fc3\u4f5c\u7528\u662f\u8ba9\u6a21\u578b\u5728\u8ba1\u7b97\u6ce8\u610f\u529b\u65f6&#xff0c;\u5ffd\u7565\u6389 \u201c\u4e0d\u8be5\u770b\u5230\u201d \u7684 token&#xff0c;\u672c\u8d28\u662f\u5728\u6ce8\u610f\u529b\u5206\u6570\u77e9\u9635\u4e2d&#xff0c;\u7ed9\u9700\u8981\u5c4f\u853d\u7684\u4f4d\u7f6e\u52a0\u4e00\u4e2a\u6781\u5927\u7684\u8d1f\u6570&#xff0c;\u7ecf\u8fc7 Softmax \u540e\u8fd9\u4e9b\u4f4d\u7f6e\u7684\u6982\u7387\u4f1a\u8d8b\u8fd1\u4e8e 0&#xff0c;\u76f8\u5f53\u4e8e\u6a21\u578b \u201c\u770b\u4e0d\u5230\u201d \u8fd9\u4e9b token\u3002<\/p>\n<p>Transformer \u4e2d\u67093 \u7c7b\u6838\u5fc3 Mask&#xff0c;\u5206\u522b\u7528\u4e8e\u4e0d\u540c\u573a\u666f&#xff0c;\u65e0 Mask \u5219\u6a21\u578b\u4f1a\u5b66\u5230\u9519\u8bef\u7684\u4f9d\u8d56\u5173\u7cfb&#xff1a;<\/p>\n<h4>1. \u586b\u5145\u63a9\u7801&#xff08;Padding Mask&#xff09;\u2014\u2014 \u89e3\u51b3 \u201c\u5e8f\u5217\u957f\u5ea6\u4e0d\u4e00\u81f4\u201d \u95ee\u9898<\/h4>\n<p>\u5b9e\u9645\u8bad\u7ec3\u4e2d&#xff0c;\u4e00\u4e2a\u6279\u6b21\u7684\u5e8f\u5217\u957f\u5ea6\u662f\u4e0d\u4e00\u6837\u7684&#xff0c;\u4f1a\u901a\u8fc7Padding\u8865 0 \u8ba9\u957f\u5ea6\u7edf\u4e00&#xff0c;\u4f46\u8fd9\u4e9b\u8865 0 \u7684\u4f4d\u7f6e\u662f\u65e0\u610f\u4e49\u7684&#xff0c;\u9700\u8981\u7528 Padding Mask \u5c4f\u853d\u3002<\/p>\n<ul>\n<li>\u9002\u7528\u573a\u666f&#xff1a;Encoder \u7684\u81ea\u6ce8\u610f\u529b\u5c42 &#043; Decoder \u7684\u4ea4\u53c9\u6ce8\u610f\u529b\u5c42&#xff08;\u4e24\u5904\u90fd\u8981\u5c4f\u853d\u6e90 \/ \u76ee\u6807\u5e8f\u5217\u7684 Padding \u4f4d&#xff09;\u3002<\/li>\n<\/ul>\n<h4>2. \u672a\u6765\u63a9\u7801&#xff08;Look-Ahead Mask \/ \u56e0\u679c\u63a9\u7801&#xff09;\u2014\u2014 \u89e3\u51b3 \u201c\u81ea\u56de\u5f52\u56e0\u679c\u6027\u201d \u95ee\u9898<\/h4>\n<p>Decoder \u662f\u81ea\u56de\u5f52\u751f\u6210\u7684&#xff08;\u6bd4\u5982\u7ffb\u8bd1\u65f6&#xff0c;\u751f\u6210\u7b2c 3 \u4e2a\u8bcd\u65f6&#xff0c;\u53ea\u80fd\u770b\u5230\u524d 2 \u4e2a\u8bcd&#xff0c;\u4e0d\u80fd\u770b\u5230\u7b2c 3\u30014\u30015 \u4e2a\u8bcd&#xff09;&#xff0c;\u56e0\u6b64\u9700\u8981\u7528\u672a\u6765\u63a9\u7801\u5c4f\u853d\u5e8f\u5217\u4e2d\u5f53\u524d\u4f4d\u7f6e\u4e4b\u540e\u7684\u6240\u6709\u4f4d\u7f6e\u3002<\/p>\n<ul>\n<li>\u9002\u7528\u573a\u666f&#xff1a;Decoder \u7684\u81ea\u6ce8\u610f\u529b\u5c42&#xff08;\u4ec5\u6b64\u5904\u9700\u8981&#xff0c;Encoder \u65e0\u751f\u6210\u9700\u6c42&#xff0c;\u4e0d\u9700\u8981&#xff09;\u3002<\/li>\n<\/ul>\n<h4>3. \u5176\u4ed6\u63a9\u7801&#xff08;\u53ef\u9009&#xff09;<\/h4>\n<p>Mask \u6838\u5fc3\u603b\u7ed3&#xff1a;Mask \u4e0d\u6539\u53d8\u5f20\u91cf\u5f62\u72b6&#xff0c;\u4ec5\u901a\u8fc7\u4fee\u6539\u6ce8\u610f\u529b\u5206\u6570&#xff0c;\u8ba9\u6a21\u578b \u201c\u9009\u62e9\u6027\u5173\u6ce8\u201d \u6709\u6548 token&#xff0c;\u662f Transformer \u4fdd\u8bc1\u8ba1\u7b97\u5408\u7406\u6027\u548c\u56e0\u679c\u6027\u7684\u5173\u952e\u3002<\/p>\n<h3>\u4e09\u3001Cross-Attention \u4ea4\u53c9\u6ce8\u610f\u529b\u7684\u4f5c\u7528\u662f\u4ec0\u4e48&#xff1f;<\/h3>\n<p>Cross-Attention \u662f Transformer \u4e2dDecoder \u72ec\u6709\u7684\u5c42&#xff08;Encoder \u53ea\u6709\u81ea\u6ce8\u610f\u529b\u5c42 Self-Attention&#xff09;&#xff0c;\u6838\u5fc3\u4f5c\u7528\u662f\u8ba9 Decoder \u7684\u751f\u6210\u8fc7\u7a0b \u201c\u5173\u6ce8\u201d Encoder \u7684\u6e90\u5e8f\u5217\u4fe1\u606f&#xff0c;\u5b9e\u73b0\u6e90\u5e8f\u5217\u5230\u76ee\u6807\u5e8f\u5217\u7684\u4fe1\u606f\u6620\u5c04\u3002<\/p>\n<p>\u5148\u533a\u5206\u4e24\u4e2a\u57fa\u7840\u6ce8\u610f\u529b&#xff0c;\u518d\u8bb2 Cross-Attention \u7684\u6838\u5fc3&#xff1a;<\/p>\n<h4>1. \u81ea\u6ce8\u610f\u529b&#xff08;Self-Attention&#xff09;<\/h4>\n<ul>\n<li>\u8f93\u5165&#xff1a;\u540c\u4e00\u5e8f\u5217\u7684 Q&#xff08;\u67e5\u8be2&#xff09;\u3001K&#xff08;\u952e&#xff09;\u3001V&#xff08;\u503c&#xff09;&#xff1b;<\/li>\n<li>\u4f5c\u7528&#xff1a;\u8ba9\u5e8f\u5217\u81ea\u8eab\u7684 token \u4e4b\u95f4\u76f8\u4e92\u5173\u6ce8&#xff0c;\u5b66\u4e60\u5e8f\u5217\u5185\u90e8\u7684\u4f9d\u8d56\u5173\u7cfb\u3002<\/li>\n<\/ul>\n<h4>2. \u4ea4\u53c9\u6ce8\u610f\u529b&#xff08;Cross-Attention&#xff09;<\/h4>\n<ul>\n<li>\u8f93\u5165&#xff1a;\u4e0d\u540c\u5e8f\u5217\u7684 Q \u548c K\/V \u2014\u2014 Q \u662fDecoder \u524d\u4e00\u5c42\u7684\u8f93\u51fa&#xff0c;K \u548c V \u662fEncoder \u7684\u6700\u7ec8\u8f93\u51fa&#xff1b;<\/li>\n<li>\u4f5c\u7528&#xff1a;\u8ba9\u76ee\u6807\u5e8f\u5217\u7684 token \u5173\u6ce8\u6e90\u5e8f\u5217\u7684\u76f8\u5173 token\u3002<\/li>\n<\/ul>\n<h4>Cross-Attention \u7684\u6838\u5fc3\u4ef7\u503c<\/h4>\n<li>\u5b9e\u73b0\u4fe1\u606f\u4f20\u9012&#xff1a;Encoder \u8d1f\u8d23\u7406\u89e3\u6e90\u5e8f\u5217&#xff0c;Decoder \u8d1f\u8d23\u751f\u6210\u76ee\u6807\u5e8f\u5217&#xff0c;Cross-Attention \u662f\u8fde\u63a5\u4e24\u8005\u7684\u552f\u4e00\u6865\u6881&#xff0c;\u8ba9 Decoder \u751f\u6210\u7684\u6bcf\u4e2a token \u90fd\u80fd\u5339\u914d\u5230\u6e90\u5e8f\u5217\u7684\u5bf9\u5e94\u4fe1\u606f&#xff1b;<\/li>\n<li>\u4fdd\u8bc1\u751f\u6210\u7684\u51c6\u786e\u6027&#xff1a;\u5982\u679c\u6ca1\u6709 Cross-Attention&#xff0c;Decoder \u53ea\u80fd\u57fa\u4e8e\u81ea\u8eab\u7684\u76ee\u6807\u5e8f\u5217\u751f\u6210&#xff0c;\u4f1a\u8131\u79bb\u6e90\u5e8f\u5217\u7684\u8bed\u4e49&#xff0c;\u5bfc\u81f4\u751f\u6210\u5185\u5bb9\u548c\u8f93\u5165\u65e0\u5173&#xff1b;<\/li>\n<li>\u591a\u5bf9\u591a \/ \u591a\u5bf9\u4e00\u6620\u5c04&#xff1a;\u652f\u6301\u6e90\u5e8f\u5217\u548c\u76ee\u6807\u5e8f\u5217\u7684\u957f\u5ea6\u4e0d\u4e00\u81f4&#xff0c;\u8fd9\u662f RNN \u96be\u4ee5\u9ad8\u6548\u5b9e\u73b0\u7684&#xff0c;\u4e5f\u662f Transformer \u7684\u4f18\u52bf\u4e4b\u4e00\u3002<\/li>\n<p>Cross \u6838\u5fc3\u603b\u7ed3&#xff1a;Cross-Attention \u662f Decoder \u201c\u8bfb\u61c2\u201d Encoder \u7684\u5173\u952e&#xff0c;\u8ba9 Transformer \u5b9e\u73b0\u6e90\u5e8f\u5217\u8bed\u4e49\u5230\u76ee\u6807\u5e8f\u5217\u751f\u6210\u7684\u7cbe\u51c6\u6620\u5c04&#xff0c;\u662f\u6240\u6709 ** \u5e8f\u5217\u5230\u5e8f\u5217&#xff08;Seq2Seq&#xff09;** \u4efb\u52a1\u7684\u6838\u5fc3\u7ec4\u4ef6\u3002<\/p>\n<h3>\u56db\u3001Transformer \u8bad\u7ec3\u548c\u6d4b\u8bd5\u7684\u533a\u522b\u662f\u4ec0\u4e48&#xff1f;<\/h3>\n<p>Transformer \u7684\u8bad\u7ec3\u548c\u6d4b\u8bd5\u9636\u6bb5&#xff0c;\u6a21\u578b\u7ed3\u6784\u4e0d\u53d8&#xff0c;\u4f46\u8f93\u5165\u5f62\u5f0f\u3001\u8ba1\u7b97\u65b9\u5f0f\u3001\u6548\u7387\u3001\u7b56\u7565\u5b8c\u5168\u4e0d\u540c&#xff0c;\u6838\u5fc3\u5dee\u5f02\u6e90\u4e8e Decoder \u7684\u81ea\u56de\u5f52\u7279\u6027&#xff0c;\u4e5f\u662f\u6240\u6709\u751f\u6210\u5f0f\u6a21\u578b\u7684\u5171\u6027\u5dee\u5f02&#xff0c;\u5173\u952e\u533a\u522b\u5982\u4e0b\u8868&#xff1a;<\/p>\n<table>\n<tr>\u5bf9\u6bd4\u7ef4\u5ea6\u8bad\u7ec3\u9636\u6bb5\u6d4b\u8bd5&#xff08;\u63a8\u7406&#xff09;\u9636\u6bb5<\/tr>\n<tbody>\n<tr>\n<td>\u8f93\u5165\u5f62\u5f0f<\/td>\n<td>\n<p>1. Encoder&#xff1a;\u5b8c\u6574\u6e90\u5e8f\u5217<\/p>\n<p>2. Decoder&#xff1a;\u5b8c\u6574\u7684\u76ee\u6807\u5e8f\u5217&#xff08;\u5e26 Shift Right&#xff09;<\/p>\n<\/td>\n<td>\n<p>1. Encoder&#xff1a;\u5b8c\u6574\u6e90\u5e8f\u5217<\/p>\n<p>2. Decoder&#xff1a;\u9010\u8bcd\u8f93\u5165&#xff0c;\u81ea\u56de\u5f52\u751f\u6210&#xff08;\u521d\u59cb\u8f93\u5165\u4e3a [CLS]&#xff0c;\u9884\u6d4b\u7b2c 1 \u4e2a\u8bcd I&#xff1b;\u518d\u8f93\u5165 [CLS, I]&#xff0c;\u9884\u6d4b\u7b2c 2 \u4e2a\u8bcd am&#xff1b;\u4f9d\u6b21\u7c7b\u63a8&#xff0c;\u76f4\u5230\u751f\u6210\u7ed3\u675f\u7b26 [EOS]&#xff0c;\u5373 \u201c\u6a21\u578b\u81ea\u5df1\u6162\u6162\u5199\u201d&#xff09;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\u8ba1\u7b97\u65b9\u5f0f<\/td>\n<td>\u6279\u5904\u7406 &#043; \u5e76\u884c\u8ba1\u7b97&#xff08;\u4e00\u4e2a\u6279\u6b21\u7684\u5e8f\u5217\u4e00\u6b21\u6027\u8ba1\u7b97&#xff0c;Decoder \u7684\u5b8c\u6574\u8f93\u5165\u53ef\u5e76\u884c\u8ba1\u7b97\u6ce8\u610f\u529b&#xff09;&#xff0c;\u6548\u7387\u9ad8<\/td>\n<td>\u4e32\u884c\u8ba1\u7b97&#xff08;\u5fc5\u987b\u7b49\u524d\u4e00\u4e2a\u8bcd\u751f\u6210\u540e&#xff0c;\u624d\u80fd\u8f93\u5165\u8ba1\u7b97\u4e0b\u4e00\u4e2a\u8bcd&#xff09;&#xff0c;\u6548\u7387\u4f4e&#xff08;\u751f\u6210\u8d8a\u957f\u7684\u5e8f\u5217&#xff0c;\u8017\u65f6\u8d8a\u4e45&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>Mask \u4f7f\u7528<\/td>\n<td>\n<p>1. Encoder&#xff1a;Padding Mask<\/p>\n<p>2. Decoder&#xff1a;Padding Mask &#043; \u672a\u6765\u63a9\u7801&#xff08;Look-Ahead Mask&#xff09;<\/p>\n<\/td>\n<td>\u548c\u8bad\u7ec3\u4e00\u81f4&#xff0c;Decoder \u7684\u81ea\u6ce8\u610f\u529b\u5c42\u4ecd\u9700\u672a\u6765\u63a9\u7801&#xff0c;\u4e24\u5904\u4ecd\u9700 Padding Mask<\/td>\n<\/tr>\n<tr>\n<td>\u76ee\u6807<\/td>\n<td>\u6700\u5c0f\u5316\u9884\u6d4b\u503c\u548c\u771f\u5b9e\u503c\u7684\u5dee\u8ddd&#xff0c;\u66f4\u65b0\u6a21\u578b\u6240\u6709\u53c2\u6570&#xff1a;Encoder&#043;Decoder \u7684\u8bcd\u5d4c\u5165\u3001\u6ce8\u610f\u529b\u3001\u524d\u9988\u7f51\u7edc\u7b49\u6240\u6709\u53c2\u6570<\/td>\n<td>\u56fa\u5b9a\u8bad\u7ec3\u597d\u7684\u53c2\u6570&#xff0c;\u6839\u636e\u6e90\u5e8f\u5217\u751f\u6210\u7b26\u5408\u8bed\u4e49\u7684\u76ee\u6807\u5e8f\u5217&#xff0c;\u65e0\u53c2\u6570\u66f4\u65b0<\/td>\n<\/tr>\n<tr>\n<td>\u89e3\u7801\u7b56\u7565<\/td>\n<td>\u65e0\u89e3\u7801\u7b56\u7565&#xff0c;\u76f4\u63a5\u7528\u771f\u5b9e\u503c\u4f5c\u4e3a\u8f93\u5165&#xff0c;\u5c5e\u4e8e\u6559\u5e08\u5f3a\u5236<\/td>\n<td>\u9700\u7528\u89e3\u7801\u7b56\u7565\u63a7\u5236\u751f\u6210\u6548\u679c&#xff0c;\u6bd4\u5982\u8d2a\u5fc3\u89e3\u7801&#xff08;\u6bcf\u6b21\u9009\u6982\u7387\u6700\u5927\u7684\u8bcd&#xff09;\u3001\u96c6\u675f\u641c\u7d22&#xff08;Beam Search&#xff09;&#xff08;\u4fdd\u7559 top-k \u4e2a\u5019\u9009\u5e8f\u5217&#xff0c;\u9009\u6700\u4f18&#xff09;\u3001\u968f\u673a\u89e3\u7801&#xff08;\u91c7\u6837\u6982\u7387\u5206\u5e03&#xff0c;\u589e\u52a0\u591a\u6837\u6027&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u8f93\u5165\u957f\u5ea6<\/td>\n<td>\u6279\u6b21\u5185\u5e8f\u5217\u957f\u5ea6\u7edf\u4e00&#xff08;Padding \u8865 0&#xff09;&#xff0c;\u56fa\u5b9aseq_len<\/td>\n<td>\u5e8f\u5217\u957f\u5ea6\u52a8\u6001\u53d8\u5316&#xff08;\u968f\u751f\u6210\u8fc7\u7a0b\u9010\u6b65\u589e\u52a0&#xff0c;\u76f4\u5230\u751f\u6210 [EOS]&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u8865\u5145&#xff1a;\u6559\u5e08\u5f3a\u5236&#xff08;Teacher Forcing&#xff09;<\/h4>\n<p>\u8bad\u7ec3\u65f6 Decoder \u7528\u5b8c\u6574\u7684\u76ee\u6807\u5e8f\u5217\u4f5c\u4e3a\u8f93\u5165&#xff0c;\u800c\u975e\u81ea\u5df1\u751f\u6210\u7684\u5e8f\u5217&#xff0c;\u8fd9\u4e2a\u7b56\u7565\u53eb\u6559\u5e08\u5f3a\u5236&#xff0c;\u6838\u5fc3\u4f18\u52bf\u662f\u52a0\u901f\u8bad\u7ec3&#xff08;\u5e76\u884c\u8ba1\u7b97&#xff09;&#xff0c;\u907f\u514d\u8bad\u7ec3\u8fc7\u7a0b\u4e2d \u201c\u9519\u8bef\u7d2f\u79ef\u201d\u3002<\/p>\n<ul>\n<li>\u526f\u4f5c\u7528&#xff1a;\u66b4\u9732\u504f\u5dee&#xff08;Exposure Bias&#xff09;\u2014\u2014 \u8bad\u7ec3\u65f6\u6a21\u578b\u770b\u7684\u662f\u771f\u5b9e\u503c&#xff0c;\u6d4b\u8bd5\u65f6\u770b\u7684\u662f\u81ea\u5df1\u751f\u6210\u7684\u503c&#xff0c;\u4e24\u8005\u5206\u5e03\u4e0d\u540c&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u6d4b\u8bd5\u6548\u679c\u6bd4\u8bad\u7ec3\u6548\u679c\u5dee&#xff0c;\u53ef\u901a\u8fc7Scheduled Sampling&#xff08;\u8bad\u7ec3\u65f6\u968f\u673a\u7528\u6a21\u578b\u751f\u6210\u7684\u8bcd\u4ee3\u66ff\u771f\u5b9e\u503c&#xff09;\u7f13\u89e3\u3002<\/li>\n<\/ul>\n<p>\u8bad\u7ec3 \/ \u6d4b\u8bd5\u6838\u5fc3\u603b\u7ed3&#xff1a;\u6838\u5fc3\u5dee\u5f02\u5728Decoder \u7684\u8f93\u5165\u65b9\u5f0f&#xff08;\u8bad\u7ec3\u4e00\u6b21\u6027\u5582\u771f\u5b9e\u503c&#xff0c;\u6d4b\u8bd5\u9010\u8bcd\u81ea\u56de\u5f52\u751f\u6210&#xff09;&#xff0c;\u5bfc\u81f4\u8ba1\u7b97\u6548\u7387\u3001\u7b56\u7565\u7684\u5168\u9762\u4e0d\u540c&#xff1b;Encoder \u5728\u8bad\u7ec3\u548c\u6d4b\u8bd5\u65f6\u5b8c\u5168\u4e00\u81f4&#xff0c;\u65e0\u5dee\u5f02\u3002<\/p>\n<h3>\u4e94\u3001Transformer \u8bad\u7ec3\u7684 Loss \u600e\u4e48\u8ba1\u7b97&#xff1f;<\/h3>\n<p>Transformer \u7684\u8bad\u7ec3\u635f\u5931\u662f\u57fa\u4e8e Decoder \u7684\u8f93\u51fa\u8ba1\u7b97\u7684&#xff0c;\u6838\u5fc3\u7528\u4e8e\u5e8f\u5217\u5206\u7c7b \/ \u751f\u6210\u4efb\u52a1&#xff0c;\u57fa\u7840\u635f\u5931\u4e3a\u4ea4\u53c9\u71b5\u635f\u5931&#xff08;Cross-Entropy Loss&#xff09;\u3002<\/p>\n<h4>1. \u635f\u5931\u8ba1\u7b97\u7684\u524d\u63d0<\/h4>\n<p>Decoder \u7684\u6700\u7ec8\u8f93\u51fa\u662f\u4e00\u4e2a\u5f62\u72b6\u4e3a [batch_size, seq_len, vocab_size] \u7684\u5f20\u91cf&#xff0c;\u5176\u4e2d&#xff1a;<\/p>\n<ul>\n<li>vocab_size&#xff1a;\u76ee\u6807\u5e8f\u5217\u7684\u8bcd\u8868\u5927\u5c0f&#xff1b;<\/li>\n<li>\u5f20\u91cf\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u503c&#xff1a;\u6a21\u578b\u9884\u6d4b\u8be5\u4f4d\u7f6e\u662f\u8bcd\u8868\u4e2d\u67d0\u4e2a\u8bcd\u7684\u672a\u5f52\u4e00\u5316\u6982\u7387&#xff1b;<\/li>\n<li>\u7ecf\u8fc7Softmax \u5c42\u540e&#xff0c;\u4f1a\u8f6c\u5316\u4e3a [0,1] \u4e4b\u95f4\u7684\u6982\u7387&#xff0c;\u4ee3\u8868\u8be5\u4f4d\u7f6e\u662f\u5bf9\u5e94\u8bcd\u7684\u6982\u7387\u3002<\/li>\n<\/ul>\n<h4>2. \u57fa\u7840\u635f\u5931&#xff1a;\u8d1f\u5bf9\u6570\u4f3c\u7136\u635f\u5931&#xff08;NLLLoss&#xff09;\/ \u4ea4\u53c9\u71b5\u635f\u5931&#xff08;CrossEntropyLoss&#xff09;<\/h4>\n<p>PyTorch\u4e2d&#xff0c;CrossEntropyLoss \u5df2\u7ecf\u6574\u5408\u4e86Softmax\u548cNLLLoss&#xff0c;\u662f Transformer \u8bad\u7ec3\u7684\u9ed8\u8ba4\u635f\u5931&#xff0c;\u8ba1\u7b97\u6b65\u9aa4\u5982\u4e0b&#xff1a;<\/p>\n<h5>\u6b65\u9aa4 1&#xff1a;Decoder \u8f93\u51fa\u5904\u7406<\/h5>\n<p>\u5c06 Decoder \u7684\u8f93\u51fa\u5f20\u91cf [batch_size, seq_len, vocab_size] \u5c55\u5e73\u4e3a [batch_size*seq_len, vocab_size]&#xff0c;\u65b9\u4fbf\u6279\u91cf\u8ba1\u7b97\u3002<\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u76ee\u6807\u5e8f\u5217\u5904\u7406<\/h5>\n<p>\u5c06\u76ee\u6807\u5e8f\u5217\u7684\u771f\u5b9e\u6807\u7b7e&#xff08;token \u7684\u7d22\u5f15&#xff09;\u5c55\u5e73\u4e3a [batch_size*seq_len]&#xff0c;\u5e76\u5c4f\u853d Padding \u4f4d\u3002<\/p>\n<h5>\u6b65\u9aa4 3&#xff1a;\u8ba1\u7b97\u4ea4\u53c9\u71b5\u635f\u5931<\/h5>\n<p>\u5bf9\u6bcf\u4e2a token \u7684\u9884\u6d4b\u6982\u7387\u548c\u771f\u5b9e\u6807\u7b7e\u8ba1\u7b97\u4ea4\u53c9\u71b5&#xff0c;\u518d\u5bf9\u6240\u6709\u6709\u6548 token\u6c42\u5e73\u5747&#xff0c;\u5f97\u5230\u6279\u6b21\u7684\u5e73\u5747\u635f\u5931\u3002<\/p>\n<p>\u6838\u5fc3\u516c\u5f0f&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"105\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260204121749-698338edd0316.png\" width=\"626\" \/><\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<ul>\n<li>N&#xff1a;\u6279\u6b21\u4e2d\u6709\u6548 token \u7684\u603b\u6570&#xff1b;<\/li>\n<li>yi\u200b&#xff1a;\u76ee\u6807\u5e8f\u5217\u7b2ci\u4e2a\u4f4d\u7f6e\u7684\u771f\u5b9e token&#xff1b;<\/li>\n<li>p(yi\u200b\u2223&#8230;)&#xff1a;\u6a21\u578b\u9884\u6d4b\u7b2ci\u4e2a\u4f4d\u7f6e\u4e3ayi\u200b\u7684\u6982\u7387\u3002<\/li>\n<\/ul>\n<h4>3. \u635f\u5931\u8ba1\u7b97\u7684\u5173\u952e\u7ec6\u8282<\/h4>\n<ul>\n<li>\u4ec5\u8ba1\u7b97 Decoder \u7684\u6709\u6548\u4f4d\u7f6e&#xff1a;Padding \u4f4d\u3001&lt;pad&gt;&#096;&#096;&lt;cls&gt;\u7b49\u7279\u6b8a token \u53ef\u9009\u62e9\u4e0d\u8ba1\u5165\u635f\u5931&#xff0c;\u901a\u8fc7ignore_index\u53c2\u6570\u5b9e\u73b0&#xff08;\u6bd4\u5982 PyTorch \u4e2dCrossEntropyLoss(ignore_index&#061;0)&#xff0c;0 \u4e3a Padding \u7684\u7d22\u5f15&#xff09;&#xff1b;<\/li>\n<li>\u6279\u6b21\u5e73\u5747&#xff1a;\u635f\u5931\u901a\u5e38\u5bf9\u6279\u6b21\u5185\u7684\u6240\u6709\u6709\u6548 token\u6c42\u5e73\u5747&#xff0c;\u4fdd\u8bc1\u4e0d\u540c\u6279\u6b21\u7684\u635f\u5931\u5c3a\u5ea6\u4e00\u81f4&#xff0c;\u4fbf\u4e8e\u68af\u5ea6\u4e0b\u964d&#xff1b;<\/li>\n<li>\u68af\u5ea6\u66f4\u65b0&#xff1a;\u8ba1\u7b97\u5f97\u5230\u7684\u635f\u5931\u901a\u8fc7\u53cd\u5411\u4f20\u64ad\u66f4\u65b0 Transformer \u7684\u6240\u6709\u53c2\u6570&#xff08;Encoder&#043;Decoder \u7684\u8bcd\u5d4c\u5165\u3001\u6ce8\u610f\u529b\u5c42\u3001\u524d\u9988\u7f51\u7edc\u7684\u6743\u91cd\u548c\u504f\u7f6e&#xff09;\u3002<\/li>\n<\/ul>\n<p>Loss \u6838\u5fc3\u603b\u7ed3&#xff1a;Transformer \u7684\u57fa\u7840\u8bad\u7ec3\u635f\u5931\u662f\u5e26 Padding \u5c4f\u853d\u7684\u4ea4\u53c9\u71b5\u635f\u5931&#xff0c;\u7b80\u5355\u4e14\u9002\u914d\u5e8f\u5217\u751f\u6210\u4efb\u52a1&#xff1b;\u7279\u6b8a\u573a\u666f\u53ef\u901a\u8fc7\u6807\u7b7e\u5e73\u6ed1\u3001\u52a0\u6743\u7b49\u65b9\u5f0f\u4f18\u5316&#xff0c;\u6838\u5fc3\u76ee\u6807\u662f\u6700\u5c0f\u5316\u6a21\u578b\u9884\u6d4b\u503c\u548c\u771f\u5b9e\u503c\u7684\u5dee\u8ddd&#xff0c;\u8ba9\u6a21\u578b\u5b66\u4e60\u5230\u6e90\u5e8f\u5217\u5230\u76ee\u6807\u5e8f\u5217\u7684\u6620\u5c04\u89c4\u5f8b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001Transformer \u7684\u8f93\u5165\u662f\u4ec0\u4e48&#xff1f;<br \/>\nTransformer \u7684\u8f93\u5165\u662f\u6570\u5b57\u5316\u7684\u5e8f\u5217\u6570\u636e&#xff0c;\u9700\u7ecf\u8fc73 \u5c42\u7f16\u7801\u540e\u624d\u80fd\u9001\u5165\u6ce8\u610f\u529b\u5c42\u548c\u524d\u9988\u7f51\u7edc&#xff0c;Encoder \u548c Decoder \u7684\u8f93\u5165\u6709\u91cd\u53e0\u4f46\u4e0d\u5b8c\u5168\u76f8\u540c&#xff0c;\u6838\u5fc3\u8f93\u5165\u7ed3\u6784\u5982\u4e0b&#xff1a; \u901a\u7528\u57fa\u7840\u8f93\u5165<br \/>\n\u8bcd\u5d4c\u5165&#xff08;Token Embedding&#xff09;&#xff1a;\u628a\u79bb\u6563\u7684\u7b26\u53f7&#xff08;\u5982\u5355\u8bcd\u3001\u5b57&#xff09;\u6620\u5c04\u4e3a\u56fa\u5b9a\u7ef4\u5ea6\u7684\u7a20\u5bc6\u5411\u91cf&amp;#xf<\/p>\n","protected":false},"author":2,"featured_media":72055,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[841,371,86],"topic":[],"class_list":["post-72057","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-transformer","tag-371","tag-86"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Transformer\u5b66\u4e60\u4e94\u95ee - \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\/72057.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Transformer\u5b66\u4e60\u4e94\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001Transformer \u7684\u8f93\u5165\u662f\u4ec0\u4e48&#xff1f; Transformer \u7684\u8f93\u5165\u662f\u6570\u5b57\u5316\u7684\u5e8f\u5217\u6570\u636e&#xff0c;\u9700\u7ecf\u8fc73 \u5c42\u7f16\u7801\u540e\u624d\u80fd\u9001\u5165\u6ce8\u610f\u529b\u5c42\u548c\u524d\u9988\u7f51\u7edc&#xff0c;Encoder \u548c Decoder \u7684\u8f93\u5165\u6709\u91cd\u53e0\u4f46\u4e0d\u5b8c\u5168\u76f8\u540c&#xff0c;\u6838\u5fc3\u8f93\u5165\u7ed3\u6784\u5982\u4e0b&#xff1a; \u901a\u7528\u57fa\u7840\u8f93\u5165 \u8bcd\u5d4c\u5165&#xff08;Token Embedding&#xff09;&#xff1a;\u628a\u79bb\u6563\u7684\u7b26\u53f7&#xff08;\u5982\u5355\u8bcd\u3001\u5b57&#xff09;\u6620\u5c04\u4e3a\u56fa\u5b9a\u7ef4\u5ea6\u7684\u7a20\u5bc6\u5411\u91cf&amp;#xf\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/72057.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-04T12:17:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260204121749-698338ed86c15.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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/72057.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/72057.html\",\"name\":\"Transformer\u5b66\u4e60\u4e94\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-04T12:17:50+00:00\",\"dateModified\":\"2026-02-04T12:17:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/72057.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/72057.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/72057.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Transformer\u5b66\u4e60\u4e94\u95ee\"}]},{\"@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":"Transformer\u5b66\u4e60\u4e94\u95ee - \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\/72057.html","og_locale":"zh_CN","og_type":"article","og_title":"Transformer\u5b66\u4e60\u4e94\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001Transformer \u7684\u8f93\u5165\u662f\u4ec0\u4e48&#xff1f; Transformer \u7684\u8f93\u5165\u662f\u6570\u5b57\u5316\u7684\u5e8f\u5217\u6570\u636e&#xff0c;\u9700\u7ecf\u8fc73 \u5c42\u7f16\u7801\u540e\u624d\u80fd\u9001\u5165\u6ce8\u610f\u529b\u5c42\u548c\u524d\u9988\u7f51\u7edc&#xff0c;Encoder \u548c Decoder \u7684\u8f93\u5165\u6709\u91cd\u53e0\u4f46\u4e0d\u5b8c\u5168\u76f8\u540c&#xff0c;\u6838\u5fc3\u8f93\u5165\u7ed3\u6784\u5982\u4e0b&#xff1a; \u901a\u7528\u57fa\u7840\u8f93\u5165 \u8bcd\u5d4c\u5165&#xff08;Token Embedding&#xff09;&#xff1a;\u628a\u79bb\u6563\u7684\u7b26\u53f7&#xff08;\u5982\u5355\u8bcd\u3001\u5b57&#xff09;\u6620\u5c04\u4e3a\u56fa\u5b9a\u7ef4\u5ea6\u7684\u7a20\u5bc6\u5411\u91cf&amp;#xf","og_url":"https:\/\/www.wsisp.com\/helps\/72057.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-04T12:17:50+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260204121749-698338ed86c15.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/72057.html","url":"https:\/\/www.wsisp.com\/helps\/72057.html","name":"Transformer\u5b66\u4e60\u4e94\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-04T12:17:50+00:00","dateModified":"2026-02-04T12:17:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/72057.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/72057.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/72057.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Transformer\u5b66\u4e60\u4e94\u95ee"}]},{"@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\/72057","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=72057"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/72057\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/72055"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=72057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=72057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=72057"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=72057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}