{"id":7975,"date":"2024-04-20T09:01:01","date_gmt":"2024-04-20T01:01:01","guid":{"rendered":""},"modified":"2024-04-20T09:01:01","modified_gmt":"2024-04-20T01:01:01","slug":"\u63a8\u8350\u7cfb\u7edf\u4e2d\u7684\u5e38\u7528\u7b97\u6cd5\u2014\u2014\u57fa\u4e8eGraph Embedding\u7684GES\u548cEGES","status":"publish","type":"post","link":"https:\/\/mushiming.com\/7975.html","title":{"rendered":"\u63a8\u8350\u7cfb\u7edf\u4e2d\u7684\u5e38\u7528\u7b97\u6cd5\u2014\u2014\u57fa\u4e8eGraph Embedding\u7684GES\u548cEGES"},"content":{"rendered":"

\n <\/path> \n<\/svg> <\/p>\n

1. \u6982\u8ff0<\/h2>\n

\u76f8\u6bd4\u8f83\u4e8e\u57fa\u4e8eCollaborative Filter\u7b97\u6cd5\uff0c\u57fa\u4e8e\u57fa\u7840Graph Embedding\u6a21\u578b\u53ef\u4ee5\u6839\u636e\u7528\u6237\u7684\u884c\u4e3a\u5e8f\u5217\u5b66\u4e60\u51faitem\u7684embedding\uff0c\u5229\u7528item\u5bf9\u5e94\u7684Embedding\u53ef\u4ee5\u65b9\u4fbf\u8ba1\u7b97item\u4e0eitem\u4e4b\u95f4\u7684\u76f8\u4f3c\u5ea6\uff0c\u5e76\u5728\u5b9e\u8df5\u4e2d\u88ab\u8bc1\u660e\u662f\u5353\u6709\u6210\u6548\u7684\u65b9\u6cd5\uff0c\u5728\u57fa\u4e8e\u57fa\u7840Graph Embedding\u6a21\u578b\uff0c\u4e3b\u8981\u5305\u62ecitem2vec\uff0cnode2vec\uff0cdeepwalk\u7b49\u7b97\u6cd5\u3002<\/p>\n

\u5728\u4f7f\u7528\u57fa\u7840Graph Embedding\u7b97\u6cd5\u7684\u524d\u63d0\u662f\u7528\u6237\u7684\u884c\u4e3a\u5e8f\u5217\uff0c\u4f46\u662f\u5bf9\u4e8e\u4e00\u4e9b\u65b0\u7684item\u6216\u8005\u7528\u6237\u5f88\u5c11\u6709\u884c\u4e3a\u7684item\uff0c\u5373\u51b7\u542f\u52a8\u95ee\u9898\uff0c\u57fa\u7840\u7684Graph Embedding\u7b97\u6cd5\u5f88\u96be\u5b66\u5230\u5bf9\u5e94item\u7684embedding\u8868\u793a\uff0c\u4e3a\u6b64\uff0c\u4e00\u4e9b\u9488\u5bf9item\u51b7\u542f\u52a8\u7684\u65b9\u6cd5\u88ab\u63d0\u51fa\uff0c\u5176\u4e2d\u5c31\u5305\u62ecGES\u548cEGES\u7b97\u6cd5\u3002<\/p>\n

GES\u548cEGES\u662f\u963f\u91cc\u57282018\u5e74\u63d0\u51fa\u7684\u4e24\u4e2a\u57fa\u4e8eGraph Embedding\u7684\u7b97\u6cd5\uff0c\u5176\u4e2dGES\u5168\u79f0\u4e3aGraph Embedding with Side Information\uff0cEGES\u5168\u79f0\u4e3aEnhanced Graph Embedding with Side Information\u3002\u4e3a\u4e86\u89e3\u51b3\u51b7\u542f\u52a8\u7684\u95ee\u9898\uff0cGES\u548cEGES\u5728\u8ba1\u7b97item embedding\u7684\u8fc7\u7a0b\u4e2d\u5f15\u5165\u4e86side information\u3002<\/p>\n

2. \u7b97\u6cd5\u539f\u7406<\/h2>\n

2.1. side information<\/h3>\n

side information\u5728\u63a8\u8350\u7cfb\u7edf\u4e2d\u6709\u7740\u91cd\u8981\u7684\u4f5c\u7528\uff0c\u4e0d\u4ec5\u4ec5\u80fd\u5e94\u7528\u5728\u53ec\u56de\u4e2d\u7528\u4e8e\u5904\u7406\u51b7\u542f\u52a8\u95ee\u9898\uff0c\u540c\u65f6\u5728\u6392\u5e8f\u9636\u6bb5\u4e2d\u4e5f\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u3002side information\u4e3b\u8981\u6307\u7684\u662f\u4e0eitem\u76f8\u5173\u7684\u4e00\u4e9b\u5148\u9a8c\u4fe1\u606f\uff0c\u5bf9\u4e8e\u5546\u54c1\u800c\u8a00\uff0c\u5148\u9a8c\u4fe1\u606f\u5305\u62ec\uff1a\u7c7b\u522b\uff0c\u5546\u5e97\uff0c\u4ef7\u683c\u7b49\u3002<\/p>\n

2.2. GES\u7b97\u6cd5<\/h3>\n

GES\u7b97\u6cd5\u5168\u79f0\u4e3aGraph Embedding with Side Information\uff0c\u5047\u8bbe W \\mathbf{W} <\/span><\/span>W<\/span><\/span><\/span><\/span><\/span><\/span>\u8868\u793aitem\u6216\u8005side information\u7684embedding\u77e9\u9635\uff0c\u5176\u4e2d\uff0c W v 0 \\mathbf{W}_v^0 <\/span><\/span>W<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>0<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u8868\u793aitem v v <\/span><\/span>v<\/span><\/span><\/span><\/span><\/span>\u7684embedding\uff0c W v s \\mathbf{W}_v^s <\/span><\/span>W<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>s<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u8868\u793a\u7b2c s s <\/span><\/span>s<\/span><\/span><\/span><\/span><\/span>\u4e2aside information\uff0citem v v <\/span><\/span>v<\/span><\/span><\/span><\/span><\/span>\u5171\u6709 n n <\/span><\/span>n<\/span><\/span><\/span><\/span><\/span>\u4e2aside information\uff0c\u5219\u5bf9\u4e8eitem v v <\/span><\/span>v<\/span><\/span><\/span><\/span><\/span>\u5171\u6709 n + 1 n+1 <\/span><\/span>n<\/span><\/span>+<\/span><\/span><\/span><\/span>1<\/span><\/span><\/span><\/span><\/span>\u4e2a\u5411\u91cf\uff1a<\/p>\n

W v 0 \uff0c \u22ef \u2009 , W v n \u2208 R d \\mathbf{W}_v^0\uff0c\\cdots ,\\mathbf{W}_v^n\\in \\mathbb{R}^d <\/span><\/span>W<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>0<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\uff0c<\/span><\/span>\u22ef<\/span><\/span><\/span>,<\/span><\/span>W<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>n<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2208<\/span><\/span><\/span><\/span>R<\/span><\/span><\/span>d<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u5176\u4e2d\uff0c d d <\/span><\/span>d<\/span><\/span><\/span><\/span><\/span>\u4e3aembedding\u7684\u7ef4\u5ea6\u3002<\/p>\n

\u5bf9\u4e8eitem v v <\/span><\/span>v<\/span><\/span><\/span><\/span><\/span>\uff0c\u4f7f\u7528average-pooling\u5c06\u8fd9 n + 1 n+1 <\/span><\/span>n<\/span><\/span>+<\/span><\/span><\/span><\/span>1<\/span><\/span><\/span><\/span><\/span>\u4e2a\u5411\u91cf\u805a\u5408\u8d77\u6765\uff0c\u5f97\u5230item v v <\/span><\/span>v<\/span><\/span><\/span><\/span><\/span>\u7684\u5411\u91cf\u8868\u793a\uff1a<\/p>\n

H v = 1 n + 1 \u2211 s = 0 n W v s \\mathbf{H}_v=\\frac{1}{n+1}\\sum_{s=0}^{n}\\mathbf{W}_v^s <\/span><\/span>H<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span><\/span><\/span><\/span><\/span>n<\/span><\/span>+<\/span><\/span>1<\/span><\/span><\/span><\/span><\/span><\/span><\/span>1<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>s<\/span>=<\/span>0<\/span><\/span><\/span><\/span><\/span>\u2211<\/span><\/span><\/span><\/span>n<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>W<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>s<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

2.3. EGES\u7b97\u6cd5<\/h3>\n

EGES\u7b97\u6cd5\u5168\u79f0\u4e3aEnhanced Graph Embedding with Side Information\uff0c\u4ece\u5176\u540d\u5b57\u6765\u770b\u4fbf\u53ef\u4ee5\u77e5\u9053\uff0cEGES\u662fGES\u7684\u589e\u5f3a\u7248\u3002\u5728GES\u4e2d\uff0c\u6bcf\u4e00\u4e2a\u5411\u91cf\uff0c\u5305\u62ec\u4e00\u4e2aitem\u7684\u5411\u91cf\u4ee5\u53ca n n <\/span><\/span>n<\/span><\/span><\/span><\/span><\/span>\u4e2aside information\u7684\u5411\u91cf\uff0c\u8fd9\u4e9b\u5411\u91cf\u7684\u6743\u91cd\u662f\u4e00\u6837\u7684\u3002\u4ece\u5b9e\u9645\u7684\u60c5\u51b5\u6765\u770b\uff0c\u4e0d\u540c\u79cd\u7c7b\u7684side information\u5bf9\u4e8e\u6700\u7ec8\u7684embedding\u7684\u8d21\u732e\u662f\u4e0d\u4e00\u6837\u7684\u3002\u56e0\u6b64EGES\u5bf9GES\u4e2d\u7684\u5411\u91cf\u505a\u4e86\u52a0\u6743\u7684\u64cd\u4f5c\u3002<\/p>\n

\u5047\u8bbe\u5bf9\u4e8eitem v v <\/span><\/span>v<\/span><\/span><\/span><\/span><\/span>\uff0c\u6743\u91cd\u77e9\u9635\u4e3a A \u2208 R \u2223 V \u2223 \u00d7 ( n + 1 ) \\mathbf{A}\\in\\mathbb{R}^{\\left | V \\right |\\times \\left ( n+1 \\right )} <\/span><\/span>A<\/span><\/span><\/span>\u2208<\/span><\/span><\/span><\/span>R<\/span><\/span><\/span>\u2223<\/span><\/span>V<\/span>\u2223<\/span><\/span><\/span>\u00d7<\/span>(<\/span><\/span>n<\/span>+<\/span>1<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\uff0c\u5176\u4e2d\uff0c A i j \\mathbf{A}_{ij} <\/span><\/span>A<\/span><\/span><\/span>i<\/span>j<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u8868\u793a\u7b2c i i <\/span><\/span>i<\/span><\/span><\/span><\/span><\/span>\u4e2aitem\u7684\u7b2c j j <\/span><\/span>j<\/span><\/span><\/span><\/span><\/span>\u4e2aside information\u7684\u6743\u91cd\uff0c\u4e3a\u7b80\u5355\uff0c\u8bb0 a i j a_i^j <\/span><\/span>a<\/span><\/span>i<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u4e3a A i j \\mathbf{A}_{ij} <\/span><\/span>A<\/span><\/span><\/span>i<\/span>j<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\uff0c A i 0 \\mathbf{A}_{i0} <\/span><\/span>A<\/span><\/span><\/span>i<\/span>0<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u8868\u793a\u7684\u662fitem i i <\/span><\/span>i<\/span><\/span><\/span><\/span><\/span>\u672c\u8eab\u5411\u91cf\u7684\u6743\u91cd\uff0c\u8bb0\u4e3a a i 0 a_i^0 <\/span><\/span>a<\/span><\/span>i<\/span><\/span><\/span><\/span>0<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u3002<\/p>\n

\u5bf9\u4e8eitem v v <\/span><\/span>v<\/span><\/span><\/span><\/span><\/span>\uff0c\u52a0\u6743\u5e73\u5747\u540e\u7684\u7ed3\u679c\u4e3a\uff1a<\/p>\n

H v = \u2211 j = 0 n e a v j W v j \u2211 j = 0 n e a v j \\mathbf{H}_v=\\frac{\\sum _{j=0}^ne^{a_v^j}\\mathbf{W}_v^j}{\\sum _{j=0}^ne^{a_v^j}} <\/span><\/span>H<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span><\/span><\/span><\/span><\/span>\u2211<\/span><\/span>j<\/span>=<\/span>0<\/span><\/span><\/span><\/span><\/span>n<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2211<\/span><\/span>j<\/span>=<\/span>0<\/span><\/span><\/span><\/span><\/span>n<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>W<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u5176\u4e2d\uff0c\u4f7f\u7528 e a v j e^{a_v^j} <\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u800c\u4e0d\u662f a v j a_v^j <\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u662f\u4e3a\u4e86\u4fdd\u8bc1\u6743\u91cd\u5927\u4e8e0\u3002<\/p>\n

2.4. GES\u548cEGES\u7684\u6a21\u578b\u7ed3\u6784<\/h3>\n

GES\u548cEGES\u7684\u6a21\u578b\u7ed3\u6784\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n

\"\u63a8\u8350\u7cfb\u7edf\u4e2d\u7684\u5e38\u7528\u7b97\u6cd5\u2014\u2014\u57fa\u4e8eGraph
\u5176\u4e2d\uff0cDense Embeddings\u8868\u793a\u7684\u662fitem\u5411\u91cf\u4ee5\u53ca n n <\/span><\/span>n<\/span><\/span><\/span><\/span><\/span>\u4e2aside information\u7684\u5411\u91cf\u3002Hidden Representation\u5373\u4e3a\u5982\u4e0a\u516c\u5f0f\u4e2d\u7684 H v \\mathbf{H}_v <\/span><\/span>H<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u3002\u4ece\u4e0a\u8ff0\u8fc7\u7a0b\u6765\u770b\uff0cGES\u5373\u4e3aEGES\u6a21\u578b\u7684\u7b80\u5316\u7248\u672c\uff0c\u5373\u6743\u91cd\u90fd\u4e3a 1 n + 1 \\frac{1}{n+1} <\/span><\/span><\/span><\/span>n<\/span>+<\/span>1<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>1<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u3002<\/p>\n

2.5. EGES\u4e2ditem\u5411\u91cf\u7684\u6c42\u89e3<\/h3>\n

EGES\u7b97\u6cd5\u7684\u6d41\u7a0b\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n

\"\u63a8\u8350\u7cfb\u7edf\u4e2d\u7684\u5e38\u7528\u7b97\u6cd5\u2014\u2014\u57fa\u4e8eGraph
\u4eceEGES\u7b97\u6cd5\u7684\u6d41\u7a0b\u4e2d\uff0c\u7b14\u8005\u53d1\u73b0\uff0c\u5176\u4e0eDeepWalk\u7684\u6d41\u7a0b\u57fa\u672c\u4e00\u81f4\uff0c\u4e0d\u540c\u7684\u4e3b\u8981\u662f\u4e24\u70b9\uff1a1\uff09\u5b66\u4e60\u7684\u53c2\u6570\u4e0d\u540c\uff0c\u5728DeepWalk\u4e2d\u4e3b\u8981\u662fitem\u7684\u5411\u91cf\u8868\u793a\uff0c\u5728EGES\u4e2d\u4e0d\u4ec5\u8981\u5b66\u4e60item\u7684\u5411\u91cf W 0 \\mathbf{W}^0 <\/span><\/span>W<\/span><\/span><\/span>0<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\uff0c n n <\/span><\/span>n<\/span><\/span><\/span><\/span><\/span>\u4e2aside information\u7684\u5411\u91cf W 1 , \u22ef W n \\mathbf{W}^1,\\cdots \\mathbf{W}^n <\/span><\/span>W<\/span><\/span><\/span>1<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>,<\/span><\/span>\u22ef<\/span><\/span>W<\/span><\/span><\/span>n<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\uff0c\u8fd8\u5305\u62ec\u6743\u91cd\u7684\u77e9\u9635 A \\mathbf{A} <\/span><\/span>A<\/span><\/span><\/span><\/span><\/span><\/span>\uff1b2\uff09\u5728DeepWalk\u4e2d\u4f7f\u7528\u7684\u662fSkipGram\uff0c\u5728EGES\u4e2d\u4f7f\u7528\u7684\u662fWeightedSkipGram\u3002<\/p>\n

2.6. Weighted Skip-Gram<\/h3>\n

Weighted Skip-Gram\u7b97\u6cd5\u7684\u6d41\u7a0b\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

\"\u63a8\u8350\u7cfb\u7edf\u4e2d\u7684\u5e38\u7528\u7b97\u6cd5\u2014\u2014\u57fa\u4e8eGraph
\u4e3a\u4e86\u80fd\u591f\u66f4\u597d\u7684\u7406\u89e3\u4e0a\u8ff0\u7684\u6d41\u7a0b\uff0c\u6211\u4eec\u9700\u8981\u5148\u4e86\u89e3word2vec\u4e2dSkip-Gram\u6a21\u578b\u7684\u5177\u4f53\u6d41\u7a0b\uff0c\u5728\u8bcd\u5411\u91cf\u7684\u6c42\u89e3\u8fc7\u7a0b\u4e2d\u9664\u4e86Skip-Gram\u8fd8\u53ef\u4ee5\u662fCBOW\u6a21\u578b\uff0c\u672c\u6587\u7684\u91cd\u70b9\u662fSkip-Gram\u6a21\u578b\uff0cSkip-Gram\u6a21\u578b\u7684\u7ed3\u6784\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n

\"\u63a8\u8350\u7cfb\u7edf\u4e2d\u7684\u5e38\u7528\u7b97\u6cd5\u2014\u2014\u57fa\u4e8eGraph
\u4e3a\u8ba8\u8bba\u7684\u65b9\u4fbf\uff0c\u5047\u8bbe\u5728Skip-Gram\u6a21\u578b\u4e2d\uff0c\u6bcf\u4e2a\u8bcd\u7684\u5411\u91cf\u7ef4\u5ea6\u4e3a d d <\/span><\/span>d<\/span><\/span><\/span><\/span><\/span>\uff0c\u5728\u8bcd\u5178 V V <\/span><\/span>V<\/span><\/span><\/span><\/span><\/span>\u4e2d\uff0c\u4e2d\u5fc3\u8bcd w c w_c <\/span><\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u7684\u8bcd\u5411\u91cf\u4e3a v c \u2208 R d v_c\\in \\mathbb{R}^d <\/span><\/span>v<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2208<\/span><\/span><\/span><\/span>R<\/span><\/span><\/span>d<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\uff0c\u80cc\u666f\u8bcd w o w_o <\/span><\/span>w<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u7684\u8bcd\u5411\u91cf\u4e3a u o \u2208 R d u_o\\in \\mathbb{R}^d <\/span><\/span>u<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2208<\/span><\/span><\/span><\/span>R<\/span><\/span><\/span>d<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u3002\u7ed9\u5b9a\u4e2d\u5fc3\u8bcd\u751f\u6210\u80cc\u666f\u8bcd\u7684\u6761\u4ef6\u6982\u7387\u53ef\u4ee5\u901a\u8fc7\u5bf9\u5411\u91cf\u5185\u79ef\u505asoftmax\u8fd0\u7b97\u800c\u5f97\u5230\uff1a<\/p>\n

P ( w o \u2223 w c ) = e x p ( u o T v c ) \u2211 i \u2208 V e x p ( u i T v c ) P\\left ( w_o\\mid w_c \\right )=\\frac{exp\\left ( u_o^Tv_c \\right )}{\\sum _{i\\in V}exp\\left ( u_i^Tv_c \\right )} <\/span><\/span>P<\/span><\/span>(<\/span>w<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span>=<\/span><\/span><\/span><\/span><\/span><\/span>\u2211<\/span><\/span>i<\/span>\u2208<\/span>V<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span>x<\/span>p<\/span><\/span>(<\/span><\/span>u<\/span><\/span>i<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>v<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span>x<\/span>p<\/span><\/span>(<\/span><\/span>u<\/span><\/span>o<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>v<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u6b64\u65f6\uff0c\u5bf9\u4e8e\u6574\u4e2a\u6587\u672c\u53ef\u4ee5\u5f97\u5230\u5982\u4e0b\u7684\u6982\u7387\u5f62\u5f0f\uff1a<\/p>\n

\u220f t = 1 T \u220f \u2212 m \u2a7d j \u2a7d m , j \u2260 0 P ( w ( t + j ) \u2223 w ( t ) ) \\prod_{t=1}^{T}\\prod _{-m\\leqslant j\\leqslant m,j\\neq 0}P\\left ( w^{\\left ( t+j \\right )}\\mid w^{\\left ( t \\right )} \\right ) <\/span><\/span><\/span>t<\/span>=<\/span>1<\/span><\/span><\/span><\/span><\/span>\u220f<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2212<\/span>m<\/span>\u2a7d<\/span>j<\/span>\u2a7d<\/span>m<\/span>,<\/span>j<\/span><\/span><\/span>\ue020<\/span><\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span>0<\/span><\/span><\/span><\/span><\/span>\u220f<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>P<\/span><\/span>(<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>+<\/span>j<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u8bed\u8a00\u6a21\u578b\u4e2d\u7684\u76ee\u6807\u662f\u8981\u4f7f\u5f97\u4e0a\u8ff0\u7684\u6982\u7387\u6700\u5927\uff0c\u901a\u8fc7log\u4f3c\u7136\uff0c\u53ef\u4ee5\u5f97\u5230\u5982\u4e0b\u7684\u635f\u5931\u51fd\u6570\uff1a<\/p>\n

\u2212 \u220f t = 1 T \u220f \u2212 m \u2a7d j \u2a7d m , j \u2260 0 l o g \u2005\u200a P ( w ( t + j ) \u2223 w ( t ) ) -\\prod_{t=1}^{T}\\prod _{-m\\leqslant j\\leqslant m,j\\neq 0}log\\; P\\left ( w^{\\left ( t+j \\right )}\\mid w^{\\left ( t \\right )} \\right ) <\/span><\/span>\u2212<\/span><\/span><\/span>t<\/span>=<\/span>1<\/span><\/span><\/span><\/span><\/span>\u220f<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2212<\/span>m<\/span>\u2a7d<\/span>j<\/span>\u2a7d<\/span>m<\/span>,<\/span>j<\/span><\/span><\/span>\ue020<\/span><\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span>0<\/span><\/span><\/span><\/span><\/span>\u220f<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>l<\/span>o<\/span>g<\/span><\/span>P<\/span><\/span>(<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>+<\/span>j<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u5bf9\u4e8e l o g \u2005\u200a P ( w o \u2223 w c ) log\\; P\\left ( w_o\\mid w_c \\right ) <\/span><\/span>l<\/span>o<\/span>g<\/span><\/span>P<\/span><\/span>(<\/span>w<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span>\uff0c\u6709\uff1a<\/p>\n

l o g \u2005\u200a P ( w o \u2223 w c ) = u o T v c \u2212 l o g ( \u2211 i \u2208 V e x p ( u i T v c ) ) log\\; P\\left ( w_o\\mid w_c \\right )=u_o^Tv_c-log\\left ( \\sum _{i\\in V}exp\\left ( u_i^Tv_c \\right ) \\right ) <\/span><\/span>l<\/span>o<\/span>g<\/span><\/span>P<\/span><\/span>(<\/span>w<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span>=<\/span><\/span><\/span><\/span>u<\/span><\/span>o<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>v<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2212<\/span><\/span><\/span><\/span>l<\/span>o<\/span>g<\/span><\/span>(<\/span><\/span><\/span>i<\/span>\u2208<\/span>V<\/span><\/span><\/span><\/span><\/span>\u2211<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span>x<\/span>p<\/span><\/span>(<\/span><\/span>u<\/span><\/span>i<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>v<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u4e3a\u4e86\u80fd\u591f\u5bf9\u5176\u4e2d\u7684\u53c2\u6570\u6c42\u89e3\uff0c\u53ef\u4ee5\u4f7f\u7528\u68af\u5ea6\u4e0b\u964d\u6cd5\u6c42\u89e3\uff0c\u6b64\u65f6\u9700\u8981\u5bf9\u635f\u5931\u51fd\u6570\u6c42\u5bfc\uff0c\u4ee5 \u2202 l o g \u2005\u200a P ( w o \u2223 w c ) \u2202 v c \\frac{\\partial log\\; P\\left ( w_o\\mid w_c \\right )}{\\partial v_c} <\/span><\/span><\/span><\/span>\u2202<\/span>v<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2202<\/span>l<\/span>o<\/span>g<\/span><\/span>P<\/span>(<\/span><\/span>w<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u4e3a\u4f8b\uff1a<\/p>\n

\u2202 l o g \u2005\u200a P ( w o \u2223 w c ) \u2202 v c = u o \u2212 \u2211 j \u2208 V P ( w j \u2223 w c ) \u22c5 u j \\frac{\\partial log\\; P\\left ( w_o\\mid w_c \\right )}{\\partial v_c}=u_o-\\sum _{j\\in V}P\\left ( w_j\\mid w_c \\right )\\cdot u_j <\/span><\/span><\/span><\/span>\u2202<\/span>v<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2202<\/span>l<\/span>o<\/span>g<\/span><\/span>P<\/span><\/span>(<\/span>w<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span><\/span><\/span>u<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2212<\/span><\/span><\/span><\/span><\/span>j<\/span>\u2208<\/span>V<\/span><\/span><\/span><\/span><\/span>\u2211<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>P<\/span><\/span>(<\/span>w<\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span>\u22c5<\/span><\/span><\/span><\/span>u<\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u4ece\u4e0a\u8ff0\u7684\u516c\u5f0f\u53d1\u73b0\uff0c\u6bcf\u6b21\u7684\u6c42\u5bfc\u6570\u7684\u8fc7\u7a0b\u4e2d\uff0c\u90fd\u9700\u8981\u5bf9\u6574\u4e2a\u8bcd\u5178\u4e2d\u7684\u8bcd\u8ba1\u7b97\uff0c\u5982\u679c\u8bcd\u5178\u8f83\u5927\uff0c\u90a3\u4e48\u6bcf\u6b21\u66f4\u65b0\u65f6\u7684\u8ba1\u7b97\u6210\u672c\u5c31\u6bd4\u8f83\u5927\uff0c\u4e3a\u964d\u4f4e\u8ba1\u7b97\u6210\u672c\uff0c\u8fd1\u4f3c\u7684\u8bad\u7ec3\u65b9\u6cd5\u88ab\u63d0\u51fa\uff0c\u8d1f\u91c7\u6837\uff08Negative Sampling\uff09\u4fbf\u662f\u5176\u4e2d\u7684\u4e00\u79cd\u8fd1\u4f3c\u8ba1\u7b97\u65b9\u6cd5\u3002<\/p>\n

\u5bf9\u4e8e\u4e0a\u8ff0\u7ed9\u5b9a\u7684\u4e2d\u5fc3\u8bcd w c w_c <\/span><\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\uff0c\u7ed9\u5b9a\u4e00\u4e2a\u80cc\u666f\u7a97\u53e3\uff0c\u5047\u8bbe\u80cc\u666f\u8bcd w o w_o <\/span><\/span>w<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u51fa\u73b0\u5728 w c w_c <\/span><\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u7684\u80cc\u666f\u7a97\u53e3\u4e2d\u7684\u4e8b\u4ef6\u6982\u7387\u4e3a\uff1a<\/p>\n

P ( D = 1 \u2223 w c , w o ) = \u03c3 ( u o T v c ) P\\left ( D=1\\mid w_c,w_o \\right )=\\sigma \\left ( u_o^Tv_c \\right ) <\/span><\/span>P<\/span><\/span>(<\/span>D<\/span><\/span>=<\/span><\/span>1<\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>,<\/span><\/span>w<\/span><\/span>o<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span>=<\/span><\/span><\/span><\/span>\u03c3<\/span><\/span>(<\/span><\/span>u<\/span><\/span>o<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>v<\/span><\/span>c<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u5bf9\u4e8e\u7ed9\u5b9a\u7684\u957f\u5ea6\u4e3a T T <\/span><\/span>T<\/span><\/span><\/span><\/span><\/span>\u7684\u6587\u672c\uff0c\u5047\u8bbe\u65f6\u95f4\u6b65 t t <\/span><\/span>t<\/span><\/span><\/span><\/span><\/span>\u7684\u8bcd\u4e3a w ( t ) w^{\\left ( t \\right )} <\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u4e14\u80cc\u666f\u7a97\u53e3\u5927\u5c0f\u4e3a m m <\/span><\/span>m<\/span><\/span><\/span><\/span><\/span>\uff0c\u6b64\u65f6\u8054\u5408\u6982\u7387\u4e3a\uff1a<\/p>\n

\u220f t = 1 T \u220f \u2212 m \u2a7d j \u2a7d m , j \u2260 0 P ( D = 1 \u2223 w ( t ) , w ( t + j ) ) \\prod_{t=1}^{T}\\prod _{-m\\leqslant j\\leqslant m,j\\neq 0}P\\left ( D=1\\mid w^{\\left ( t \\right )},w^{\\left ( t+j \\right )} \\right ) <\/span><\/span><\/span>t<\/span>=<\/span>1<\/span><\/span><\/span><\/span><\/span>\u220f<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2212<\/span>m<\/span>\u2a7d<\/span>j<\/span>\u2a7d<\/span>m<\/span>,<\/span>j<\/span><\/span><\/span>\ue020<\/span><\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span>0<\/span><\/span><\/span><\/span><\/span>\u220f<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>P<\/span><\/span>(<\/span><\/span>D<\/span><\/span>=<\/span><\/span>1<\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>,<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>+<\/span>j<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u6b64\u65f6\u6a21\u578b\u4e2d\u4ec5\u8003\u8651\u4e86\u6b63\u6837\u672c\uff0c\u901a\u8fc7\u91c7\u6837 K K <\/span><\/span>K<\/span><\/span><\/span><\/span><\/span>\u4e2a\u672a\u51fa\u73b0\u5728\u8be5\u80cc\u666f\u7a97\u53e3\u4e2d\u7684\u8bcd\uff0c\u6b64\u65f6\u7684\u8054\u5408\u6982\u7387\u4e3a\uff1a<\/p>\n

\u220f t = 1 T \u220f \u2212 m \u2a7d j \u2a7d m , j \u2260 0 P ( w ( t + j ) \u2223 w ( t ) ) \\prod_{t=1}^{T}\\prod _{-m\\leqslant j\\leqslant m,j\\neq 0}P\\left ( w^{\\left ( t+j \\right )}\\mid w^{\\left ( t \\right )} \\right ) <\/span><\/span><\/span>t<\/span>=<\/span>1<\/span><\/span><\/span><\/span><\/span>\u220f<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2212<\/span>m<\/span>\u2a7d<\/span>j<\/span>\u2a7d<\/span>m<\/span>,<\/span>j<\/span><\/span><\/span>\ue020<\/span><\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span>0<\/span><\/span><\/span><\/span><\/span>\u220f<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>P<\/span><\/span>(<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>+<\/span>j<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u5176\u4e2d\uff0c P ( w ( t + j ) \u2223 w ( t ) ) P\\left ( w^{\\left ( t+j \\right )}\\mid w^{\\left ( t \\right )} \\right ) <\/span><\/span>P<\/span><\/span>(<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>+<\/span>j<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u53ef\u4ee5\u8868\u793a\u4e3a\uff1a<\/p>\n

P ( w ( t + j ) \u2223 w ( t ) ) = P ( D = 1 \u2223 w ( t ) , w ( t + j ) ) \u22c5 \u220f k = 1 K P ( D = 0 \u2223 w ( t ) , w k ) P\\left ( w^{\\left ( t+j \\right )}\\mid w^{\\left ( t \\right )} \\right )=P\\left ( D=1\\mid w^{\\left ( t \\right )},w^{\\left ( t+j \\right )} \\right )\\cdot \\prod_{k=1}^{K}P\\left ( D=0\\mid w^{\\left ( t \\right )},w_k \\right ) <\/span><\/span>P<\/span><\/span>(<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>+<\/span>j<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span>=<\/span><\/span><\/span><\/span>P<\/span><\/span>(<\/span><\/span>D<\/span><\/span>=<\/span><\/span>1<\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>,<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>+<\/span>j<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span>\u22c5<\/span><\/span><\/span><\/span><\/span>k<\/span>=<\/span>1<\/span><\/span><\/span><\/span><\/span>\u220f<\/span><\/span><\/span><\/span>K<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>P<\/span><\/span>(<\/span><\/span>D<\/span><\/span>=<\/span><\/span>0<\/span><\/span>\u2223<\/span><\/span>w<\/span><\/span>(<\/span><\/span>t<\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>,<\/span><\/span>w<\/span><\/span>k<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u53ef\u4ee5\u9a8c\u8bc1\uff0c\u6b64\u65f6\u8ba1\u7b97\u4e0d\u518d\u4e0e\u8bcd\u5178\u5927\u5c0f\u76f8\u5173\uff0c\u800c\u662f\u4e0e\u8d1f\u91c7\u6837\u7684\u53c2\u6570 K K <\/span><\/span>K<\/span><\/span><\/span><\/span><\/span>\u76f8\u5173\uff0c\u4ee5\u4e0a\u4fbf\u662fSkip-Gram\u6a21\u578b\u4ee5\u53ca\u8d1f\u91c7\u6837\u7684\u76f8\u5173\u5185\u5bb9\u3002<\/p>\n

\u5bf9\u4e8e\u91c7\u6837\u5230\u7684\u6837\u672c u u <\/span><\/span>u<\/span><\/span><\/span><\/span><\/span>\uff0c\u5176\u5bf9\u5e94\u7684\u5411\u91cf\u4e3a Z u \\mathbf{Z}_u <\/span><\/span>Z<\/span><\/span><\/span>u<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\uff0c\u7531\u4e0a\u8ff0\u7684\u7406\u8bba\u53ef\u4ee5\u5f97\u5230\uff1a<\/p>\n

L ( v , u , y ) = \u2212 [ y l o g ( \u03c3 ( H v T Z u ) ) + ( 1 \u2212 y ) l o g ( 1 \u2212 \u03c3 ( H v T Z u ) ) ] \\mathfrak{L}\\left ( v,u,y \\right )=-\\left [ ylog\\left ( \\sigma \\left ( \\mathbf{H}_v^T\\mathbf{Z}_u \\right ) \\right )+\\left ( 1-y \\right )log\\left ( 1-\\sigma \\left ( \\mathbf{H}_v^T\\mathbf{Z}_u \\right ) \\right ) \\right ] <\/span><\/span>L<\/span><\/span><\/span>(<\/span>v<\/span>,<\/span><\/span>u<\/span>,<\/span><\/span>y<\/span>)<\/span><\/span><\/span>=<\/span><\/span><\/span><\/span>\u2212<\/span><\/span>[<\/span><\/span>y<\/span>l<\/span>o<\/span>g<\/span><\/span>(<\/span><\/span>\u03c3<\/span><\/span>(<\/span><\/span>H<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>Z<\/span><\/span><\/span>u<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span>)<\/span><\/span><\/span><\/span>+<\/span><\/span>(<\/span>1<\/span><\/span>\u2212<\/span><\/span>y<\/span>)<\/span><\/span><\/span>l<\/span>o<\/span>g<\/span><\/span>(<\/span><\/span>1<\/span><\/span>\u2212<\/span><\/span>\u03c3<\/span><\/span>(<\/span><\/span>H<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>Z<\/span><\/span><\/span>u<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span>)<\/span><\/span><\/span>]<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u53ef\u4ee5\u5f97\u5230\u5982\u4e0b\u7684\u5bfc\u6570\uff1a<\/p>\n

\u2202 L \u2202 Z u = ( \u03c3 ( H v T Z u ) \u2212 y ) H v \\frac{\\partial \\mathfrak{L}}{\\partial \\mathbf{Z}_u}=\\left ( \\sigma \\left ( \\mathbf{H}_v^T\\mathbf{Z}_u \\right )-y \\right )\\mathbf{H}_v <\/span><\/span><\/span><\/span>\u2202<\/span>Z<\/span><\/span><\/span>u<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2202<\/span>L<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span><\/span><\/span>(<\/span><\/span>\u03c3<\/span><\/span>(<\/span><\/span>H<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>Z<\/span><\/span><\/span>u<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span>\u2212<\/span><\/span>y<\/span>)<\/span><\/span><\/span><\/span>H<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u2202 L \u2202 a v s = ( \u03c3 ( H v T Z u ) \u2212 y ) Z u ( \u2211 j = 0 n e a v j ) e a v s W v s \u2212 e a v s \u2211 j = 0 n e a v j W v j ( \u2211 j = 0 n e a v j ) 2 \\frac{\\partial \\mathfrak{L}}{\\partial a_v^s}=\\left ( \\sigma \\left ( \\mathbf{H}_v^T\\mathbf{Z}_u \\right )-y \\right )\\mathbf{Z}_u\\frac{\\left ( \\sum_{j=0}^{n}e^{a_v^j} \\right )e^{a_v^s}\\mathbf{W}_v^s-e^{a_v^s}\\sum_{j=0}^{n}e^{a_v^j}\\mathbf{W}_v^j}{\\left ( \\sum_{j=0}^{n}e^{a_v^j} \\right )^2} <\/span><\/span><\/span><\/span>\u2202<\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>s<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2202<\/span>L<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span><\/span><\/span>(<\/span><\/span>\u03c3<\/span><\/span>(<\/span><\/span>H<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>Z<\/span><\/span><\/span>u<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span>\u2212<\/span><\/span>y<\/span>)<\/span><\/span><\/span><\/span>Z<\/span><\/span><\/span>u<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>(<\/span><\/span>\u2211<\/span><\/span>j<\/span>=<\/span>0<\/span><\/span><\/span><\/span><\/span>n<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span>2<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>(<\/span><\/span>\u2211<\/span><\/span>j<\/span>=<\/span>0<\/span><\/span><\/span><\/span><\/span>n<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>s<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>W<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>s<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2212<\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>s<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2211<\/span><\/span>j<\/span>=<\/span>0<\/span><\/span><\/span><\/span><\/span>n<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>W<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u2202 L \u2202 W v s = e a v s \u2211 j = 0 n e a v j ( \u03c3 ( H v T Z u ) \u2212 y ) Z u \\frac{\\partial \\mathfrak{L}}{\\partial \\mathbf{W}_v^s}=\\frac{e^{a_v^s}}{\\sum_{j=0}^{n}e^{a_v^j}}\\left ( \\sigma \\left ( \\mathbf{H}_v^T\\mathbf{Z}_u \\right )-y \\right )\\mathbf{Z}_u <\/span><\/span><\/span><\/span>\u2202<\/span>W<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>s<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u2202<\/span>L<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>=<\/span><\/span><\/span><\/span><\/span><\/span>\u2211<\/span><\/span>j<\/span>=<\/span>0<\/span><\/span><\/span><\/span><\/span>n<\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>j<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>e<\/span><\/span>a<\/span><\/span>v<\/span><\/span><\/span><\/span>s<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>(<\/span><\/span>\u03c3<\/span><\/span>(<\/span><\/span>H<\/span><\/span><\/span>v<\/span><\/span><\/span><\/span>T<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>Z<\/span><\/span><\/span>u<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>)<\/span><\/span><\/span><\/span>\u2212<\/span><\/span>y<\/span>)<\/span><\/span><\/span><\/span>Z<\/span><\/span><\/span>u<\/span><\/span><\/span><\/span>\u200b<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n

\u53c2\u8003\u6587\u732e<\/h2>\n