{"id":312,"date":"2026-07-07T00:22:09","date_gmt":"2026-07-06T16:22:09","guid":{"rendered":"https:\/\/xuzbo.top\/?p=312"},"modified":"2026-07-07T20:04:01","modified_gmt":"2026-07-07T12:04:01","slug":"%e7%86%b5%e3%80%81%e7%9b%b8%e5%af%b9%e7%86%b5%e3%80%81%e4%ba%a4%e5%8f%89%e7%86%b5%e7%9a%84%e4%bf%a1%e6%81%af%e8%ae%ba%e8%a7%92%e5%ba%a6%e6%8e%a8%e5%af%bc","status":"publish","type":"post","link":"https:\/\/xuzbo.top\/index.php\/2026\/07\/07\/%e7%86%b5%e3%80%81%e7%9b%b8%e5%af%b9%e7%86%b5%e3%80%81%e4%ba%a4%e5%8f%89%e7%86%b5%e7%9a%84%e4%bf%a1%e6%81%af%e8%ae%ba%e8%a7%92%e5%ba%a6%e6%8e%a8%e5%af%bc\/","title":{"rendered":"\u71b5\u3001\u76f8\u5bf9\u71b5\u3001\u4ea4\u53c9\u71b5\u7684\u4fe1\u606f\u8bba\u89d2\u5ea6\u63a8\u5bfc"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728MLE\u548closs function\u8bbe\u8ba1\u7ae0\u8282\uff0c\u6211\u5728\u7edf\u8ba1\u89d2\u5ea6\u63a8\u5bfc\u4e86\u4ea4\u53c9\u71b5\u635f\u5931\u51fd\u6570\u662f\u5982\u4f55\u4ea7\u751f\u7684\uff0c\u5728\u8fd9\u4e00\u90e8\u5206\uff0c\u6211\u5c06\u4ece\u4fe1\u606f\u8bba\u89d2\u5ea6\u51fa\u53d1\uff0c\u63a8\u5bfc\u4fe1\u606f\u91cf\u3001\u71b5\u3001\u76f8\u5bf9\u71b5\u3001\u4ea4\u53c9\u71b5\u7684\u516c\u5f0f\u3002<\/p>\n\n\n  \r\n<style>\r\n  .wpj-jtoc.--jtoc-theme-basic-light.--jtoc-has-custom-styles {\r\n      --jtoc-numeration-suffix: \". \";    }<\/style>\r\n\r\n<div id=\"wpj-jtoc\" class=\"wpj-jtoc wpj-jtoc--main --jtoc-the-content --jtoc-theme-basic-light --jtoc-title-align-left --jtoc-toggle-icon --jtoc-toggle-position-right --jtoc-toggle-1 --jtoc-has-numeration --jtoc-has-custom-styles --jtoc-is-unfolded\" >\r\n  <!-- TOC -->\r\n  <div class=\"wpj-jtoc--toc \" >\r\n              <div class=\"wpj-jtoc--header\">\r\n        <div class=\"wpj-jtoc--header-main\">\r\n                    <div class=\"wpj-jtoc--title\">\r\n                        <span class=\"wpj-jtoc--title-label\">Table of contents<\/span>\r\n          <\/div>\r\n                                <div class=\"wpj-jtoc--toggle-wrap\">\r\n                                                          <div class=\"wpj-jtoc--toggle-box\">\r\n                  <div class=\"wpj-jtoc--toggle\"><\/div>\r\n                <\/div>\r\n                          <\/div>\r\n                  <\/div>\r\n      <\/div>\r\n            <div class=\"wpj-jtoc--body\">\r\n            <nav class=\"wpj-jtoc--nav\">\r\n        <ol class=\"wpj-jtoc--items\"><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content\" data-depth=\"2\">\r\n                        <a href=\"#%25e4%25bf%25a1%25e6%2581%25af%25e9%2587%258f%25e5%2585%25ac%25e5%25bc%258f%25e7%259a%2584%25e6%258e%25a8%25e5%25af%25bc\" title=\"\u4fe1\u606f\u91cf\u516c\u5f0f\u7684\u63a8\u5bfc\" data-numeration=\"1\" >\u4fe1\u606f\u91cf\u516c\u5f0f\u7684\u63a8\u5bfc<\/a>\r\n                    <\/div><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content\" data-depth=\"2\">\r\n                        <a href=\"#%25e7%2586%25b5%25e6%2595%25b4%25e4%25b8%25aa%25e7%25b3%25bb%25e7%25bb%259f%25e7%259a%2584%25e5%25b9%25b3%25e5%259d%2587%25e4%25b8%258d%25e7%25a1%25ae%25e5%25ae%259a%25e6%2580%25a7\" title=\"\u71b5\uff1a\u6574\u4e2a\u7cfb\u7edf\u7684\u5e73\u5747\u4e0d\u786e\u5b9a\u6027\" data-numeration=\"2\" >\u71b5\uff1a\u6574\u4e2a\u7cfb\u7edf\u7684\u5e73\u5747\u4e0d\u786e\u5b9a\u6027<\/a>\r\n                    <\/div><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content\" data-depth=\"2\">\r\n                        <a href=\"#%25e7%259b%25b8%25e5%25af%25b9%25e7%2586%25b5%25e7%2594%25a8-q-%25e6%258f%258f%25e8%25bf%25b0-p-%25e6%2597%25b6%25e6%258d%259f%25e5%25a4%25b1%25e4%25ba%2586%25e5%25a4%259a%25e5%25b0%2591%25e4%25bf%25a1%25e6%2581%25af\" title=\"\u76f8\u5bf9\u71b5\uff1a\u7528 Q \u63cf\u8ff0 P \u65f6\uff0c\u635f\u5931\u4e86\u591a\u5c11\u4fe1\u606f\uff1f\" data-numeration=\"3\" >\u76f8\u5bf9\u71b5\uff1a\u7528 Q \u63cf\u8ff0 P \u65f6\uff0c\u635f\u5931\u4e86\u591a\u5c11\u4fe1\u606f\uff1f<\/a>\r\n                    <\/div><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content\" data-depth=\"2\">\r\n                        <a href=\"#%25e4%25ba%25a4%25e5%258f%2589%25e7%2586%25b5%25e7%259c%259f%25e5%25ae%259e%25e5%2588%2586%25e5%25b8%2583-p-%25e4%25b8%258b%25e7%2594%25a8-q-%25e7%25bc%2596%25e7%25a0%2581%25e6%2589%2580%25e9%259c%2580%25e8%25a6%2581%25e7%259a%2584%25e4%25bf%25a1%25e6%2581%25af%25e9%2587%258f\" title=\"\u4ea4\u53c9\u71b5\uff1a\u771f\u5b9e\u5206\u5e03 P \u4e0b\uff0c\u7528 Q \u7f16\u7801\u6240\u9700\u8981\u7684\u4fe1\u606f\u91cf\" data-numeration=\"4\" >\u4ea4\u53c9\u71b5\uff1a\u771f\u5b9e\u5206\u5e03 P \u4e0b\uff0c\u7528 Q \u7f16\u7801\u6240\u9700\u8981\u7684\u4fe1\u606f\u91cf<\/a>\r\n                    <\/div><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content\" data-depth=\"2\">\r\n                        <a href=\"#%25e6%259c%25ba%25e5%2599%25a8%25e5%25ad%25a6%25e4%25b9%25a0%25e8%25a7%2586%25e8%25a7%2592%25e4%25b8%258b%25e7%259a%2584%25e4%25ba%25a4%25e5%258f%2589%25e7%2586%25b5\" title=\"\u673a\u5668\u5b66\u4e60\u89c6\u89d2\u4e0b\u7684\u4ea4\u53c9\u71b5\" data-numeration=\"5\" >\u673a\u5668\u5b66\u4e60\u89c6\u89d2\u4e0b\u7684\u4ea4\u53c9\u71b5<\/a>\r\n                    <\/div><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content\" data-depth=\"2\">\r\n                        <a href=\"#%25e4%25ba%258c%25e5%2588%2586%25e7%25b1%25bb%25e4%25ba%25a4%25e5%258f%2589%25e7%2586%25b5\" title=\"\u4e8c\u5206\u7c7b\u4ea4\u53c9\u71b5\" data-numeration=\"6\" >\u4e8c\u5206\u7c7b\u4ea4\u53c9\u71b5<\/a>\r\n                    <\/div><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content\" data-depth=\"2\">\r\n                        <a href=\"#%25e5%25a4%259a%25e5%2588%2586%25e7%25b1%25bb%25e4%25ba%25a4%25e5%258f%2589%25e7%2586%25b5%25e4%25b8%258e-softmax\" title=\"\u591a\u5206\u7c7b\u4ea4\u53c9\u71b5\u4e0e Softmax\" data-numeration=\"7\" >\u591a\u5206\u7c7b\u4ea4\u53c9\u71b5\u4e0e Softmax<\/a>\r\n                    <\/div><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content\" data-depth=\"2\">\r\n                        <a href=\"#%25e5%25b0%258f%25e7%25bb%2593\" title=\"\u5c0f\u7ed3\" data-numeration=\"8\" >\u5c0f\u7ed3<\/a>\r\n                    <\/div><\/li><\/ol>      <\/nav>\r\n          <\/div>\r\n      <\/div>\r\n<\/div>\r\n\n\n<h4 class=\"wp-block-heading joli-heading jtoc-heading\" id=\"%25e4%25bf%25a1%25e6%2581%25af%25e9%2587%258f%25e5%2585%25ac%25e5%25bc%258f%25e7%259a%2584%25e6%258e%25a8%25e5%25af%25bc\">\u4fe1\u606f\u91cf\u516c\u5f0f\u7684\u63a8\u5bfc<\/h4>\n\n\n<p class=\"wp-block-paragraph\">\u71b5\u901a\u5e38\u88ab\u7406\u89e3\u4e3a\u7cfb\u7edf\u7684\u6df7\u4e71\u7a0b\u5ea6\u548c\u4e0d\u786e\u5b9a\u6027\uff0c\u4e0d\u8fc7\u5728\u5b9a\u4e49\u71b5\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u8ba8\u8bba\u4ec0\u4e48\u662f\u2018\u4fe1\u606f\u91cf\u2019\u3002\u6211\u4eec\u5148\u63a8\u5bfc\u4fe1\u606f\u91cf\u7684\u516c\u5f0f\uff1a\u8bbe\u67d0\u4e2a\u4e8b\u4ef6\u53d1\u751f\u7684\u6982\u7387\u4e3a p\uff0c\u6211\u4eec\u5e0c\u671b\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570 <math data-latex=\"f(p):=\\text{\u4fe1\u606f\u91cf}\"><semantics><mrow><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>p<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo lspace=\"0.2222em\" rspace=\"0em\">:<\/mo><mo lspace=\"0em\">=<\/mo><mtext>\u4fe1\u606f\u91cf<\/mtext><\/mrow><annotation encoding=\"application\/x-tex\">f(p):=\\text{\u4fe1\u606f\u91cf}<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u76f4\u89c9\u4e0a\uff0c\u4e00\u4e2a\u4e8b\u4ef6\u8d8a\u96be\u53d1\u751f\uff0c\u5b83\u4e00\u65e6\u53d1\u751f\u4e86\uff0c\u4fe1\u606f\u91cf\u5c31\u8d8a\u5927\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u5047\u5b9a2026\u5e74\u963f\u6839\u5ef7\u536b\u5195\u51a0\u519b\u8fd9\u4e00\u4e8b\u4ef6\uff0c\u73b0\u5728\u6211\u4eec\u77e5\u9053\u963f\u6839\u5ef7\u5df2\u7ecf\u8fdb\u5165\u4e868\u5f3a\uff0c\u5047\u8bbe\u6bcf\u652f\u7403\u961f\u593a\u51a0\u6982\u7387\u76f8\u540c\uff0c\u6211\u4eec\u6709<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u963f\u6839\u5ef7\u593a\u51a0\u6982\u7387\u4e3a1\/8<\/li>\n\n\n\n<li>\u963f\u6839\u5ef7\u8fdb\u5165\u51b3\u8d5b\u7684\u6982\u73871\/4<\/li>\n\n\n\n<li>\u963f\u6839\u5ef7\u5728\u51b3\u8d5b\u4e2d\u80dc\u5229\u7684\u6982\u73871\/2<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u2018\u963f\u6839\u5ef7\u593a\u51a0\u2019\u53ef\u4ee5\u5206\u4e3a\u4e24\u4e2a\u9636\u6bb5\uff1a1.\u8fdb\u5165\u51b3\u8d5b\uff1b2.\u51b3\u8d5b\u4e2d\u80dc\u5229\uff0c\u90a3\u4e48\u5b83\u7684\u4fe1\u606f\u91cf\u4e5f\u5e94\u8be5\u53ef\u4ee5\u5206\u4e3a\u4e24\u4e2a\u90e8\u5206\uff1a<math data-latex=\"f(1\/8)=f(1\/4)+f(1\/2)\"><semantics><mrow><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1<\/mn><mi>\/<\/mi><mn>8<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1<\/mn><mi>\/<\/mi><mn>4<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>+<\/mo><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1<\/mn><mi>\/<\/mi><mn>2<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">f(1\/8)=f(1\/4)+f(1\/2)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e24\u4e2a\u72ec\u7acb\u4e8b\u4ef6\u540c\u65f6\u53d1\u751f\u7684\u6982\u7387\u662f\u76f8\u4e58\u7684\uff0c\u800c\u5b83\u4eec\u7684\u4fe1\u606f\u91cf\u5e94\u8be5\u662f\u76f8\u52a0\u7684\u3002\u56e0\u6b64\u6211\u4eec\u5e0c\u671b\u4fe1\u606f\u91cf\u51fd\u6570\u6ee1\u8db3<strong>\u6027\u8d281<\/strong>\uff1a<math data-latex=\"f(pq)=f(p)+f(q)\"><semantics><mrow><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>p<\/mi><mi>q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>p<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>+<\/mo><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">f(pq)=f(p)+f(q)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6ee1\u8db3\u8fd9\u79cd\u6027\u8d28\u7684\u51fd\u6570\uff0c\u81ea\u7136\u4f1a\u51fa\u73b0\u5bf9\u6570\u5f62\u5f0f\u3002\u56e0\u4e3a\uff1a<math data-latex=\"\\log(pq)=\\log p+\\log q\"><semantics><mrow><mrow><mi>log<\/mi><mo>\u2061<\/mo><\/mrow><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>p<\/mi><mi>q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mi>p<\/mi><mo>+<\/mo><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mi>q<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">\\log(pq)=\\log p+\\log q<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53e6\u6709<strong>\u6027\u8d282<\/strong>\uff1a\u6982\u7387\u8d8a\u5c0f\uff0c\u4fe1\u606f\u91cf\u5e94\u8be5\u8d8a\u5927\uff1b\u800c <math data-latex=\"\\log p\"><semantics><mrow><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mi>p<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">\\log p<\/annotation><\/semantics><\/math> \u5728 <math data-latex=\"0&lt;p&lt;1\"><semantics><mrow><mn>0<\/mn><mo>&lt;<\/mo><mi>p<\/mi><mo>&lt;<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">0&lt;p&lt;1<\/annotation><\/semantics><\/math> \u65f6\u662f\u8d1f\u6570\uff0c\u5e76\u4e14\u6982\u7387\u8d8a\u5c0f\uff0c<math data-latex=\"\\log p\"><semantics><mrow><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mi>p<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">\\log p<\/annotation><\/semantics><\/math> \u8d8a\u5c0f\u3002\u6240\u4ee5\u6211\u4eec\u52a0\u4e0a\u8d1f\u53f7\uff0c\u5b9a\u4e49\u4fe1\u606f\u91cf\u4e3a\uff1a<math data-latex=\"f(p)=-\\log p\"><semantics><mrow><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>p<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mi>p<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">f(p)=-\\log p<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4ee5 2 \u4e3a\u5e95\uff0c\u5219\u6709\uff1a<math data-latex=\"f(p)=-\\log_2 p\"><semantics><mrow><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>p<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><mi>p<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">f(p)=-\\log_2 p<\/annotation><\/semantics><\/math>\uff0c\u8fd9\u65f6\u4fe1\u606f\u91cf\u7684\u5355\u4f4d\u53eb\u505a <strong>bit<\/strong>\u3002\u4f8b\u5982\uff1a<math data-latex=\"f(1\/8)=-\\log_2(1\/8)=3\"><semantics><mrow><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1<\/mn><mi>\/<\/mi><mn>8<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1<\/mn><mi>\/<\/mi><mn>8<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>3<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">f(1\/8)=-\\log_2(1\/8)=3<\/annotation><\/semantics><\/math>\uff0c\u963f\u6839\u5ef7\u593a\u51a0\u7684\u4fe1\u606f\u91cf\u662f3bit\uff0c\u4e3a\u8fdb\u5165\u51b3\u8d5b\u548c\u8d62\u5f97\u51b3\u8d5b\u7684\u4fe1\u606f\u91cf\u4e4b\u548c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\u4ece\u53e6\u4e00\u4e2a\u89d2\u5ea6\u770b\uff0c\u5982\u679c\u4ee5 2 \u4e3a\u5e95\uff0c\u90a3\u4e48\u4fe1\u606f\u91cf\u53ef\u4ee5\u7406\u89e3\u4e3a\u201c\u9700\u8981\u591a\u5c11\u6b21\u4e8c\u9009\u4e00\u7684\u95ee\u9898\u624d\u80fd\u786e\u5b9a\u7ed3\u679c\u201d\u3002\u4f8b\u5982\uff0c\u8fde\u7eed\u629b 3 \u6b21\u786c\u5e01\uff0c\u5168\u90e8\u6b63\u9762\u7684\u6982\u7387\u662f\uff1a<math data-latex=\"\\frac{1}{2}\\times \\frac{1}{2}\\times \\frac{1}{2}=\\frac{1}{8}\"><semantics><mrow><mfrac><mn>1<\/mn><mn>2<\/mn><\/mfrac><mo>\u00d7<\/mo><mfrac><mn>1<\/mn><mn>2<\/mn><\/mfrac><mo>\u00d7<\/mo><mfrac><mn>1<\/mn><mn>2<\/mn><\/mfrac><mo>=<\/mo><mfrac><mn>1<\/mn><mn>8<\/mn><\/mfrac><\/mrow><annotation encoding=\"application\/x-tex\">\\frac{1}{2}\\times \\frac{1}{2}\\times \\frac{1}{2}=\\frac{1}{8}<\/annotation><\/semantics><\/math>\uff0c\u56e0\u6b64\u8fd9\u4e2a\u4e8b\u4ef6\u7684\u4fe1\u606f\u91cf\u5c31\u662f 3 bit\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading joli-heading jtoc-heading\" id=\"%25e7%2586%25b5%25e6%2595%25b4%25e4%25b8%25aa%25e7%25b3%25bb%25e7%25bb%259f%25e7%259a%2584%25e5%25b9%25b3%25e5%259d%2587%25e4%25b8%258d%25e7%25a1%25ae%25e5%25ae%259a%25e6%2580%25a7\">\u71b5\uff1a\u6574\u4e2a\u7cfb\u7edf\u7684\u5e73\u5747\u4e0d\u786e\u5b9a\u6027<\/h4>\n\n\n<p class=\"wp-block-paragraph\">\u4fe1\u606f\u91cf\u8861\u91cf\u7684\u662f\u5355\u4e2a\u65f6\u95f4\u53d1\u751f\u65f6\u5e26\u6765\u7684\u4fe1\u606f\u591a\u5c11\uff0c\u4f46\u4e00\u4e2a\u968f\u673a\u7cfb\u7edf\u6216\u5206\u5e03\u6709\u591a\u4e2a\u53ef\u80fd\u7684\u7ed3\u679c\uff0c\u5047\u8bbe\u4e00\u4e2a\u7cfb\u7edf\u6709 K \u79cd\u53ef\u80fd\u7ed3\u679c\uff1a<math data-latex=\"x_1,x_2,\\cdots,x_K\"><semantics><mrow><msub><mi>x<\/mi><mn>1<\/mn><\/msub><mo separator=\"true\">,<\/mo><msub><mi>x<\/mi><mn>2<\/mn><\/msub><mo separator=\"true\">,<\/mo><mo>\u22ef<\/mo><mspace width=\"0.1667em\"><\/mspace><mo separator=\"true\">,<\/mo><msub><mi>x<\/mi><mi>K<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">x_1,x_2,\\cdots,x_K<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b83\u4eec\u5bf9\u5e94\u7684\u6982\u7387\u5206\u5e03\u4e3a\uff1a<math data-latex=\"P=(p_1,p_2,\\cdots,p_K)\"><semantics><mrow><mi>P<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><msub><mi>p<\/mi><mn>1<\/mn><\/msub><mo separator=\"true\">,<\/mo><msub><mi>p<\/mi><mn>2<\/mn><\/msub><mo separator=\"true\">,<\/mo><mo>\u22ef<\/mo><mspace width=\"0.1667em\"><\/mspace><mo separator=\"true\">,<\/mo><msub><mi>p<\/mi><mi>K<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">P=(p_1,p_2,\\cdots,p_K)<\/annotation><\/semantics><\/math>\uff0c\u5176\u4e2d\uff1a<math data-latex=\"\\sum_{i=1}^{K}p_i=1\"><semantics><mrow><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\sum_{i=1}^{K}p_i=1<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6bcf\u4e2a\u4e8b\u4ef6 <math data-latex=\"x_i\"><semantics><msub><mi>x<\/mi><mi>i<\/mi><\/msub><annotation encoding=\"application\/x-tex\">x_i<\/annotation><\/semantics><\/math> \u7684\u4fe1\u606f\u91cf\u662f\uff1a<math data-latex=\"-\\log_2 p_i\"><semantics><mrow><mo>\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>p<\/mi><mi>i<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">-\\log_2 p_i<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u90a3\u4e48\u6574\u4e2a\u7cfb\u7edf\u7684\u5e73\u5747\u4fe1\u606f\u91cf\uff0c\u5c31\u662f\u5bf9\u6240\u6709\u53ef\u80fd\u7ed3\u679c\u7684\u4fe1\u606f\u91cf\u505a\u52a0\u6743\u5e73\u5747\uff1a<math data-latex=\"H(P)=\\sum_{i=1}^{K}p_i\\cdot (-\\log_2 p_i)\"><semantics><mrow><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo>\u22c5<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">H(P)=\\sum_{i=1}^{K}p_i\\cdot (-\\log_2 p_i)<\/annotation><\/semantics><\/math>\uff0c\u4e5f\u5c31\u662f\uff1a<math data-latex=\"H(P)=-\\sum_{i=1}^{K}p_i\\log_2 p_i\"><semantics><mrow><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>p<\/mi><mi>i<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">H(P)=-\\sum_{i=1}^{K}p_i\\log_2 p_i<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5c31\u662f\u71b5\uff0c\u6211\u5c06\u5176\u7406\u89e3\u4e3a<strong>\u4e00\u4e2a\u6982\u7387\u7cfb\u7edf\u5728\u5e73\u5747\u610f\u4e49\u4e0a\u7684\u4e0d\u786e\u5b9a\u6027<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u67d0\u4e2a\u7ed3\u679c\u51e0\u4e4e\u5fc5\u7136\u53d1\u751f\uff0c\u90a3\u4e48\u7cfb\u7edf\u7684\u4e0d\u786e\u5b9a\u6027\u5f88\u4f4e\uff0c\u71b5\u4e5f\u4f4e\u3002\u4f8b\u5982 <math data-latex=\"P=(1,0,0,0)\"><semantics><mrow><mi>P<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1,0,0,0<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">P=(1,0,0,0)<\/annotation><\/semantics><\/math>\uff0c\u8fd9\u4e2a\u7cfb\u7edf\u6ca1\u6709\u4e0d\u786e\u5b9a\u6027\uff0c\u56e0\u4e3a\u7ed3\u679c\u5df2\u7ecf\u786e\u5b9a\u3002\u4f46\u5982\u679c\u6bcf\u4e2a\u7ed3\u679c\u90fd\u5dee\u4e0d\u591a\u53ef\u80fd\u53d1\u751f\uff0c\u4f8b\u5982\uff1a<math data-latex=\"P=(1\/4,1\/4,1\/4,1\/4)\"><semantics><mrow><mi>P<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1<\/mn><mi>\/<\/mi><mn>4,1<\/mn><mi>\/<\/mi><mn>4,1<\/mn><mi>\/<\/mi><mn>4,1<\/mn><mi>\/<\/mi><mn>4<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">P=(1\/4,1\/4,1\/4,1\/4)<\/annotation><\/semantics><\/math>\uff0c\u90a3\u4e48\u7cfb\u7edf\u7684\u4e0d\u786e\u5b9a\u6027\u66f4\u9ad8\uff0c\u71b5\u4e5f\u66f4\u5927\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading joli-heading jtoc-heading\" id=\"%25e7%259b%25b8%25e5%25af%25b9%25e7%2586%25b5%25e7%2594%25a8-q-%25e6%258f%258f%25e8%25bf%25b0-p-%25e6%2597%25b6%25e6%258d%259f%25e5%25a4%25b1%25e4%25ba%2586%25e5%25a4%259a%25e5%25b0%2591%25e4%25bf%25a1%25e6%2581%25af\">\u76f8\u5bf9\u71b5\uff1a\u7528 Q \u63cf\u8ff0 P \u65f6\uff0c\u635f\u5931\u4e86\u591a\u5c11\u4fe1\u606f\uff1f<\/h4>\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\u6709\u4e24\u4e2a\u6982\u7387\u5206\u5e03\uff1a<math data-latex=\"P=(p_1,p_2,\\cdots,p_K)\"><semantics><mrow><mi>P<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><msub><mi>p<\/mi><mn>1<\/mn><\/msub><mo separator=\"true\">,<\/mo><msub><mi>p<\/mi><mn>2<\/mn><\/msub><mo separator=\"true\">,<\/mo><mo>\u22ef<\/mo><mspace width=\"0.1667em\"><\/mspace><mo separator=\"true\">,<\/mo><msub><mi>p<\/mi><mi>K<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">P=(p_1,p_2,\\cdots,p_K)<\/annotation><\/semantics><\/math>\uff0c<math data-latex=\"Q=(q_1,q_2,\\cdots,q_K)\"><semantics><mrow><mi>Q<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><msub><mi>q<\/mi><mn>1<\/mn><\/msub><mo separator=\"true\">,<\/mo><msub><mi>q<\/mi><mn>2<\/mn><\/msub><mo separator=\"true\">,<\/mo><mo>\u22ef<\/mo><mspace width=\"0.1667em\"><\/mspace><mo separator=\"true\">,<\/mo><msub><mi>q<\/mi><mi>K<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">Q=(q_1,q_2,\\cdots,q_K)<\/annotation><\/semantics><\/math>\uff0c\u5176\u4e2d\u5176\u4e2d\uff0cP \u662f\u771f\u5b9e\u5206\u5e03\uff0cQ \u662f\u6211\u4eec\u7528\u6765\u8fd1\u4f3c\u771f\u5b9e\u5206\u5e03\u7684\u6a21\u578b\u5206\u5e03\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u95ee\u9898\u4fbf\u53ef\u4ee5\u6536\u675f\u4e3a\uff1a<strong>\u5982\u679c\u771f\u5b9e\u4e16\u754c\u670d\u4ece\u5206\u5e03 (P)\uff0c\u4f46\u6211\u4eec\u7528\u5206\u5e03 (Q) \u53bb\u63cf\u8ff0\u5b83\uff0c\u4f1a\u989d\u5916\u635f\u5931\u591a\u5c11\u4fe1\u606f\uff1f<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u7b2c i \u4e2a\u4e8b\u4ef6\uff0c\u5982\u679c\u6211\u4eec\u6309\u7167\u771f\u5b9e\u5206\u5e03 P \u6765\u770b\uff0c\u5b83\u7684\u4fe1\u606f\u91cf\u662f\uff1a<math data-latex=\"-\\log_2 p_i\"><semantics><mrow><mo>\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>p<\/mi><mi>i<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">-\\log_2 p_i<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u5982\u679c\u6211\u4eec\u9519\u8bef\u5730\u7528 Q \u6765\u63cf\u8ff0\u5b83\uff0c\u90a3\u4e48\u5b83\u7684\u4fe1\u606f\u91cf\u4f1a\u88ab\u5199\u6210\uff1a<math data-latex=\"-\\log_2 q_i\"><semantics><mrow><mo>\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>q<\/mi><mi>i<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">-\\log_2 q_i<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e24\u8005\u7684\u5dee\u503c\u662f\uff1a<math data-latex=\"-\\log_2 q_i - (-\\log_2 p_i)\"><semantics><mrow><mo>\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>q<\/mi><mi>i<\/mi><\/msub><mo>\u2212<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">-\\log_2 q_i \u2013 (-\\log_2 p_i)<\/annotation><\/semantics><\/math>\uff0c\u4e5f\u5c31\u662f\uff1a<math data-latex=\"\\log_2 \\frac{p_i}{q_i}\"><semantics><mrow><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><mfrac><msub><mi>p<\/mi><mi>i<\/mi><\/msub><msub><mi>q<\/mi><mi>i<\/mi><\/msub><\/mfrac><\/mrow><annotation encoding=\"application\/x-tex\">\\log_2 \\frac{p_i}{q_i}<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7531\u4e8e\u771f\u5b9e\u7cfb\u7edf\u4e2d\u7b2c i \u4e2a\u4e8b\u4ef6\u51fa\u73b0\u7684\u6982\u7387\u662f <math data-latex=\"p_i\"><semantics><msub><mi>p<\/mi><mi>i<\/mi><\/msub><annotation encoding=\"application\/x-tex\">p_i<\/annotation><\/semantics><\/math>\uff08\u4ee5P\u4e3a\u57fa\u51c6\uff09\uff0c\u6240\u4ee5\u6211\u4eec\u5bf9\u6240\u6709\u4e8b\u4ef6\u505a\u52a0\u6743\u5e73\u5747\uff1a<math data-latex=\"D_{KL}(P|Q)=\\sum_{i=1}^{K}p_i\\left[(-\\log_2 q_i)-(-\\log_2 p_i)\\right]\"><semantics><mrow><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mrow><mo fence=\"true\" form=\"prefix\">[<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>q<\/mi><mi>i<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>\u2212<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo fence=\"true\" form=\"postfix\">]<\/mo><\/mrow><\/mrow><annotation encoding=\"application\/x-tex\">D_{KL}(P|Q)=\\sum_{i=1}^{K}p_i\\left[(-\\log_2 q_i)-(-\\log_2 p_i)\\right]<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5316\u7b80\u53ef\u5f97\uff1a<math data-latex=\"D_{KL}(P|Q)=\\sum_{i=1}^{K}p_i\\log_2 \\frac{p_i}{q_i}\"><semantics><mrow><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><mfrac><msub><mi>p<\/mi><mi>i<\/mi><\/msub><msub><mi>q<\/mi><mi>i<\/mi><\/msub><\/mfrac><\/mrow><annotation encoding=\"application\/x-tex\">D_{KL}(P|Q)=\\sum_{i=1}^{K}p_i\\log_2 \\frac{p_i}{q_i}<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5c31\u662f <strong>KL \u6563\u5ea6<\/strong>\uff0c\u4e5f\u53eb<strong>\u76f8\u5bf9\u71b5<\/strong>\u3002\u6211\u5c06\u5176\u7406\u89e3\u4e3a\u8861\u91cf\u4e24\u4e2a\u5206\u5e03\u4e4b\u95f4\u7684\u5dee\u5f02\uff1a<strong>\u5f53\u771f\u5b9e\u5206\u5e03\u662f (P)\uff0c\u4f46\u6211\u4eec\u4f7f\u7528\u8fd1\u4f3c\u5206\u5e03 (Q) \u6765\u63cf\u8ff0\u5b83\u65f6\uff0c\u5e73\u5747\u591a\u51fa\u6765\u7684\u4fe1\u606f\u4ee3\u4ef7<\/strong>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">KL \u6563\u5ea6\u6709\u4e00\u4e2a\u91cd\u8981\u6027\u8d28\uff1a<math data-latex=\"D_{KL}(P|Q)\\geq 0\"><semantics><mrow><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>\u2265<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">D_{KL}(P|Q)\\geq 0<\/annotation><\/semantics><\/math>\uff0c\u5e76\u4e14\u53ea\u6709\u5f53 P=Q \u65f6\uff0cKL \u6563\u5ea6\u7b49\u4e8e 0\u3002\u8fd9\u4e2a\u6027\u8d28\u6765\u81ea\u5409\u5e03\u65af\u4e0d\u7b49\u5f0f\uff0c\u5728\u6b64\u4e0d\u518d\u8bc1\u660e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0d\u8fc7\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cKL \u6563\u5ea6\u4e0d\u662f\u4e25\u683c\u610f\u4e49\u4e0a\u7684\u8ddd\u79bb\uff0c\u56e0\u4e3a\u901a\u5e38\uff1a<math data-latex=\"D_{KL}(P|Q)\\neq D_{KL}(Q|P)\"><semantics><mrow><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>\u2260<\/mo><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>Q<\/mi><mi>|<\/mi><mi>P<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">D_{KL}(P|Q)\\neq D_{KL}(Q|P)<\/annotation><\/semantics><\/math>\uff0c\u5b83\u662f\u6709\u65b9\u5411\u7684\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading joli-heading jtoc-heading\" id=\"%25e4%25ba%25a4%25e5%258f%2589%25e7%2586%25b5%25e7%259c%259f%25e5%25ae%259e%25e5%2588%2586%25e5%25b8%2583-p-%25e4%25b8%258b%25e7%2594%25a8-q-%25e7%25bc%2596%25e7%25a0%2581%25e6%2589%2580%25e9%259c%2580%25e8%25a6%2581%25e7%259a%2584%25e4%25bf%25a1%25e6%2581%25af%25e9%2587%258f\">\u4ea4\u53c9\u71b5\uff1a\u771f\u5b9e\u5206\u5e03 P \u4e0b\uff0c\u7528 Q \u7f16\u7801\u6240\u9700\u8981\u7684\u4fe1\u606f\u91cf<\/h4>\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4eec\u56de\u770b KL \u6563\u5ea6\u7684\u5c55\u5f00\u5f0f\uff1a<math data-latex=\"D_{KL}(P|Q)=\\sum_{i=1}^{K}p_i(-\\log_2 q_i)-\\sum_{i=1}^{K}p_i(-\\log_2 p_i)\"><semantics><mrow><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>q<\/mi><mi>i<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>\u2212<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">D_{KL}(P|Q)=\\sum_{i=1}^{K}p_i(-\\log_2 q_i)-\\sum_{i=1}^{K}p_i(-\\log_2 p_i)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u540e\u534a\u90e8\u5206\u662f P \u81ea\u8eab\u7684\u71b5\uff1a<math data-latex=\"H(P)=\\sum_{i=1}^{K}p_i(-\\log_2 p_i)\"><semantics><mrow><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">H(P)=\\sum_{i=1}^{K}p_i(-\\log_2 p_i)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u534a\u90e8\u5206\u6211\u4eec\u79f0\u4e4b\u4e3a\u4ea4\u53c9\u71b5\uff1a<math data-latex=\"H(P,Q)=\\sum_{i=1}^{K}p_i(-\\log_2 q_i)\"><semantics><mrow><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo separator=\"true\">,<\/mo><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msub><mi>log<\/mi><mn>2<\/mn><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>q<\/mi><mi>i<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">H(P,Q)=\\sum_{i=1}^{K}p_i(-\\log_2 q_i)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\uff1a<math data-latex=\"D_{KL}(P|Q)=H(P,Q)-H(P)\"><semantics><mrow><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo separator=\"true\">,<\/mo><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>\u2212<\/mo><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">D_{KL}(P|Q)=H(P,Q)-H(P)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e5f\u5c31\u662f\u8bf4\uff1a<math data-latex=\"H(P,Q)=H(P)+D_{KL}(P|Q)\"><semantics><mrow><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo separator=\"true\">,<\/mo><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>+<\/mo><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">H(P,Q)=H(P)+D_{KL}(P|Q)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u8bf4\u660e\u4ea4\u53c9\u71b5\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>\u771f\u5b9e\u5206\u5e03 P \u81ea\u8eab\u7684\u4e0d\u786e\u5b9a\u6027\uff1b<\/li>\n\n\n\n<li>\u7528 Q \u8fd1\u4f3c P \u6240\u5e26\u6765\u7684\u989d\u5916\u4fe1\u606f\u635f\u5931\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u673a\u5668\u5b66\u4e60\u4e2d\uff0c\u771f\u5b9e\u5206\u5e03 P \u901a\u5e38\u662f\u56fa\u5b9a\u7684\u3002\u6211\u4eec\u65e0\u6cd5\u6539\u53d8\u771f\u5b9e\u4e16\u754c\u672c\u8eab\u7684\u4e0d\u786e\u5b9a\u6027 H(P)\uff0c\u80fd\u6539\u53d8\u7684\u662f\u6a21\u578b\u5206\u5e03 Q\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\uff0c<strong>\u6700\u5c0f\u5316 KL \u6563\u5ea6<\/strong>\uff1a<math data-latex=\"\\min_Q D_{KL}(P|Q)\"><semantics><mrow><msub><mi>min<\/mi><mi>Q<\/mi><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\min_Q D_{KL}(P|Q)<\/annotation><\/semantics><\/math> <strong>\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316\u4ea4\u53c9\u71b5<\/strong>\uff1a<math data-latex=\"\\min_Q H(P,Q)\"><semantics><mrow><msub><mi>min<\/mi><mi>Q<\/mi><\/msub><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo separator=\"true\">,<\/mo><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\min_Q H(P,Q)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u5206\u7c7b\u6a21\u578b\u4e2d\u7ecf\u5e38\u4f7f\u7528\u4ea4\u53c9\u71b5\u4f5c\u4e3a\u635f\u5931\u51fd\u6570\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading joli-heading jtoc-heading\" id=\"%25e6%259c%25ba%25e5%2599%25a8%25e5%25ad%25a6%25e4%25b9%25a0%25e8%25a7%2586%25e8%25a7%2592%25e4%25b8%258b%25e7%259a%2584%25e4%25ba%25a4%25e5%258f%2589%25e7%2586%25b5\">\u673a\u5668\u5b66\u4e60\u89c6\u89d2\u4e0b\u7684\u4ea4\u53c9\u71b5<\/h4>\n\n\n<p class=\"wp-block-paragraph\">\u5728\u516c\u5f0f\u4e2d\uff0c\u6709\u4e24\u4e2a\u5173\u952e\u53c2\u6570\uff0cK\u4e0eN\uff0c\u5bf9\u5e94\u7740\u7c7b\u522b\u6570\u91cf\u548c\u6837\u672c\u6570\u91cf\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u6211\u4eec\u6709\u4e00\u4e2a\u4e09\u5206\u7c7b\u95ee\u9898 K=3\uff0c\u5bf9\u5e94\u7684\u7c7b\u522b\u53ef\u80fd\u662f<math data-latex=\"\\text{\u732b\u3001\u72d7\u3001\u9e1f}\"><semantics><mtext>\u732b\u3001\u72d7\u3001\u9e1f<\/mtext><annotation encoding=\"application\/x-tex\">\\text{\u732b\u3001\u72d7\u3001\u9e1f}<\/annotation><\/semantics><\/math>\uff0c\u90a3\u4e48<strong>\u4e00\u4e2a\u6837\u672c\u7684\u4ea4\u53c9\u71b5<\/strong>\u53ef\u4ee5\u5199\u4f5c\uff1a<math data-latex=\"-\\sum_{k=1}^{K}y_k\\log \\hat y_k\"><semantics><mrow><mo>\u2212<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>k<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>y<\/mi><mi>k<\/mi><\/msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><msub><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mi>k<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">-\\sum_{k=1}^{K}y_k\\log \\hat y_k<\/annotation><\/semantics><\/math>\uff0c\u8fd9\u91cc\u7684 k \u662f\u7c7b\u522b\u7f16\u53f7\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u6211\u4eec\u6709\u4e00\u4e2a\u8bad\u7ec3\u96c6\uff0c\u6837\u672c\u91cf\u4e3a N\uff1a<math data-latex=\"(x_1,y_1),(x_2,y_2),\\cdots,(x_N,y_N)\"><semantics><mrow><mo form=\"prefix\" stretchy=\"false\">(<\/mo><msub><mi>x<\/mi><mn>1<\/mn><\/msub><mo separator=\"true\">,<\/mo><msub><mi>y<\/mi><mn>1<\/mn><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo separator=\"true\">,<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><msub><mi>x<\/mi><mn>2<\/mn><\/msub><mo separator=\"true\">,<\/mo><msub><mi>y<\/mi><mn>2<\/mn><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo separator=\"true\">,<\/mo><mo>\u22ef<\/mo><mspace width=\"0.1667em\"><\/mspace><mo separator=\"true\">,<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><msub><mi>x<\/mi><mi>N<\/mi><\/msub><mo separator=\"true\">,<\/mo><msub><mi>y<\/mi><mi>N<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">(x_1,y_1),(x_2,y_2),\\cdots,(x_N,y_N)<\/annotation><\/semantics><\/math>\uff0c\u6574\u4e2a\u8bad\u7ec3\u96c6\u4e0a\u7684\u5e73\u5747\u4ea4\u53c9\u71b5\u53ef\u4ee5\u5199\u4f5c\uff1a<math data-latex=\"L=-\\frac{1}{N}\\sum_{i=1}^{N}\\sum_{k=1}^{K}y_{ik}\\log \\hat y_{ik}\"><semantics><mrow><mi>L<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><mfrac><mn>1<\/mn><mi>N<\/mi><\/mfrac><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>N<\/mi><\/msubsup><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>k<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>y<\/mi><mrow><mi>i<\/mi><mi>k<\/mi><\/mrow><\/msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><msub><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mrow><mi>i<\/mi><mi>k<\/mi><\/mrow><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">L=-\\frac{1}{N}\\sum_{i=1}^{N}\\sum_{k=1}^{K}y_{ik}\\log \\hat y_{ik}<\/annotation><\/semantics><\/math>\uff0c\u8fd9\u91cc i \u8868\u793a\u7b2c i \u4e2a\u6837\u672c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u673a\u5668\u5b66\u4e60\u4e2d\u7684\u5206\u7c7b\u4efb\u52a1\uff0c\u672c\u8d28\u4e0a\u90fd\u662f\u5728\u505a\u4e00\u4ef6\u4e8b\u60c5\uff1a<strong>\u7528\u6a21\u578b\u9884\u6d4b\u51fa\u6765\u7684\u6982\u7387\u5206\u5e03 (Q)\uff0c\u53bb\u62df\u5408\u771f\u5b9e\u6807\u7b7e\u80cc\u540e\u7684\u5206\u5e03 (P)<\/strong>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\u5bf9\u4e00\u4e2a\u6837\u672c\uff0c\u771f\u5b9e\u6807\u7b7e\u901a\u5e38\u662f one-hot \u5f62\u5f0f\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5047\u8bbe\u6a21\u578b\u9884\u6d4b\u7684\u6982\u7387\u5206\u5e03\u662f\uff1a<math data-latex=\"\\hat y=(0.1,0.7,0.2)\"><semantics><mrow><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>0.1,0.7,0.2<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\hat y=(0.1,0.7,0.2)<\/annotation><\/semantics><\/math><\/li>\n\n\n\n<li>\u90a3\u4e48\u8fd9\u4e2a\u6837\u672c\u7684\u4ea4\u53c9\u71b5\u635f\u5931\u662f\uff1a<math data-latex=\"-\\sum_{k=1}^{K}y_k\\log \\hat y_k\"><semantics><mrow><mo>\u2212<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>k<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>y<\/mi><mi>k<\/mi><\/msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><msub><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mi>k<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">-\\sum_{k=1}^{K}y_k\\log \\hat y_k<\/annotation><\/semantics><\/math><\/li>\n\n\n\n<li>\u7531\u4e8e\u771f\u5b9e\u6807\u7b7e y \u662f one-hot \u5411\u91cf\uff0c\u53ea\u6709\u6b63\u786e\u7c7b\u522b\u5bf9\u5e94\u7684\u4f4d\u7f6e\u4e3a 1\uff0c\u5176\u4ed6\u4f4d\u7f6e\u90fd\u662f 0\u3002\u6240\u4ee5\u8fd9\u4e2a\u5f0f\u5b50\u5b9e\u9645\u4e0a\u4f1a\u53d8\u6210\uff1a<math data-latex=\"-\\log 0.7\"><semantics><mrow><mo>\u2212<\/mo><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mn>0.7<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">-\\log 0.7<\/annotation><\/semantics><\/math><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u6b64\uff0c\u6211\u53d1\u73b0\uff0c\u5206\u7c7b\u4ea4\u53c9\u71b5\u672c\u8d28\u4e0a\u60e9\u7f5a\u7684\u662f\uff1a<strong>\u6a21\u578b\u7ed9\u771f\u5b9e\u7c7b\u522b\u5206\u914d\u7684\u6982\u7387\u4e0d\u591f\u9ad8\u3002<\/strong>\u5982\u679c\u6a21\u578b\u7ed9\u771f\u5b9e\u7c7b\u522b\u7684\u6982\u7387\u8d8a\u9ad8\uff0c\u635f\u5931\u8d8a\u5c0f\uff1b\u5982\u679c\u6a21\u578b\u7ed9\u771f\u5b9e\u7c7b\u522b\u7684\u6982\u7387\u8d8a\u4f4e\uff0c\u635f\u5931\u8d8a\u5927\u3002\u4f8b\u5982\uff1a<math data-latex=\"-\\log 0.9\"><semantics><mrow><mo>\u2212<\/mo><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mn>0.9<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">-\\log 0.9<\/annotation><\/semantics><\/math>\u5f88\u5c0f\uff0c\u800c\uff1a<math data-latex=\"-\\log 0.01\"><semantics><mrow><mo>\u2212<\/mo><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mn>0.01<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">-\\log 0.01<\/annotation><\/semantics><\/math>\u5f88\u5927\u3002\u8fd9\u4e5f\u8bf4\u660e\u4e86\u4ea4\u53c9\u71b5\u7684\u4e00\u4e2a\u91cd\u8981\u7279\u70b9\uff1a\u5b83\u4f1a\u5bf9\u201c\u81ea\u4fe1\u4f46\u9519\u8bef\u201d\u7684\u9884\u6d4b\u7ed9\u4e88\u975e\u5e38\u5927\u7684\u60e9\u7f5a\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading joli-heading jtoc-heading\" id=\"%25e4%25ba%258c%25e5%2588%2586%25e7%25b1%25bb%25e4%25ba%25a4%25e5%258f%2589%25e7%2586%25b5\">\u4e8c\u5206\u7c7b\u4ea4\u53c9\u71b5<\/h4>\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4e8c\u5206\u7c7b\u95ee\u9898\u4e2d\uff0c\u771f\u5b9e\u6807\u7b7e\u901a\u5e38\u4e3a\uff1a<math data-latex=\"y\\in{0,1}\"><semantics><mrow><mi>y<\/mi><mo>\u2208<\/mo><mn>0,1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">y\\in{0,1}<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6a21\u578b\u8f93\u51fa\u7684\u662f\u6837\u672c\u5c5e\u4e8e\u7c7b\u522b 1 \u7684\u6982\u7387\uff1a<math data-latex=\"\\hat y=P(y=1|x)\"><semantics><mrow><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mo>=<\/mo><mi>P<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>y<\/mi><mo>=<\/mo><mn>1<\/mn><mi>|<\/mi><mi>x<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\hat y=P(y=1|x)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u90a3\u4e48\u6837\u672c\u5c5e\u4e8e\u7c7b\u522b 0 \u7684\u6982\u7387\u5c31\u662f\uff1a<math data-latex=\"1-\\hat y\"><semantics><mrow><mn>1<\/mn><mo>\u2212<\/mo><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><\/mrow><annotation encoding=\"application\/x-tex\">1-\\hat y<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u771f\u5b9e\u6807\u7b7e\u662f 1\uff0c\u6211\u4eec\u5e0c\u671b <math data-latex=\"\\hat y\"><semantics><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><annotation encoding=\"application\/x-tex\">\\hat y<\/annotation><\/semantics><\/math> \u8d8a\u63a5\u8fd1 1 \u8d8a\u597d\u3002\u5982\u679c\u771f\u5b9e\u6807\u7b7e\u662f 0\uff0c\u6211\u4eec\u5e0c\u671b <math data-latex=\"\\hat y\"><semantics><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><annotation encoding=\"application\/x-tex\">\\hat y<\/annotation><\/semantics><\/math> \u8d8a\u63a5\u8fd1 0 \u8d8a\u597d\uff0c\u4e5f\u5c31\u662f <math data-latex=\"1-\\hat y\"><semantics><mrow><mn>1<\/mn><mo>\u2212<\/mo><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><\/mrow><annotation encoding=\"application\/x-tex\">1-\\hat y<\/annotation><\/semantics><\/math> \u8d8a\u63a5\u8fd1 1 \u8d8a\u597d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\u4e8c\u5206\u7c7b\u4ea4\u53c9\u71b5\u5199\u4f5c\uff1a<math data-latex=\"L=-\\left[y\\log \\hat y+(1-y)\\log(1-\\hat y)\\right]\"><semantics><mrow><mi>L<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><mrow><mo fence=\"true\" form=\"prefix\">[<\/mo><mi>y<\/mi><mrow><mspace width=\"0.1667em\"><\/mspace><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mo>+<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><mi>y<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mrow><mspace width=\"0.1667em\"><\/mspace><mi>log<\/mi><mo>\u2061<\/mo><\/mrow><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo fence=\"true\" form=\"postfix\">]<\/mo><\/mrow><\/mrow><annotation encoding=\"application\/x-tex\">L=-\\left[y\\log \\hat y+(1-y)\\log(1-\\hat y)\\right]<\/annotation><\/semantics><\/math>\uff0c\u6211\u4eec\u53ef\u4ee5\u5206\u60c5\u51b5\u770b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5f53 y=1 \u65f6\uff0c<math data-latex=\"L=-\\log \\hat y\"><semantics><mrow><mi>L<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><\/mrow><annotation encoding=\"application\/x-tex\">L=-\\log \\hat y<\/annotation><\/semantics><\/math>\uff0c\u6b64\u65f6\u6a21\u578b\u8d8a\u76f8\u4fe1\u6837\u672c\u5c5e\u4e8e\u7c7b\u522b 1\uff0c\u635f\u5931\u8d8a\u5c0f\u3002<\/li>\n\n\n\n<li>\u5f53 y=0 \u65f6\uff0c<math data-latex=\"L=-\\log (1-\\hat y)\"><semantics><mrow><mi>L<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><mrow><mi>log<\/mi><mo>\u2061<\/mo><\/mrow><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">L=-\\log (1-\\hat y)<\/annotation><\/semantics><\/math>\uff0c\u6b64\u65f6\u6a21\u578b\u8d8a\u76f8\u4fe1\u6837\u672c\u5c5e\u4e8e\u7c7b\u522b 0\uff0c\u635f\u5931\u8d8a\u5c0f\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bbe\u8ba1\u7684\u672c\u8d28\u662f\uff1a<strong>\u6839\u636e\u771f\u5b9e\u6807\u7b7e\uff0c\u53d6\u51fa\u6a21\u578b\u7ed9\u771f\u5b9e\u7c7b\u522b\u5206\u914d\u7684\u6982\u7387\uff0c\u7136\u540e\u5bf9\u5b83\u53d6\u8d1f\u5bf9\u6570\u3002<\/strong><\/p>\n\n\n<h4 class=\"wp-block-heading joli-heading jtoc-heading\" id=\"%25e5%25a4%259a%25e5%2588%2586%25e7%25b1%25bb%25e4%25ba%25a4%25e5%258f%2589%25e7%2586%25b5%25e4%25b8%258e-softmax\">\u591a\u5206\u7c7b\u4ea4\u53c9\u71b5\u4e0e Softmax<\/h4>\n\n\n<p class=\"wp-block-paragraph\">\u5728\u591a\u5206\u7c7b\u95ee\u9898\u4e2d\uff0c\u6a21\u578b\u901a\u5e38\u4e0d\u4f1a\u76f4\u63a5\u8f93\u51fa\u6982\u7387\uff0c\u800c\u662f\u5148\u8f93\u51fa\u4e00\u7ec4\u5b9e\u6570\u5206\u6570\uff0c\u53eb\u505a logits\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bbe\u6a21\u578b\u5bf9 K \u4e2a\u7c7b\u522b\u8f93\u51fa\uff1a<math data-latex=\"z_1,z_2,\\cdots,z_K\"><semantics><mrow><msub><mi>z<\/mi><mn>1<\/mn><\/msub><mo separator=\"true\">,<\/mo><msub><mi>z<\/mi><mn>2<\/mn><\/msub><mo separator=\"true\">,<\/mo><mo>\u22ef<\/mo><mspace width=\"0.1667em\"><\/mspace><mo separator=\"true\">,<\/mo><msub><mi>z<\/mi><mi>K<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">z_1,z_2,\\cdots,z_K<\/annotation><\/semantics><\/math>\uff0c\u5176\u4e2d <math data-latex=\"z_k\"><semantics><msub><mi>z<\/mi><mi>k<\/mi><\/msub><annotation encoding=\"application\/x-tex\">z_k<\/annotation><\/semantics><\/math> \u8868\u793a\u6a21\u578b\u5bf9\u7b2c k \u7c7b\u7684\u539f\u59cb\u6253\u5206\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f logits \u4e0d\u662f\u6982\u7387\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b83\u4eec\u53ef\u4ee5\u662f\u4efb\u610f\u5b9e\u6570<\/li>\n\n\n\n<li>\u4e0d\u4e00\u5b9a\u5927\u4e8e 0<\/li>\n\n\n\n<li>\u52a0\u8d77\u6765\u4e5f\u4e0d\u7b49\u4e8e 1<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\u6211\u4eec\u9700\u8981\u7528 Softmax \u64cd\u4f5c\u628a logits \u8f6c\u6362\u6210\u6982\u7387\u5206\u5e03\uff1a<math data-latex=\"\\hat y_k=\\text{softmax}(z_k)=\\frac{e^{z_k}}{\\sum_{j=1}^{K}e^{z_j}}\"><semantics><mrow><msub><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mi>k<\/mi><\/msub><mo>=<\/mo><mtext>softmax<\/mtext><mo form=\"prefix\" stretchy=\"false\">(<\/mo><msub><mi>z<\/mi><mi>k<\/mi><\/msub><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mfrac><msup><mi>e<\/mi><msub><mi>z<\/mi><mi scriptlevel=\"2\">k<\/mi><\/msub><\/msup><mrow><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>j<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msup><mi>e<\/mi><msub><mi>z<\/mi><mi scriptlevel=\"2\">j<\/mi><\/msub><\/msup><\/mrow><\/mfrac><\/mrow><annotation encoding=\"application\/x-tex\">\\hat y_k=\\text{softmax}(z_k)=\\frac{e^{z_k}}{\\sum_{j=1}^{K}e^{z_j}}<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u770b\u51fa\uff0csoftmax\u7684\u4f5c\u7528\u662f\uff1a<strong>\u5c06\u4e00\u4e2a\u5b9e\u6570\u5411\u91cf\u8f6c\u6362\u6210\u6982\u7387\u5206\u5e03\uff0c\u4f7f\u6bcf\u4e2a\u5143\u7d20\u8868\u793a\u5c5e\u4e8e\u5bf9\u5e94\u7c7b\u522b\u7684\u6982\u7387\uff0c\u5e76\u4e14\u6240\u6709\u6982\u7387\u4e4b\u548c\u4e3a 1<\/strong>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ecf\u8fc7 Softmax \u540e\uff0c\u6709\uff1a<math data-latex=\"\\hat y_1+\\hat y_2+\\cdots+\\hat y_K=1\"><semantics><mrow><msub><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mn>1<\/mn><\/msub><mo>+<\/mo><msub><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mn>2<\/mn><\/msub><mo>+<\/mo><mo>\u22ef<\/mo><mo>+<\/mo><msub><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mi>K<\/mi><\/msub><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\hat y_1+\\hat y_2+\\cdots+\\hat y_K=1<\/annotation><\/semantics><\/math>\uff0c\u5e76\u4e14\uff1a<math data-latex=\"0&lt;\\hat y_k&lt;1\"><semantics><mrow><mn>0<\/mn><mo>&lt;<\/mo><msub><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mi>k<\/mi><\/msub><mo>&lt;<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">0&lt;\\hat y_k&lt;1<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e8e\u662f\uff0c\u591a\u5206\u7c7b\u4ea4\u53c9\u71b5\u53ef\u4ee5\u5199\u6210\uff1a<math data-latex=\"L=-\\sum_{k=1}^{K}y_k\\log \\hat y_k\"><semantics><mrow><mi>L<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>k<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>y<\/mi><mi>k<\/mi><\/msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><msub><mover><mi>y<\/mi><mo stretchy=\"false\" class=\"tml-xshift\" style=\"math-style:normal;math-depth:0;\">^<\/mo><\/mover><mi>k<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">L=-\\sum_{k=1}^{K}y_k\\log \\hat y_k<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u628a Softmax \u4ee3\u5165\u5176\u4e2d\uff0c\u5c31\u5f97\u5230\uff1a<math data-latex=\"L=-\\sum_{k=1}^{K}y_k\\log\\left(\\frac{e^{z_k}}{\\sum_{j=1}^{K}e^{z_j}}\\right)\"><semantics><mrow><mi>L<\/mi><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>k<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>y<\/mi><mi>k<\/mi><\/msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><\/mrow><mrow><mo fence=\"true\" form=\"prefix\">(<\/mo><mfrac><msup><mi>e<\/mi><msub><mi>z<\/mi><mi scriptlevel=\"2\">k<\/mi><\/msub><\/msup><mrow><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>j<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msup><mi>e<\/mi><msub><mi>z<\/mi><mi scriptlevel=\"2\">j<\/mi><\/msub><\/msup><\/mrow><\/mfrac><mo fence=\"true\" form=\"postfix\">)<\/mo><\/mrow><\/mrow><annotation encoding=\"application\/x-tex\">L=-\\sum_{k=1}^{K}y_k\\log\\left(\\frac{e^{z_k}}{\\sum_{j=1}^{K}e^{z_j}}\\right)<\/annotation><\/semantics><\/math><\/p>\n\n\n<h4 class=\"wp-block-heading joli-heading jtoc-heading\" id=\"%25e5%25b0%258f%25e7%25bb%2593\">\u5c0f\u7ed3<\/h4>\n\n\n<p class=\"wp-block-paragraph\">\u4fe1\u606f\u91cf\u63cf\u8ff0\u7684\u662f\u5355\u4e2a\u4e8b\u4ef6\u53d1\u751f\u540e\u5e26\u6765\u7684\u4fe1\u606f\u591a\u5c11\uff1a<math data-latex=\"f(p)=-\\log p\"><semantics><mrow><mi>f<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>p<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mi>p<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">f(p)=-\\log p<\/annotation><\/semantics><\/math>\uff0c\u6982\u7387\u8d8a\u5c0f\uff0c\u4fe1\u606f\u91cf\u8d8a\u5927\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u71b5\u63cf\u8ff0\u7684\u662f\u6574\u4e2a\u6982\u7387\u7cfb\u7edf\u7684\u5e73\u5747\u4e0d\u786e\u5b9a\u6027\uff1a<math data-latex=\"H(P)=-\\sum_{i=1}^{K}p_i\\log p_i\"><semantics><mrow><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><msub><mi>p<\/mi><mi>i<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">H(P)=-\\sum_{i=1}^{K}p_i\\log p_i<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">KL \u6563\u5ea6\u63cf\u8ff0\u7684\u662f\u8fd1\u4f3c\u5206\u5e03 (Q) \u63cf\u8ff0\u771f\u5b9e\u5206\u5e03 (P) \u65f6\uff0c\u591a\u51fa\u6765\u7684\u4fe1\u606f\u635f\u5931\uff1a<math data-latex=\"D_{KL}(P|Q)=\\sum_{i=1}^{K}p_i\\log\\frac{p_i}{q_i}\"><semantics><mrow><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><mfrac><msub><mi>p<\/mi><mi>i<\/mi><\/msub><msub><mi>q<\/mi><mi>i<\/mi><\/msub><\/mfrac><\/mrow><annotation encoding=\"application\/x-tex\">D_{KL}(P|Q)=\\sum_{i=1}^{K}p_i\\log\\frac{p_i}{q_i}<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ea4\u53c9\u71b5\u63cf\u8ff0\u7684\u662f\uff1a\u5728\u771f\u5b9e\u5206\u5e03 (P) \u4e0b\uff0c\u4f7f\u7528\u6a21\u578b\u5206\u5e03 (Q) \u8fdb\u884c\u63cf\u8ff0\u6240\u9700\u8981\u7684\u5e73\u5747\u4fe1\u606f\u91cf\uff1a<math data-latex=\"H(P,Q)=-\\sum_{i=1}^{K}p_i\\log q_i\"><semantics><mrow><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo separator=\"true\">,<\/mo><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mo form=\"prefix\" stretchy=\"false\">\u2212<\/mo><msubsup><mo movablelimits=\"false\">\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>K<\/mi><\/msubsup><msub><mi>p<\/mi><mi>i<\/mi><\/msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><mspace width=\"0.1667em\"><\/mspace><\/mrow><msub><mi>q<\/mi><mi>i<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">H(P,Q)=-\\sum_{i=1}^{K}p_i\\log q_i<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\u662f\uff1a<math data-latex=\"H(P,Q)=H(P)+D_{KL}(P|Q)\"><semantics><mrow><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo separator=\"true\">,<\/mo><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>H<\/mi><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>+<\/mo><msub><mi>D<\/mi><mrow><mi>K<\/mi><mi>L<\/mi><\/mrow><\/msub><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>P<\/mi><mi>|<\/mi><mi>Q<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">H(P,Q)=H(P)+D_{KL}(P|Q)<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7531\u4e8e\u771f\u5b9e\u5206\u5e03\u7684\u71b5 H(P) \u662f\u56fa\u5b9a\u7684\uff0c\u6240\u4ee5\u6700\u5c0f\u5316\u4ea4\u53c9\u71b5\uff0c\u5c31\u7b49\u4ef7\u4e8e\u8ba9\u6a21\u578b\u5206\u5e03 (Q) \u5c3d\u53ef\u80fd\u63a5\u8fd1\u771f\u5b9e\u5206\u5e03 (P)\u3002\u8fd9\u5c31\u662f\u4ea4\u53c9\u71b5\u635f\u5931\u51fd\u6570\u7684\u6838\u5fc3\u601d\u60f3\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u5206\u7c7b\u4efb\u52a1\u4e2d\uff0c\u771f\u5b9e\u6807\u7b7e\u901a\u5e38\u662f one-hot \u5206\u5e03\uff0c\u6a21\u578b\u8f93\u51fa\u7684\u662f\u5404\u7c7b\u522b\u7684\u9884\u6d4b\u6982\u7387\u3002\u56e0\u6b64\u4ea4\u53c9\u71b5\u635f\u5931\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u4e3a\uff1a\u60e9\u7f5a\u6a21\u578b\u6ca1\u6709\u7ed9\u771f\u5b9e\u7c7b\u522b\u8db3\u591f\u9ad8\u7684\u6982\u7387\u3002\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u4ea4\u53c9\u71b5\u7279\u522b\u9002\u5408\u5206\u7c7b\u95ee\u9898\u3002\u5b83\u4e0d\u662f\u4e00\u4e2a\u5b64\u7acb\u7684\u516c\u5f0f\uff0c\u800c\u662f\u4ece\u4fe1\u606f\u91cf\u3001\u71b5\u3001KL \u6563\u5ea6\u4e00\u8def\u81ea\u7136\u63a8\u5bfc\u51fa\u6765\u7684\u7ed3\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728MLE\u548closs function\u8bbe\u8ba1\u7ae0\u8282\uff0c\u6211\u5728\u7edf\u8ba1\u89d2\u5ea6\u63a8\u5bfc\u4e86\u4ea4\u53c9\u71b5\u635f\u5931\u51fd\u6570\u662f\u5982\u4f55\u4ea7\u751f\u7684\uff0c\u5728\u8fd9\u4e00\u90e8\u5206\uff0c\u6211\u5c06\u4ece &hellip; <a href=\"https:\/\/xuzbo.top\/index.php\/2026\/07\/07\/%e7%86%b5%e3%80%81%e7%9b%b8%e5%af%b9%e7%86%b5%e3%80%81%e4%ba%a4%e5%8f%89%e7%86%b5%e7%9a%84%e4%bf%a1%e6%81%af%e8%ae%ba%e8%a7%92%e5%ba%a6%e6%8e%a8%e5%af%bc\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u71b5\u3001\u76f8\u5bf9\u71b5\u3001\u4ea4\u53c9\u71b5\u7684\u4fe1\u606f\u8bba\u89d2\u5ea6\u63a8\u5bfc\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-312","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/posts\/312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/comments?post=312"}],"version-history":[{"count":4,"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/posts\/312\/revisions"}],"predecessor-version":[{"id":337,"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/posts\/312\/revisions\/337"}],"wp:attachment":[{"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/media?parent=312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/categories?post=312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xuzbo.top\/index.php\/wp-json\/wp\/v2\/tags?post=312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}