{"id":330,"date":"2023-01-11T17:01:17","date_gmt":"2023-01-11T09:01:17","guid":{"rendered":"http:\/\/8.154.33.202\/?p=330"},"modified":"2023-01-11T17:08:35","modified_gmt":"2023-01-11T09:08:35","slug":"%e4%bf%a1%e6%81%af%e8%ae%ba%e5%9f%ba%e7%a1%80%e5%ad%a6%e4%b9%a0%ef%bc%88%e4%b8%80%ef%bc%89","status":"publish","type":"post","link":"http:\/\/8.154.33.202\/?p=330","title":{"rendered":"\u4fe1\u606f\u8bba\u57fa\u7840\u5b66\u4e60\uff08\u4e00\uff09"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">\u4fe1\u606f\u91cf<\/h4>\n\n\n\n<p>\u5982\u679c\u73b0\u5728\u77e5\u9053\u4e86\u4e00\u4e2a\u968f\u673a\u4e8b\u4ef6\u7684\u7ed3\u679c\uff0c\u90a3\u4e48\u5982\u4f55\u8861\u91cf\u77e5\u9053\u8fd9\u4e2a\u7ed3\u679c\u6240\u5e26\u6765\u7684\u4fe1\u606f\u5462\uff1f\u6216\u8005\u8bf4\u77e5\u9053\u4e86\u8fd9\u4e2a\u7ed3\u679c\uff0c\u76f8\u8f83\u4e8e\u4e0d\u77e5\u9053\u8fd9\u4e2a\u7ed3\u679c\uff0c\u6240\u51cf\u5c11\u7684\u4e0d\u786e\u5b9a\u6027\u662f\u591a\u5c11\uff1fshannon\u9488\u5bf9\u8fd9\u4e2a\u95ee\u9898\u7ed9\u51fa\u4e86\u4e8b\u4ef6m\u7684\u4fe1\u606f\u91cf\u7684\u5b9a\u4e49\uff1a<\/p>\n\n\n\n<p> $$ I(m) = log(\\frac{1}{p(m)}) = -log(p(m)) $$<\/p>\n\n\n\n<p>\u5176\u4e2d\uff0c\\( p(m) \\) \u662fm\u53d1\u751f\u7684\u6982\u7387\uff0clog\u4ee52\u4e3a\u5e95\u7684\u8bdd\uff0c\u8ba1\u7b97\u7ed3\u679c\u4ee5shannon\u4e3a\u5355\u4f4d\uff0c\u6216\u8005\u662f\u66f4\u901a\u7528\u7684bit\u4e3a\u5355\u4f4d\u3002 \u4e3a\u4ec0\u4e48\u5b9a\u4e49\u6210\u8fd9\u79cd\u5f62\u5f0f\uff0c\u56e0\u4e3a\u9700\u8981\u4fe1\u606f\u91cf\u6ee1\u8db3\u4ee5\u4e0b\u4e24\u4e2a\u6761\u4ef6\uff1a1\u3001\u4e8b\u4ef6\u7ed3\u679c\u53d1\u751f\u6982\u7387\u8d8a\u5927\uff0c\u4fe1\u606f\u91cf\u8d8a\u5c11\uff0c\u5373\u4e8b\u4ef6\u7ed3\u679c\u7684\u4fe1\u606f\u91cf\u4e0e\u5176\u53d1\u751f\u6982\u7387\u5448\u8d1f\u76f8\u5173\u30022\u3001\u591a\u4e2a\u4e8b\u4ef6\u7ed3\u679c\u540c\u65f6\u53d1\u751f\u7684\u4fe1\u606f\u91cf\uff0c\u7b49\u4e8e\u5176\u4e2d\u6bcf\u4e2a\u4e8b\u4ef6\u7ed3\u679c\u4fe1\u606f\u91cf\u4e4b\u548c\u3002 \u4ece\u8be5\u5b9a\u4e49\u53ef\u4ee5\u5f97\u5230\uff0c\u53d1\u751f\u6982\u7387\u8d8a\u4f4e\u7684\u4e8b\u4ef6\uff0c\u5e26\u6765\u7684\u4fe1\u606f\u91cf\u8d8a\u5927\u3002\u53cd\u4e4b\u5219\u8d8a\u5c0f\u3002\u8fd9\u4e5f\u7b26\u5408\u5e38\u89c4\u7684\u8ba4\u77e5\u3002\u6bd4\u5982\u77e5\u9053\u660e\u5929\u7684\u5929\u6c14\u662f\u6674\u5929\uff0c\u90a3\u4e48\u7ed9\u6211\u4eec\u5e26\u6765\u7684\u4fe1\u606f\u91cf\u5219\u4e0d\u662f\u592a\u5927\uff0c\u56e0\u4e3a\u6674\u5929\u5f88\u5e38\u89c1\u3002\u4f46\u662f\u5982\u679c\u77e5\u9053\u660e\u5929\u4f1a\u6709\u9f99\u5377\u98ce\uff0c\u90a3\u4e48\u5219\u5e26\u6765\u4e86\u5f88\u5927\u7684\u4fe1\u606f\u91cf\uff0c\u56e0\u4e3a\u9f99\u5377\u98ce\u662f\u5f88\u7f55\u89c1\u7684\u5929\u6c14\u3002\u4ece\u53e6\u4e00\u4e2a\u89d2\u5ea6\u53bb\u7406\u89e3\uff0c\u5b9a\u4e49\u7684\u4e00\u4e2a\u4e8b\u4ef6\u7684\u4fe1\u606f\u91cf\u8868\u793a\u8fd9\u4e2a\u4e8b\u4ef6\u4f1a\u5e26\u6765\u7684\u201c\u60ca\u8bb6\u5ea6\u201d\uff08surprise\uff09\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u71b5<\/h4>\n\n\n\n<p> \u8868\u793a\u4e00\u4e2a\u968f\u673a\u4e8b\u4ef6\u6240\u6709\u7ed3\u679c\u7684\u4fe1\u606f\u91cf\u7684\u671f\u671b\u3002\u6216\u8005\u8bf4\u5728\u53ea\u77e5\u9053\u6240\u6709\u7ed3\u679c\u7684\u6982\u7387\u5206\u5e03\u65f6\uff0c\u6574\u4e2a\u7cfb\u7edf\u7684\u4e0d\u786e\u5b9a\u6027\u3002 \\[ {\\rm H}(M) = {\\rm E}[{\\rm I}(M)] = \\sum_{m\u2208M}p(m){\\rm I}(m) = -\\sum_{m\u2208M}p(m){\\rm log}p(m)  \\] <\/p>\n\n\n\n<p style=\"text-align:left\"> \u4e00\u4e2a\u968f\u673a\u7cfb\u7edf\u7684\u71b5\uff0c\u5728\u5404\u4e2a\u7ed3\u679c\u7684\u6982\u7387\u76f8\u7b49\u65f6\uff0c\u662f\u6700\u5927\u7684\u3002\u8fd9\u65f6\u7cfb\u7edf\u7684\u968f\u673a\u6027\u4e5f\u662f\u6700\u5927\u7684\u3002\u800c\u5982\u679c\u8fd9\u4e2a\u968f\u673a\u7cfb\u7edf\u53ea\u4f1a\u6709\u4e00\u4e2a\u786e\u5b9a\u7684\u7ed3\u679c\uff0c\u90a3\u4e48\u71b5\u4e3a0\uff0c\u7cfb\u7edf\u662f\u786e\u5b9a\u7684\u6ca1\u6709\u968f\u673a\u6027\u3002\u5728\u7269\u7406\u4e2d\uff0c\u71b5\u7684\u6982\u5ff5\u662f\u8868\u793a\u4e00\u4e2a\u7cfb\u7edf\u6df7\u4e71\u7684\u7a0b\u5ea6\uff0c\u4e0e\u4fe1\u606f\u8bba\u4e2d\u7684\u71b5\u6709\u7740\u76f8\u540c\u7684\u5185\u6db5\u3002\u4ece\u53e6\u4e00\u4e2a\u89d2\u5ea6\u7406\u89e3\uff0c\u71b5\u4e5f\u53ef\u4ee5\u7406\u89e3\u6210\u7cfb\u7edf\u6df7\u4e71\u6027\u7684\u8861\u91cf\u3002  <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">KL\u6563\u5ea6<\/h4>\n\n\n\n<p> \u8868\u793a\u4e24\u4e2a\u5206\u5e03\u4e4b\u95f4\u7684\u5dee\u5f02\u7a0b\u5ea6\u7684\u91cf\u5316\uff0c\u4e5f\u5c31\u662f\u8fd9\u4e2a\u4e24\u4e2a\u5206\u5e03\u7684\u201c\u8ddd\u79bb\u201d\u3002\uff08\u5b9e\u9645\u4e0a\u4e0d\u80fd\u76f4\u63a5\u5f53\u6210\u8ddd\u79bb\uff0c\u56e0\u4e3a\u4e0d\u6ee1\u8db3\u5bf9\u79f0\u6027\uff0c\u5373\\( KL(p||q) \u2260 KL(q||p) \\)\uff0c\u800c\u4e14\u4e0d\u80fd\u6ee1\u8db3\u4e09\u89d2\u5f62\u4e24\u8fb9\u4e4b\u548c\u4e00\u5b9a\u5927\u4e8e\u7b2c\u4e09\u8fb9\u7684\u6761\u4ef6\uff0c\u5373\\( KL(p||r) + KL(r||q) \\) \u4e00\u5b9a\u5927\u4e8e\\( KL(p||q)) \\) <\/p>\n\n\n\n<p>\\[ KL(p(X)||q(X)) = \\sum_{x\u2208X}-p(x){\\rm log}q(x) &#8211; \\sum_{x\u2208X}-p(x){\\rm log}p(x) = \\sum_{x\u2208X}p(x){\\rm log}\\frac{p(x)}{q(x)} \\]<\/p>\n\n\n\n<p>\u5f53\u4e24\u4e2a\u5206\u5e03\u5b8c\u5168\u76f8\u540c\u65f6\uff0cKL\u6563\u5ea6\u4e3a0\u3002 \u5728\u6df1\u5ea6\u5b66\u4e60\u4e2d\uff0cKL\u6563\u5ea6\u5e38\u7528\u6765\u4f5c\u4e3a\u4e24\u4e2a\u5206\u5e03\u4e4b\u95f4\u5dee\u5f02\u7684\u8861\u91cf\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u786e\u5b9a\u7684\u5206\u5e03\\(p\\)\uff0c\u901a\u8fc7KL\u6563\u5ea6\u8861\u91cf\u4e00\u4e2a\u4f30\u8ba1\u7684\u5206\u5e03\\(q\\)\u548c\\(p\\)\u4e4b\u95f4\u7684\u5dee\u5f02\\(KL(p||q)\\)\u3002\u901a\u8fc7\u51cf\u5c11KL\u6563\u5ea6\u6765\u4f7f\\(q\\)\u548c\\(p\\)\u4e4b\u95f4\u7684\u5dee\u5f02\u3002 <\/p>\n\n\n\n<p> \u7ef4\u57fa\u767e\u79d1\u4e0a\u5bf9KL\u6563\u5ea6\u7684\u53e6\u4e00\u79cd\u89e3\u8bfb\uff1a  Another interpretation of the KL divergence is the &#8220;unnecessary surprise&#8221; introduced by a prior from the truth: suppose a number&nbsp;<em>X<\/em>&nbsp;is about to be drawn randomly from a discrete set with probability distribution&nbsp;\\(p(x)\\). If Alice knows the true distribution&nbsp;\\(p(x)\\), while Bob believes (has a&nbsp;prior) that the distribution is&nbsp;\\(q(x)\\), then Bob will be more&nbsp;surprised&nbsp;than Alice, on average, upon seeing the value of&nbsp;<em>X<\/em>. The KL divergence is the (objective) expected value of Bob&#8217;s (subjective) surprisal minus Alice&#8217;s surprisal, measured in bits if the&nbsp;<em>log<\/em>&nbsp;is in base 2. In this way, the extent to which Bob&#8217;s prior is &#8220;wrong&#8221; can be quantified in terms of how &#8220;unnecessarily surprised&#8221; it is expected to make him. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"id-\u4fe1\u606f\u8bba\u57fa\u7840\u5b66\u4e601\uff08\u4fe1\u606f\u91cf\u3001\u71b5\u3001KL\u6563\u5ea6\uff09-\u4ea4\u53c9\u71b5\u4e0eKL\u6563\u5ea6\">\u4ea4\u53c9\u71b5\u4e0eKL \u6563\u5ea6<\/h4>\n\n\n\n<p> \u4ea4\u53c9\u71b5\u5e38\u4f5c\u4e3a\u5206\u7c7b\u4efb\u52a1\u7684\u635f\u5931\u51fd\u6570\uff0c\u4f46\u662f\u6765\u6e90\u662f\u4ec0\u4e48\u3002\u5176\u5b9e\u672c\u8d28\u4e0a\uff0c\u51cf\u5c11\u4ea4\u53c9\u71b5\u635f\u5931\uff0c\u5176\u5b9e\u662f\u964d\u4f4e\u9884\u6d4b\u5206\u5e03\u4e0eGT\u5206\u5e03\u4e4b\u95f4\u7684KL\u6563\u5ea6\uff0c\u4ece\u800c\u8ba9\u9884\u6d4b\u5206\u5e03\u4e0eGT\u5206\u5e03\u63a5\u8fd1\u3002 <\/p>\n\n\n\n<p>\\[ \\begin{split} KL(p||q) &amp;= &#8211; \\sum_{k}p_{k}{\\rm log}\\frac{q_{k}}{p_{k}} \\\\ &amp;= -\\sum_{k}p_{k}{\\rm log}q_{k}  &#8211; ( &#8211; \\sum_{k}p_{k}{\\rm log}p_{k}) \\\\ &amp;= {\\rm H}(p, q) &#8211; {\\rm H}(p) \\end{split} \\]<\/p>\n\n\n\n<p> \u5176\u4e2d\\(p\\)\u4e3aGT\u7684\u5206\u5e03\uff0c\\(q\\)\u4e3a\u9884\u6d4b\u5206\u5e03\u3002\\({\\rm H}(p, q)\\)\u5c31\u662f\u4ea4\u53c9\u71b5\uff0c \\({\\rm H} (p)\\)\u662f\\(p\\)\u7684\u71b5\u3002\u56e0\u4e3aGT\u5206\u5e03\u662f\u786e\u5b9a\u7684\uff0c\u6240\u4ee5  \\({\\rm H} (p)\\) \u8fd9\u4e00\u9879\u662f\u4e00\u4e2a\u5b9a\u503c\uff0c\u4e0e\u6c42 \\(q\\) \u662f\u65e0\u5173\u7684\u3002\u56e0\u6b64\uff0c\u51cf\u5c11\u4ea4\u53c9\u71b5\u635f\u5931\uff0c\u5176\u5b9e\u5c31\u662f\u5728\u964d\u4f4e\u9884\u6d4b\u5206\u5e03\u4e0eGT\u5206\u5e03\u4e4b\u95f4\u7684KL\u6563\u5ea6\u3002 <\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"id-\u4fe1\u606f\u8bba\u57fa\u7840\u5b66\u4e601\uff08\u4fe1\u606f\u91cf\u3001\u71b5\u3001KL\u6563\u5ea6\uff09-\u6700\u5c0f\u5316KL\u6563\u5ea6\u7b49\u4ef7\u4e8e\u6700\u5927\u5316\u4f3c\u7136\u51fd\u6570\">\u6700\u5c0f\u5316KL\u6563\u5ea6\u7b49\u4ef7\u4e8e\u6700\u5927\u5316\u4f3c\u7136\u51fd\u6570<\/h4>\n\n\n\n<p> \u5bf9\u4e8e\u4e00\u4e2a\u672a\u77e5\u7684\\(p(x)\\)\uff0c\u53ef\u4ee5\u901a\u8fc7\\(q(x|\u03b8)\\)\u6765\u8fd1\u4f3c \\(p(x)\\) \uff0c \\(q(x|\u03b8)\\) \u7531\u53ef\u8c03\u8282\u7684\u53c2\u6570\\(\u03b8\\)\u63a7\u5236\uff08\u6bd4\u5982\u795e\u7ecf\u7f51\u7edc\u4e2d\u7684\u6743\u91cd\uff09\u3002\u901a\u8fc7\u6700\u5c0f\u5316\\({\\rm KL}(p(x)|q(x|\u03b8))\\)\u6765\u786e\u5b9a \\(q(x|\u03b8)\\) \u3002\u4f46\u662f\u8ba1\u7b97\u8fd9\u4e2aKL\u6563\u5ea6\u53c8\u8981\u6c42\u77e5\u9053 \\(p(x)\\) \uff0c\u8fd9\u6210\u4e86\u4e00\u4e2a\u5faa\u73af\u7684\u95ee\u9898\u3002\u91cd\u65b0\u5ba1\u89c6KL\u6563\u5ea6\uff0c\u5b83\u4e5f\u53ef\u4ee5\u7406\u89e3\u6210\\(log( p(x) \/ q(x|\u03b8) )\\)\u5173\u4e8e \\(p(x)\\) \u7684\u671f\u671b\uff0c\u800c\u6c42\u671f\u671b\u5219\u53ef\u4ee5\u901a\u8fc7\u8499\u7279\u5361\u6d1b\u4f30\u8ba1\u7684\u65b9\u5f0f\u8fdb\u884c\uff0c\u5728\u5b9e\u9645\u4e2d\u5c31\u662f\u91c7\u6837\u82e5\u5e72\u7684\u6570\u636e\uff0c\u7528\u8fd9\u4e9b\u6570\u636e\u8ba1\u7b97\\(log(p(x) \/ q(x|\u03b8))\\)\u7684\u5e73\u5747\u503c\u6765\u4f5c\u4e3a\u5176\u671f\u671b\u3002\u5199\u6210\u516c\u5f0f\u4e3a\uff1a <\/p>\n\n\n\n<p>\\[KL(p||q) \u2248 \\frac{1}{N}\\sum_{n=1}^{N}[-{\\rm ln}q(x_{n}|\\theta) + {\\rm ln}p(x_{n})]\\]<\/p>\n\n\n\n<p>\u5f0f\u4e2d\u53f3\u8fb9\u7b2c\u4e8c\u9879\u4e0e\\(\u03b8\\)\u65e0\u5173\uff0c\u4f18\u5316\u65f6\u53ef\u4ee5\u76f4\u63a5\u7701\u7565\u3002\u800c\u7b2c\u4e00\u9879\u5c31\u662f\u91c7\u6837\u6570\u636e\u7684\u8d1f\u5bf9\u6570\u4f3c\u7136\u51fd\u6570\uff0c\u540c\u65f6\u4e5f\u662f\u8bad\u7ec3\u5206\u7c7b\u7f51\u7edc\u7528\u7684\u4ea4\u53c9\u71b5\u51fd\u6570\u3002\u56e0\u6b64\uff0c\u6700\u5c0f\u5316KL\u6563\u5ea6\u7b49\u4ef7\u4e8e\u6700\u5927\u5316\u4f3c\u7136\u51fd\u6570\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4fe1\u606f\u91cf \u5982\u679c\u73b0\u5728\u77e5\u9053\u4e86\u4e00\u4e2a\u968f\u673a\u4e8b\u4ef6\u7684\u7ed3\u679c\uff0c\u90a3\u4e48\u5982\u4f55\u8861\u91cf\u77e5\u9053\u8fd9\u4e2a\u7ed3\u679c\u6240\u5e26\u6765\u7684\u4fe1\u606f\u5462\uff1f\u6216\u8005\u8bf4\u77e5\u9053\u4e86\u8fd9\u4e2a\u7ed3\u679c\uff0c\u76f8\u8f83\u4e8e &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/8.154.33.202\/?p=330\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u4fe1\u606f\u8bba\u57fa\u7840\u5b66\u4e60\uff08\u4e00\uff09\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-330","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/8.154.33.202\/index.php?rest_route=\/wp\/v2\/posts\/330"}],"collection":[{"href":"http:\/\/8.154.33.202\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/8.154.33.202\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/8.154.33.202\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/8.154.33.202\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=330"}],"version-history":[{"count":43,"href":"http:\/\/8.154.33.202\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions"}],"predecessor-version":[{"id":374,"href":"http:\/\/8.154.33.202\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions\/374"}],"wp:attachment":[{"href":"http:\/\/8.154.33.202\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/8.154.33.202\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/8.154.33.202\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}