{"id":344930,"date":"2023-02-03T15:02:33","date_gmt":"2023-02-03T15:02:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=344930"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=344930","title":{"rendered":"<span>\u0422\u0435\u043e\u0440\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438. \u0427\u0430\u0441\u0442\u044c 2: \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/company\/ods\/blog\/713920\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0438 \u0435\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: \u0432 \u0447\u0435\u043c \u0440\u043e\u043b\u044c\u00a0<strong>\u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438<\/strong>,\u00a0<strong>\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u044b \u0438 softmax<\/strong>, \u043a\u0430\u043a \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 &#171;\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c&#187; \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0442\u043e\u0436\u0435 \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438. \u0414\u0430\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0441\u044b\u043b\u043e\u043a \u043a \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u043c \u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u043c, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 (\u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f) \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043e\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f \u043a \u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0443 \u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f\u043c.<\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u0440\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u043c\u0438. \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 &#8212; \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u043e\u0440\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e \u043d\u043e\u0432\u043e\u043c\u0443 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043f\u043e\u043d\u044f\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0439 \u0438 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0438\u0437 \u043d\u0430\u0443\u0447\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0442\u0435\u043c\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438 (<a href=\"https:\/\/arxiv.org\/abs\/1312.6114\">Kingma and Welling, 2013<\/a>), \u043d\u0435\u0439\u0440\u043e\u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b (<a href=\"https:\/\/arxiv.org\/abs\/2112.10510\">M\u00fcller et al., 2021<\/a>) \u0438 \u0434\u0430\u0436\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 \u0441\u043e\u0437\u043d\u0430\u043d\u0438\u044f (<a href=\"https:\/\/mitpress.mit.edu\/9780262045353\/active-inference\/\">Friston et al., 2022<\/a>).<\/p>\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/h3>\n<ul>\n<li>\n<p><strong>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435<\/strong>\u00a0\u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e \u0438 \u0435\u0435 \u0441\u0432\u044f\u0437\u044c \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u044f\u0434 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u043a\u0442\u043e\u0432 \u043f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax \u0438 sigmoid.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435<\/strong>\u00a0\u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0441\u0432\u044f\u0437\u0438 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438 \u0441 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430, \u0438 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0432 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u043e\u0439* \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.  <\/p>\n<p>1.\u00a0\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.1. \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.2. \u0424\u0443\u043d\u043a\u0446\u0438\u044f softmax \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.3. \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 softmax \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f hardmax*<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.4. \u0424\u0443\u043d\u043a\u0446\u0438\u044f sigmoid \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<br \/>2.\u00a0\u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0432 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.1. \u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0441 \u043d\u0435\u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.2. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0438 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.3. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f*<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.4. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438*<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.5. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438*<\/p>\n<h2>1. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h2>\n<h3>1.1. \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y|x)\" alt=\"p(y|x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/989\/66b\/69e\/98966b69ebf76246e9e923af64d4da72.svg\" width=\"51\" height=\"22\"\/>. \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043c\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u043b\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y|x)\" alt=\"p(y|x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d54\/033\/073\/d54033073df75c34710d43ee92bdb186.svg\" width=\"51\" height=\"22\"\/> \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u043e \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e (\u0445\u043e\u0442\u044f \u043d\u0430 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u043d\u043e \u043b\u0438\u0448\u044c \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438, \u0438 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e). \u0412 \u0437\u0430\u0434\u0430\u0447\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0441\u0435\u043b, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6b8\/715\/af5\/6b8715af56f4b6b02106082d536a21b7.svg\" width=\"15\" height=\"16\"\/>.<\/p>\n<p>\u041f\u0443\u0441\u0442\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"X = \\{x_i, y_i\\}_{i=1}^N\" alt=\"X = \\{x_i, y_i\\}_{i=1}^N\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/388\/81c\/852\/38881c852a1ea342fc890a763344d31b.svg\" width=\"128\" height=\"25\"\/> \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u0438 \u0432\u0437\u044f\u0442\u044b \u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (i.i.d., \u0441\u043c. \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0440\u0430\u0437\u0434\u0435\u043b 3.4). \u0414\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\theta_{best} \" alt=\"\\theta_{best} \" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/68c\/ed4\/dda\/68ced4dda3e6f89bf33df7d26d385a16.svg\" width=\"35\" height=\"20\"\/>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(X|\\theta)\" alt=\"p(X|\\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b9d\/0ff\/913\/b9d0ff913d3e2c3cf0dbdf1a7368f000.svg\" width=\"56\" height=\"22\"\/>. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 2.3 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043d\u043e \u0432\u0432\u0438\u0434\u0443 \u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u0435\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437. \u041f\u0435\u0440\u0432\u043e\u0435 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043d\u0438\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 i.i.d.-\u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b, \u0432\u0442\u043e\u0440\u043e\u0435 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\begin{split} \\theta_{best} &amp;= \\underset{\\theta}{\\text{arg max}}\\ p(X, \\theta) \\\\ &amp;= \\underset{\\theta}{\\text{arg max}} \\prod\\limits_{i=1}^N p(y_i|x_i, \\theta) \\\\ &amp;= \\underset{\\theta}{\\text{arg min}} \\sum\\limits_{i=1}^N -\\log p(y_i|x_i, \\theta) \\end{split} \\tag{1}\" alt=\"\\begin{split} \\theta_{best} &amp;= \\underset{\\theta}{\\text{arg max}}\\ p(X, \\theta) \\\\ &amp;= \\underset{\\theta}{\\text{arg max}} \\prod\\limits_{i=1}^N p(y_i|x_i, \\theta) \\\\ &amp;= \\underset{\\theta}{\\text{arg min}} \\sum\\limits_{i=1}^N -\\log p(y_i|x_i, \\theta) \\end{split} \\tag{1}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1e7\/43e\/9f6\/1e743e9f6902edf85f8d21816bc8a58f.svg\" width=\"697\" height=\"162\"\/><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(X|\\theta)\" alt=\"p(X|\\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b9d\/0ff\/913\/b9d0ff913d3e2c3cf0dbdf1a7368f000.svg\" width=\"56\" height=\"22\"\/>\u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u0443 \u0432\u0435\u043b\u0438\u0447\u0438\u043d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"-\\log p(y_i|x_i, \\theta) \\tag{2}\" alt=\"-\\log p(y_i|x_i, \\theta) \\tag{2}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/78c\/f7b\/68c\/78cf7b68c6fd8660a69ba4e3e1e778b7.svg\" width=\"693\" height=\"23\"\/><\/p>\n<p>\u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(x_i, y_i)\" alt=\"(x_i, y_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f5\/bf2\/eaa\/6f5bf2eaadd58809b95ea2c17629d257.svg\" width=\"57\" height=\"22\"\/>.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u044d\u0442\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u0431\u044b\u043b\u0430 \u0441\u0432\u0435\u0434\u0435\u043d\u0430 \u043a \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0438 \u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 (\u0447\u0430\u0441\u0442\u044c 1, \u0444\u043e\u0440\u043c\u0443\u043b\u0430 7). \u041d\u043e \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u041d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u044b\u043b\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441 \u0435\u0435 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u044c \u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0432\u0435\u0441\u0442\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043a \u0437\u0430\u0434\u0430\u0447\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9E%D0%BF%D1%82%D0%B8%D0%BC%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F_(%D0%BC%D0%B0%D1%82%D0%B5%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B0)\">\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438<\/a>, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c, \u0438 \u043c\u044b \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c (2) \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>\u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439<\/strong> (\u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0439 \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439, \u0438\u043b\u0438 <em>logloss<\/em>). \u041e\u043d\u0430 \u0440\u0430\u0432\u043d\u0430 \u043c\u0438\u043d\u0443\u0441 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y_i\" alt=\"y_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a7b\/9a5\/970\/a7b9a59700d7df78ca505d5fa883ef2a.svg\" width=\"16\" height=\"15\"\/>.<\/p>\n<h4>\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f<\/h4>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0437\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{pred}[1], \\dots, p_{pred}[K]\" alt=\"p_{pred}[1], \\dots, p_{pred}[K]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e63\/c9f\/df9\/e63c9fdf964b5305282a8f0ea1c9311f.svg\" width=\"168\" height=\"23\"\/>, \u0433\u0434\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/728\/0ea\/d44\/7280ead4463428e7653fb67d8765a631.svg\" width=\"17\" height=\"17\"\/> &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041a \u043c\u0435\u0442\u043a\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 (\u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442\u0443) \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c one-hot \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0432\u0435\u043a\u0442\u043e\u0440 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{true}[1], \\dots, p_{true}[K]\" alt=\"p_{true}[1], \\dots, p_{true}[K]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/17e\/f32\/435\/17ef32435ab4071cdd673e3c77cf185f.svg\" width=\"166\" height=\"22\"\/>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0440\u0430\u0432\u0435\u043d \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 (2) \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\text{CrossEntropy}(p_{true}, p_{pred}) = \\sum\\limits_{i=1}^K p_{true}[i] * \\ln (p_{pred}[i]) \\tag{3}\" alt=\"\\text{CrossEntropy}(p_{true}, p_{pred}) = \\sum\\limits_{i=1}^K p_{true}[i] * \\ln (p_{pred}[i]) \\tag{3}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6c9\/73c\/a0c\/6c973ca0cec545b37d32b35e6e71b8ac.svg\" width=\"693\" height=\"60\"\/><\/p>\n<p>\u041b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u0443\u043c\u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e &#8212; \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u0440\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443. \u0414\u043b\u044f \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e (2).<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/em> \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (3) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438, \u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (2) \u0435\u0435 \u0447\u0430\u0441\u0442\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{true}\" alt=\"p_{true}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/520\/cc1\/a8e\/520cc1a8ed3bb11ef9d3c860f182ff9e.svg\" width=\"38\" height=\"15\"\/>\u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043e \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c 1 \u043a\u043b\u0430\u0441\u0441\u0443 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ddf\/990\/7ca\/ddf9907caf510f8fbbfc399d768c3030.svg\" width=\"7\" height=\"16\"\/>. \u041e \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<h4>\u0411\u0438\u043d\u0430\u0440\u043d\u0430\u044f \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430, \u0442\u043e \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u0435\u0442 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{pred}\" alt=\"p_{pred}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/544\/880\/f45\/544880f45f9f288a5500de0621a6a783.svg\" width=\"39\" height=\"17\"\/> \u043e\u0442 0 \u0434\u043e 1, \u043e\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"1 - p_{pred}\" alt=\"1 - p_{pred}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4e3\/311\/bb9\/4e3311bb9069a1c1d983e924244ae382.svg\" width=\"71\" height=\"21\"\/> \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041f\u0443\u0441\u0442\u044c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{true}\" alt=\"p_{true}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b57\/728\/f00\/b57728f000583f94470a6fd376087b4a.svg\" width=\"38\" height=\"15\"\/> \u0440\u0430\u0432\u043d\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432\u0435\u0440\u0435\u043d, \u0438\u043d\u0430\u0447\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 (3) \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\text{BinaryCrossEntropy}(p_{true}, p_{pred}) = p_{true} * \\ln (p_{pred}) + (1-p_{true}) * \\ln (1-p_{pred}) \\tag{4}\" alt=\"\\text{BinaryCrossEntropy}(p_{true}, p_{pred}) = p_{true} * \\ln (p_{pred}) + (1-p_{true}) * \\ln (1-p_{pred}) \\tag{4}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d48\/259\/f7f\/d48259f7f630bf74f8a7862a039d7429.svg\" width=\"693\" height=\"24\"\/><\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c, \u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0424\u043e\u0440\u043c\u0443\u043b\u044b (18) \u0438 (19) \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <em>\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439<\/em> (\u043e\u043d\u0438 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b \u0435\u0441\u043b\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{true}=1\" alt=\"p_{true}=1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/909\/547\/222\/909547222c9e5d5a4860a9fc0e374a08.svg\" width=\"73\" height=\"19\"\/> \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432), \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (18) \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439<\/em>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0427\u0430\u0441\u0442\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043c\u044b \u043e \u043d\u0435\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438. \u0421\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0447\u0442\u043e-\u0442\u043e \u0443\u043f\u0443\u0441\u0442\u0438\u043b\u0438. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0440\u043e\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<h3>1.2. \u0424\u0443\u043d\u043a\u0446\u0438\u044f softmax \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h3>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041d\u043e \u043c\u043e\u0434\u0435\u043b\u044c &#8212; \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0435\u0449\u0435 \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430. \u041e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u0439: \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438, \u043b\u0438\u0431\u043e \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f, \u043b\u0438\u0431\u043e \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c. \u041f\u0443\u0441\u0442\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2dc\/d24\/1b7\/2dcd241b7ff5737944296674ece8d08e.svg\" width=\"17\" height=\"17\"\/> \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u043b\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0432\u044b\u0434\u0430\u0435\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/14f\/056\/40d\/14f05640d365444f5b2a1f819ae0e840.svg\" width=\"17\" height=\"17\"\/> \u0447\u0438\u0441\u0435\u043b \u043e\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"-\\infty\" alt=\"-\\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/18f\/3a9\/ac9\/18f3a9ac973065fd72dfb7ef8a2ec254.svg\" width=\"34\" height=\"16\"\/> \u0434\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"+\\infty\" alt=\"+\\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/928\/cbf\/eb3\/928cbfeb3b6f9fe905c41f90a4f61fcb.svg\" width=\"34\" height=\"16\"\/>. \u0427\u0442\u043e\u0431\u044b \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u0437 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bde\/a31\/21e\/bdea3121ec7019d1099007ecf4c716ee.svg\" width=\"17\" height=\"17\"\/> \u0447\u0438\u0441\u0435\u043b \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0434\u0432\u0443\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c:<\/p>\n<ol>\n<li>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0438\u0436\u0435 \u043d\u0443\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u0421\u0443\u043c\u043c\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0435<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435 \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u0430 \u043d\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u0430 \u0438\u0445 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u044b: \u0435\u0441\u043b\u0438 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u043d\u0435\u043a\u043e\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"-\\infty\" alt=\"-\\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/928\/81d\/582\/92881d58290d524d800ed37f079972a5.svg\" width=\"34\" height=\"16\"\/> \u0434\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"+\\infty\" alt=\"+\\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef3\/eed\/2df\/ef3eed2df871012a7958a625a7b1b3cc.svg\" width=\"34\" height=\"16\"\/>, \u0442\u043e \u0441\u0430\u043c\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"0\" alt=\"0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ee\/adf\/3ad\/1eeadf3adeb121ac6823552ee1d1c688.svg\" width=\"10\" height=\"16\"\/> \u0434\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"+\\infty\" alt=\"+\\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a53\/3de\/035\/a533de0353eec2a8aa806dd4045d8920.svg\" width=\"34\" height=\"16\"\/>. \u0427\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u043b\u043e\u0441\u044c \u0432\u0442\u043e\u0440\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435, \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u0441\u0443\u043c\u043c\u0443 \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439. \u0422\u0430\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"L_1\" alt=\"L_1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/af7\/c0c\/991\/af7c0c991f9ed586e95d98aaaa83e183.svg\" width=\"22\" height=\"19\"\/>-\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 softmax. \u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043d\u0430\u0431\u043e\u0440 \u0438\u0437 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e8a\/eed\/0b3\/e8aeed0b3f4d955d3bbdca219b332e2a.svg\" width=\"17\" height=\"17\"\/> \u0447\u0438\u0441\u0435\u043b \u043e\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"-\\infty\" alt=\"-\\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4f9\/480\/054\/4f9480054ed466c911bd3dd2c2e74f06.svg\" width=\"34\" height=\"16\"\/> \u0434\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"+\\infty\" alt=\"+\\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/451\/cce\/984\/451cce9845be8044ce608afcb79d2d4c.svg\" width=\"34\" height=\"16\"\/> (\u043e\u043d\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <strong>\u043b\u043e\u0433\u0438\u0442\u0430\u043c\u0438<\/strong>, \u0430\u043d\u0433\u043b. <em>logits<\/em>) <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\{z_i\\}_{i=1}^K\" alt=\"\\{z_i\\}_{i=1}^K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/35f\/e85\/c14\/35fe85c142fc616b2b18a036d95b9b6f.svg\" width=\"59\" height=\"25\"\/> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0437 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b3\/2fd\/5b3\/5b32fd5b3b4419a0ddd63d4c097e569b.svg\" width=\"17\" height=\"17\"\/> \u0447\u0438\u0441\u0435\u043b <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\{p_i\\}_{i=1}^K\" alt=\"\\{p_i\\}_{i=1}^K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/51b\/fe8\/008\/51bfe8008e032e271a29a91737b5d282.svg\" width=\"60\" height=\"25\"\/>. Softmax \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u0432\u0443\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439: \u0432\u0437\u044f\u0442\u0438\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"L_1\" alt=\"L_1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7fe\/310\/778\/7fe3107787db9f5071628cf69beb2d8a.svg\" width=\"22\" height=\"19\"\/>-\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\{p_i\\}_{i=1}^K = \\text{softmax}\\big(\\big\\{z_j\\big\\}_{i=1}^K\\big) = \\bigg\\{\\cfrac{\\exp (z_i)}{\\sum_{j=i}^K \\exp (z_i)}\\bigg\\}_{i=1}^K \\tag{5}\" alt=\"\\{p_i\\}_{i=1}^K = \\text{softmax}\\big(\\big\\{z_j\\big\\}_{i=1}^K\\big) = \\bigg\\{\\cfrac{\\exp (z_i)}{\\sum_{j=i}^K \\exp (z_i)}\\bigg\\}_{i=1}^K \\tag{5}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1e5\/dba\/556\/1e5dba55674f7365de6614f411c98cc7.svg\" width=\"693\" height=\"61\"\/><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, softmax &#8212; \u044d\u0442\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b (\u043b\u043e\u0433\u0438\u0442\u043e\u0432) \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0439 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c 1 \u0438 2. \u041e\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 &#8212; \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0447\u0438\u0441\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 (\u0442. \u0435. \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c 1 \u0438 2). \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 sparsemax (<a href=\"https:\/\/arxiv.org\/abs\/1602.02068\">Martins and Astudillo, 2016<\/a>).<\/p>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c, \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/089\/710\/a59\/089710a59604f066e305a400ed6349eb.svg\" width=\"17\" height=\"17\"\/> \u043b\u043e\u0433\u0438\u0442\u043e\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f softmax, \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c: \u043e\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438. \u0417\u0430\u0442\u043e \u0442\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u043c \u0441\u043f\u0443\u0441\u043a\u043e\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f softmax \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u0443\u0435\u043c\u0430.<\/p>\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f softmax \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u0438\u043d\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Keras \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 <code>'softmax'<\/code> \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043b\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u044c <code>CategoricalCrossentropy()<\/code>, \u0430 \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043b\u043e\u0439 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u044c <code>CategoricalCrossentropy (from_logits=True)<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0440\u0430\u0441\u0447\u0435\u0442 softmax (\u0438 \u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435). \u0421 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043d\u043e \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435. \u0412 PyTorch \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c <code>LogSoftmax<\/code> \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 <code>NLLLoss<\/code> (negative log-likelihood), \u0430 \u043c\u043e\u0436\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c <code>torch.nn.functional.cross_entropy<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0440\u0430\u0441\u0447\u0435\u0442 <code>LogSoftmax<\/code>.<\/p>\n<h2>1.3. \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 softmax \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f hardmax*<\/h2>\n<p>\u0423 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax (5) \u0435\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e: \u0435\u0441\u043b\u0438 \u043a\u043e \u0432\u0441\u0435\u043c \u043b\u043e\u0433\u0438\u0442\u0430\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"z_i\" alt=\"z_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/19b\/4e7\/686\/19b4e7686239ec4a94331606c22faf41.svg\" width=\"16\" height=\"15\"\/> \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C\" alt=\"C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a91\/44c\/547\/a9144c54745f6c3379515223eeb835c7.svg\" width=\"15\" height=\"17\"\/>, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_i\" alt=\"p_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f3f\/97c\/c67\/f3f97cc672c9baaefefb32d62d3e4ee9.svg\" width=\"17\" height=\"15\"\/> \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u0438\u0437 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u0432 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435 \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435 \u0441\u043e\u043a\u0440\u0430\u0442\u044f\u0442\u0441\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438\u0442\u044b  <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"z_i\" alt=\"z_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a0c\/2b5\/658\/a0c2b5658af755e81551e45f204b8380.svg\" width=\"16\" height=\"15\"\/> \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C\" alt=\"C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e53\/30b\/321\/e5330b32123d718e257ee043f91626c8.svg\" width=\"15\" height=\"17\"\/>, \u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438  <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_i\" alt=\"p_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b5\/e92\/f9f\/3b5e92f9ff5771e3545a1d12dcc0d653.svg\" width=\"17\" height=\"15\"\/> \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f: \u0435\u0441\u043b\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C&lt;1\" alt=\"C&lt;1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/22c\/f97\/6d7\/22cf976d7401b160baed7c1641901e69.svg\" width=\"50\" height=\"17\"\/>, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438  <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_i\" alt=\"p_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7ca\/4ec\/e61\/7ca4ece613480caa17be0a0cc386a7a7.svg\" width=\"17\" height=\"15\"\/> \u0441\u0442\u0430\u043d\u0443\u0442 \u0431\u043b\u0438\u0436\u0435 \u0434\u0440\u0443\u0433 \u043a \u0434\u0440\u0443\u0433\u0443, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0438, \u0435\u0441\u043b\u0438 \u0436\u0435 <img class=\"formula inline\" source=\"C>1&#8243; alt=&#187;C>1&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6b2\/7e0\/f90\/6b27e0f90efa696cf514244223009d80.svg&#187; width=&#187;50&#8243; height=&#187;17&#8243;\/>, \u0442\u043e \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0438. \u042d\u0442\u043e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u0435\u0441\u043b\u0438 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f &#171;<a href=\"https:\/\/jdhao.github.io\/2022\/02\/27\/temperature_in_softmax\/\">\u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043e\u0439<\/a>&#187; softmax.<\/p>\n<p>\u041f\u0440\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C \\to \\infty\" alt=\"C \\to \\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2b5\/97b\/89d\/2b597b89dd7b63e7831d292c3c6cbe30.svg\" width=\"64\" height=\"17\"\/> \u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441, \u043b\u043e\u0433\u0438\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c 1, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b &#8212; \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c 0, \u0442\u0430\u043a\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 <em>hardmax<\/em>. \u0418\u043d\u043e\u0433\u0434\u0430 \u0435\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u043a\u0430\u043a <em>argmax<\/em>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e hardmax \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c one-hot \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f argmax.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0438\u0434\u043d\u043e \u0442\u043e, \u043a\u0430\u043a \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u0438\u044f <em>soft<\/em> \u0438 <em>hard<\/em> \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438: hard-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (hardmax, argmax, hard attention, hard labeling, sign) \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435, \u0430 soft-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (softmax, soft attention, soft labeling, soft sign) \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0445 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 softmax \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0443\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0432\u0445\u043e\u0434\u043d\u043e\u043c\u0443. \u0412 hardmax \u0438\u043b\u0438 argmax \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430: \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e.<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u044f \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u0438 \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044f: \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y=f(x)\" alt=\"y=f(x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/07a\/1a6\/789\/07a1a678939d2090aedf98c4bf65ffed.svg\" width=\"72\" height=\"22\"\/> \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u0443\u0435\u043c\u0430 \u0435\u0441\u043b\u0438 \u043f\u043b\u0430\u0432\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x\" alt=\"x\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1c2\/377\/8da\/1c23778dab28bce45b6a972297e3afa6.svg\" width=\"11\" height=\"12\"\/> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y\" alt=\"y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/812\/37a\/0f8\/81237a0f876321cfa383bb9c0cfcc44b.svg\" width=\"10\" height=\"15\"\/>. \u042d\u0442\u043e \u0432\u0435\u0440\u043d\u043e \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 softmax, \u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u0443\u0441\u043a \u0438\u043b\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433. \u041d\u043e \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 hardmax \u043f\u043b\u0430\u0432\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0442\u043e\u0432 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043b\u0438\u0431\u043e \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435, \u043b\u0438\u0431\u043e \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043a\u0430\u0447\u043a\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 (\u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0445\u0438\u0449\u0440\u0435\u043d\u0438\u0439) \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u0443\u0441\u043a \u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b.<\/p>\n<h2>1.4. \u0424\u0443\u043d\u043a\u0446\u0438\u044f sigmoid \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 \u043a\u043b\u0430\u0441\u0441\u0430, \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u0435\u0442 2 \u043b\u043e\u0433\u0438\u0442\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(z_1, z_2)\" alt=\"(z_1, z_2)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c48\/6a7\/ad0\/c486a7ad0988652fc3874c2dd068e04a.svg\" width=\"59\" height=\"22\"\/>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e softmax \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(p_1, p_2)\" alt=\"(p_1, p_2)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/07e\/017\/a6a\/07e017a6a250b8b02b4fac68a81a759f.svg\" width=\"60\" height=\"22\"\/>, \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0432\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0435. \u041d\u043e \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043a <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(z_1, z_2)\" alt=\"(z_1, z_2)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ea9\/5d2\/73a\/ea95d273ab20eb2a5a87b5fd97e9a041.svg\" width=\"59\" height=\"22\"\/> \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u0435\u0442\u044c \u0434\u0432\u0435 &#171;\u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u044b&#187; \u0438\u0437\u043b\u0438\u0448\u043d\u0435, \u0438 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"z_1\" alt=\"z_1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cae\/5c2\/cfc\/cae5c2cfca55c462f7de12407d06505e.svg\" width=\"18\" height=\"14\"\/> \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 0. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u0435\u043d\u044f\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"z_2\" alt=\"z_2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9fc\/803\/9cc\/9fc8039ccd1ed9f2f4ad57886fc1147d.svg\" width=\"18\" height=\"14\"\/> \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(p_1, p_2)\" alt=\"(p_1, p_2)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a1\/e0e\/97d\/5a1e0e97d28b28b33d43378947ab013b.svg\" width=\"60\" height=\"22\"\/>. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"z_2\" alt=\"z_2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da4\/b08\/f68\/da4b08f6808568174db273267da22426.svg\" width=\"18\" height=\"14\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_2\" alt=\"p_2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/33e\/8d8\/6ef\/33e8d86efa56629ee1fbfc8be9e1879a.svg\" width=\"19\" height=\"15\"\/>, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e (21), \u0431\u0443\u0434\u0443\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p_2 = \\cfrac{exp(z_2)}{exp(z_1) + exp(z_2)} = \\cfrac{exp(z_2)}{1 + exp(z_2)}\" alt=\"p_2 = \\cfrac{exp(z_2)}{exp(z_1) + exp(z_2)} = \\cfrac{exp(z_2)}{1 + exp(z_2)}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/940\/693\/4e3\/9406934e3e2a20c6f9f778bbdc1d14e6.svg\" width=\"329\" height=\"56\"\/><\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u043e\u0441\u0438\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u044b:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\sigma(x) = \\cfrac{e^x}{1+e^x} = \\cfrac{1}{1+e^{-x}} \\tag{6}\" alt=\"\\sigma(x) = \\cfrac{e^x}{1+e^x} = \\cfrac{1}{1+e^{-x}} \\tag{6}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ae0\/bea\/05c\/ae0bea05cc0d7867dabcf2ef0ca14140.svg\" width=\"697\" height=\"56\"\/><\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8f8\/6fc\/5e7\/8f86fc5e7a7a092b2efc87cf2750516e.png\" width=\"400\" height=\"267\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8f8\/6fc\/5e7\/8f86fc5e7a7a092b2efc87cf2750516e.png\"\/><figcaption><\/figcaption><\/figure>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/em> \u0412 \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435, <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D0%B8%D0%B3%D0%BC%D0%BE%D0%B8%D0%B4%D0%B0\">\u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0430\u043c\u0438<\/a> \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0433\u0440\u0430\u0444\u0438\u043a \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0414\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0442\u0430 \u0432 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sigma(x)\" alt=\"\\sigma(x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/411\/798\/88e\/41179888e5c2de5239f4f78eae393f28.svg\" width=\"37\" height=\"22\"\/> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0438 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u0430. \u0422\u0430\u043a\u0436\u0435 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0441\u043b\u043e\u044f\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439.<\/p>\n<p>\u041a \u0447\u0435\u043c\u0443 \u043c\u044b \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u0448\u043b\u0438? \u041a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430, \u0442\u043e \u0438\u043c\u0435\u0442\u044c \u0434\u0432\u0430 \u043b\u043e\u0433\u0438\u0442\u0430 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e\u0433\u043e, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0430 \u0432\u043c\u0435\u0441\u0442\u043e softmax. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439 (4). \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u043e \u0436\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438 \u043a \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043b\u0430\u0441\u0441\u043e\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: \u0435\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"N\" alt=\"N\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/337\/db0\/a1d\/337db0a1de1ced499b4d37fa33d8cf18.svg\" width=\"17\" height=\"17\"\/>, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043c\u0435\u0442\u044c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"N-1\" alt=\"N-1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/108\/76b\/da6\/10876bda63b6c226a1e6b9e0a613cd2a.svg\" width=\"50\" height=\"18\"\/> \u043b\u043e\u0433\u0438\u0442\u043e\u0432, \u043d\u043e \u0442\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u044e\u0442.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0435. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043b\u043e\u0433\u0438\u0442 \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f logit function:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sigma^{-1}(p) = \\log \\cfrac{p}{1-p}\" alt=\"\\sigma^{-1}(p) = \\log \\cfrac{p}{1-p}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e8f\/121\/af0\/e8f121af0db32261f6d1e2148b8a9c27.svg\" width=\"159\" height=\"56\"\/><\/p>\n<p>\u0415\u0441\u043b\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p\" alt=\"p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ca3\/f9b\/f7b\/ca3f9bf7b3cfec6b114806e32c8e0b11.svg\" width=\"10\" height=\"15\"\/> &#8212; \u044d\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"1-p\" alt=\"1-p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/64a\/21d\/1fd\/64a21d1fd4dbf14b203b9ea3a2fb7cd9.svg\" width=\"43\" height=\"19\"\/> &#8212; \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p\/(1-p)\" alt=\"p\/(1-p)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2fa\/cf4\/726\/2facf472660042057ddc90f943f3c002.svg\" width=\"78\" height=\"22\"\/> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0442\u043e, \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e. \u042d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>odds ratio<\/em>. \u041b\u043e\u0433\u0438\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u043e\u043c \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>log odds ratio<\/em>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0443, \u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sigma^{-1}(p)\" alt=\"\\sigma^{-1}(p)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/091\/dd0\/94d\/091dd094d4c7dca71ec8027f7757bf02.svg\" width=\"55\" height=\"25\"\/>, \u0442\u043e \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u0442\u043e\u0433\u043e, \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e.<\/p>\n<h2>2. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0432 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445<\/h2>\n<h3>2.1. \u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0441 \u043d\u0435\u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e<\/h3>\n<p>\u0412 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (2) \u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 (\u0447\u0430\u0441\u0442\u044c 1, \u0444\u043e\u0440\u043c\u0443\u043b\u0430 7) \u043c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x_i \\in X\" alt=\"x_i \\in X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/465\/166\/fb6\/465166fb686d8c197323d4a6063f2819.svg\" width=\"58\" height=\"20\"\/> \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y_i \\in Y\" alt=\"y_i \\in Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/06d\/42f\/7f9\/06d42f7f9d49e8366dadaa242077439d.svg\" width=\"54\" height=\"20\"\/>, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f. \u041d\u043e \u0432 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y_i\" alt=\"y_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/695\/979\/c26\/695979c26e59fe9ed205dd5509e69ee4.svg\" width=\"16\" height=\"15\"\/> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a1\/434\/3fb\/5a14343fbe1d476e968a671533be6b98.svg\" width=\"15\" height=\"16\"\/>, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y_i\" alt=\"y_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9aa\/8e8\/346\/9aa8e8346d6e697e10e2a7cd2737208a.svg\" width=\"16\" height=\"15\"\/> \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u043d\u0435\u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0435\u0441\u043b\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f &#8212; \u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043a\u0443\u044e \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043d\u0435\u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0443\u0436 \u0440\u0435\u0434\u043a\u0430\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043f\u0443\u0441\u0442\u044c \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u043c\u043e\u0446\u0438\u0439 \u043f\u043e \u0432\u0438\u0434\u0435\u043e\u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438-\u0430\u043d\u043d\u043e\u0442\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u043d\u043e \u0438\u0437 \u0432\u0438\u0434\u0435\u043e \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043e \u043a\u0430\u043a &#171;happiness&#187; 11 \u0430\u043d\u043d\u043e\u0442\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u043a\u0430\u043a &#171;sadness&#187; 9 \u0430\u043d\u043d\u043e\u0442\u0430\u0442\u043e\u0440\u0430\u043c\u0438. \u041e\u0441\u0442\u0430\u0432\u0438\u0432 \u0442\u043e\u043b\u044c\u043a\u043e &#171;happiness&#187; \u043c\u044b \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u043c \u0447\u0430\u0441\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0435 \u044d\u043c\u043e\u0446\u0438\u0438, \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(happiness) = 0.55\" alt=\"p(happiness) = 0.55\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b0c\/04c\/269\/b0c04c26932662ea18226b6fbcbd203a.svg\" width=\"171\" height=\"22\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(sadness) = 0.45\" alt=\"p(sadness) = 0.45\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8a0\/848\/430\/8a08484301d2cfa94b70d60563c0a5b1.svg\" width=\"153\" height=\"22\"\/> \u0438 \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u0441 \u043d\u0435\u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438: \u0435\u0441\u0442\u044c \u044f\u0432\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0435 \u044d\u043c\u043e\u0446\u0438\u0438, \u0430 \u0435\u0441\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435.<\/p>\n<p>\u041d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0438\u0434\u0435\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0438\u0441\u0442\u0438\u043d\u043d\u0430\u044f \u044d\u043c\u043e\u0446\u0438\u044f: \u043b\u0438\u0431\u043e &#171;happiness&#187;, \u043b\u0438\u0431\u043e &#171;sadness&#187; &#8212; \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0431\u0435 \u044d\u0442\u0438 \u044d\u043c\u043e\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u043e\u0431\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u044d\u043c\u043e\u0446\u0438\u0438 \u0442\u043e\u0447\u043d\u0435\u0435, \u0447\u0435\u043c \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0441 \u043d\u0435\u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u0435\u0448\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u044b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0447\u043d\u0435\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430: \u0435\u0441\u043b\u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0434\u0430\u0435\u0442 50% \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043e\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c, \u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e \u043a\u0430\u043a \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442, \u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u043c\u0443, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u043c\u043e\u0446\u0438\u044e \u0442\u043e\u0447\u043d\u0435\u0435.<\/p>\n<h3>2.2. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0438 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430<\/h3>\n<p>\u041f\u0443\u0441\u0442\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0438\u0437 \u043f\u0430\u0440 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(x_i, y_i)\" alt=\"(x_i, y_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dc6\/30a\/a9c\/dc630aa9cfd7fd285cff0ddafe2f4f36.svg\" width=\"57\" height=\"22\"\/>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y_i\" alt=\"y_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fda\/64d\/c4d\/fda64dc4d3a538737279edc5a0e4f109.svg\" width=\"16\" height=\"15\"\/> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ce7\/c80\/4dc\/ce7c804dc295339b61bf5755d02160cc.svg\" width=\"15\" height=\"16\"\/>, \u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ab6\/228\/a52\/ab6228a52d61db761c9c33ca4a361ad9.svg\" width=\"15\" height=\"16\"\/>. \u041d\u0430\u043c \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0443\u0436\u043d\u043e &#171;\u043f\u043e\u0434\u043e\u0433\u043d\u0430\u0442\u044c&#187; \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y_i|x_i, \\theta)\" alt=\"p(y_i|x_i, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fcd\/649\/8d1\/fcd6498d1baef042e02e6fa61065d4c3.svg\" width=\"82\" height=\"22\"\/> \u043f\u043e\u0434 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{true}(y_i|x_i)\" alt=\"p_{true}(y_i|x_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/483\/792\/9af\/4837929afd8be75934c0bd50a7529155.svg\" width=\"92\" height=\"22\"\/>.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 1.<\/strong> \u0415\u0441\u043b\u0438 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0440\u0430\u0432\u043d\u044b 0.7 \u0438 0.3, \u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y_i|x_i, \\theta)\" alt=\"p(y_i|x_i, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dad\/282\/cc3\/dad282cc3ff0c6a6d6fed42f22361915.svg\" width=\"82\" height=\"22\"\/> \u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0431\u044b\u043b\u0438 \u0431\u044b \u0440\u0430\u0432\u043d\u044b 0.7 \u0438 0.3.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 2.<\/strong> \u0415\u0441\u043b\u0438 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0435 \u043c\u043e\u0434\u044b \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 0.5 \u0438 1.5, \u0442\u043e \u043d\u0430\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y_i|x_i, \\theta)\" alt=\"p(y_i|x_i, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c7c\/571\/d99\/c7c571d992d1463c0a6848c324c9c8fb.svg\" width=\"82\" height=\"22\"\/> \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u043b\u043e \u043c\u043e\u0434\u044b \u0432 \u044d\u0442\u0438\u0445 \u0442\u043e\u0447\u043a\u0430\u0445. \u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y|x)\" alt=\"p(y|x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/798\/617\/34c\/79861734c9876a7fd82f5b3f3c295b63.svg\" width=\"51\" height=\"22\"\/>\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c (\u043a\u0430\u043a \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 2.3 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438), \u0442\u043e\u0433\u0434\u0430 \u0432 \u043d\u0435\u043c \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043c\u043e\u0434\u0430, \u0438 \u0447\u0442\u043e\u0431\u044b \u0445\u043e\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043a \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442\u0443, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043c\u043e\u0434\u0443 \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043c\u0435\u0436\u0434\u0443 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 0.5 \u0438 1.5 &#8212; \u0442\u043e\u0433\u0434\u0430 \u043c\u0430\u0442. \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u043c.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b3\/a84\/672\/5b3a84672a8e447e48432cf7abababe8.svg\" width=\"15\" height=\"16\"\/> \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e, \u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 <em>\u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u043c\u0443<\/em> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u0430: \u0441\u0431\u043b\u0438\u0437\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443, \u0442\u0430\u043a \u043a\u0430\u043a &#171;\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435&#187; \u043c\u0435\u0436\u0434\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <em>\u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430 (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e)<\/em> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"D_{KL}(p || q)\" alt=\"D_{KL}(p || q)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/290\/a6c\/f1a\/290a6cf1a733e737f343997dce42fe16.svg\" width=\"84\" height=\"22\"\/> &#8212; \u043d\u0435\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u0443\u044e \u043c\u0435\u0442\u0440\u0438\u043a\u0443 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p\" alt=\"p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/603\/3ef\/cd7\/6033efcd7d480064856ad6fd54454b96.svg\" width=\"10\" height=\"15\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"q\" alt=\"q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dca\/49c\/b08\/dca49cb08522922eda5411ce9dfd4fee.svg\" width=\"9\" height=\"15\"\/>. \u0420\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0443\u043c\u043c\u0443 \u0432 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438 \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u0432 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>\u0414\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"P\" alt=\"P\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9a3\/796\/f31\/9a3796f31116e7842b1887d1caca9202.svg\" width=\"14\" height=\"17\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Q\" alt=\"Q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2b0\/b64\/77f\/2b0b6477f6569c0ee739bf48c177143b.svg\" width=\"15\" height=\"20\"\/> &#8212; <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F_%D0%B2%D0%B5%D1%80%D0%BE%D1%8F%D1%82%D0%BD%D0%BE%D1%81%D1%82%D0%B8\">\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438<\/a>):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"D_{KL}(P || Q) = \\mathop{\\mathbb{E}}\\limits_{x \\sim p} \\log \\cfrac{P(x)}{Q(x)} = \\sum\\limits_{x \\in X} P(x) \\log \\cfrac{P(x)}{Q(x)} \\tag{7}\" alt=\"D_{KL}(P || Q) = \\mathop{\\mathbb{E}}\\limits_{x \\sim p} \\log \\cfrac{P(x)}{Q(x)} = \\sum\\limits_{x \\in X} P(x) \\log \\cfrac{P(x)}{Q(x)} \\tag{7}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9bf\/34f\/dd3\/9bf34fdd341ff1d33e4fba667cfd5fdd.svg\" width=\"697\" height=\"58\"\/><\/p>\n<p>\u041d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p\" alt=\"p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f3a\/930\/ee9\/f3a930ee90e265026b02b4c7464eef9b.svg\" width=\"10\" height=\"15\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"q\" alt=\"q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6bb\/da9\/be9\/6bbda9be909f95edda768099e9f184fa.svg\" width=\"9\" height=\"15\"\/> &#8212; <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D0%BB%D0%BE%D1%82%D0%BD%D0%BE%D1%81%D1%82%D1%8C_%D0%B2%D0%B5%D1%80%D0%BE%D1%8F%D1%82%D0%BD%D0%BE%D1%81%D1%82%D0%B8\">\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438<\/a>):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"D_{KL}(p || q) = \\mathop{\\mathbb{E}}\\limits_{x \\sim p} \\log \\cfrac{p(x)}{q(x)} = \\int\\limits_{x \\in X} P(x) \\log \\cfrac{p(x)}{q(x)} dx \\tag{8}\" alt=\"D_{KL}(p || q) = \\mathop{\\mathbb{E}}\\limits_{x \\sim p} \\log \\cfrac{p(x)}{q(x)} = \\int\\limits_{x \\in X} P(x) \\log \\cfrac{p(x)}{q(x)} dx \\tag{8}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/913\/290\/8e9\/9132908e9f2daff2d139e7baa3035793.svg\" width=\"697\" height=\"66\"\/><\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\log a\/b = \\log a - \\log b\" alt=\"\\log a\/b = \\log a - \\log b\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/43e\/5da\/bc0\/43e5dabc0f6bba4445c6937cd7077e59.svg\" width=\"179\" height=\"22\"\/>, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430 \u043a\u0430\u043a \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0443\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d. \u0414\u043b\u044f \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"D_{KL}(P || Q) = \\underbrace{\\sum\\limits_{x \\in X} P(x) \\log P(x)}_{-H(P)} + \\underbrace{\\bigg( - \\sum\\limits_{x \\in X} P(x) \\log Q(x) \\bigg)}_{H(P, Q)} \\tag{9}\" alt=\"D_{KL}(P || Q) = \\underbrace{\\sum\\limits_{x \\in X} P(x) \\log P(x)}_{-H(P)} + \\underbrace{\\bigg( - \\sum\\limits_{x \\in X} P(x) \\log Q(x) \\bigg)}_{H(P, Q)} \\tag{9}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/255\/dae\/2dd\/255dae2dd94384cf51047a489c9ca2c7.svg\" width=\"697\" height=\"88\"\/><\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u043c\u0438\u043d\u0443\u0441 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439<\/em> \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"P\" alt=\"P\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb8\/c49\/05e\/cb8c4905e3bb176fb94d656ea43e07d5.svg\" width=\"14\" height=\"17\"\/> (\u0438\u043b\u0438 <em>\u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439<\/em> \u0432 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435) \u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"H(P)\" alt=\"H(P)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/955\/a50\/0a5\/955a500a5689ddd8ec30259de08cec67.svg\" width=\"47\" height=\"22\"\/>, \u0430 \u0432\u0442\u043e\u0440\u043e\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043c\u0438\u043d\u0443\u0441) \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D0%B5%D1%80%D0%B5%D0%BA%D1%80%D1%91%D1%81%D1%82%D0%BD%D0%B0%D1%8F_%D1%8D%D0%BD%D1%82%D1%80%D0%BE%D0%BF%D0%B8%D1%8F\"><em>\u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439<\/em><\/a> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"H(P, Q)\" alt=\"H(P, Q)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4c8\/7ae\/5ab\/4c87ae5abf0722bbe03cea8770bc4fe8.svg\" width=\"70\" height=\"22\"\/> \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"P\" alt=\"P\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d2\/770\/c41\/9d2770c417fb63ca8e45cf3abf010c2f.svg\" width=\"14\" height=\"17\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Q\" alt=\"Q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b6e\/bcc\/fe1\/b6ebccfe17275903d988926a0c87f00b.svg\" width=\"15\" height=\"20\"\/>. \u042d\u0442\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u0442. \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"H(P) = -\\mathop{\\mathbb{E}}\\limits_{x \\sim p} \\log P(x)\" alt=\"H(P) = -\\mathop{\\mathbb{E}}\\limits_{x \\sim p} \\log P(x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b00\/3e4\/685\/b003e468582d47f37b10bc8c0bff918f.svg\" width=\"187\" height=\"34\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"H(P, Q) = -\\mathop{\\mathbb{E}}\\limits_{x \\sim p} \\log Q(x)\" alt=\"H(P, Q) = -\\mathop{\\mathbb{E}}\\limits_{x \\sim p} \\log Q(x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d71\/366\/c04\/d71366c0463723d98c97b074cf10cad3.svg\" width=\"212\" height=\"34\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"H(P, Q) = D_{KL}(P || Q) + H(P)\" alt=\"H(P, Q) = D_{KL}(P || Q) + H(P)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/495\/d66\/0a6\/495d660a60befe36adb40f7de0532d81.svg\" width=\"261\" height=\"22\"\/><\/p>\n<p>\u0412 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"D_{KL}(P || Q)\" alt=\"D_{KL}(P || Q)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b9\/01b\/3e4\/7b901b3e4851ecf83cdf87b309517633.svg\" width=\"95\" height=\"22\"\/> \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0442\u0430\u0432\u044f\u0442 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0432\u0442\u043e\u0440\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c &#8212; \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0444\u043e\u0440\u043c\u0443\u043b\u044b (9), \u043f\u0435\u0440\u0432\u043e\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Q\" alt=\"Q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe8\/553\/7c2\/fe85537c22ef2bbbf9aaf85c2c2c0fbc.svg\" width=\"15\" height=\"20\"\/>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"D_{KL}(P || Q)\" alt=\"D_{KL}(P || Q)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ba1\/6e7\/3f7\/ba16e73f77b15501c5827919f390ad6f.svg\" width=\"95\" height=\"22\"\/> \u043f\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Q\" alt=\"Q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/763\/387\/0ba\/7633870ba6b95953f34c923ad63a4bbb.svg\" width=\"15\" height=\"20\"\/> \u0440\u0430\u0432\u043d\u043e\u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"P\" alt=\"P\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e36\/c30\/1b3\/e36c301b361f2cc86d848583a0bde7f5.svg\" width=\"14\" height=\"17\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Q\" alt=\"Q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/395\/835\/300\/39583530071943f23a604c3932586c56.svg\" width=\"15\" height=\"20\"\/>.<\/p>\n<p><strong>\u0420\u0435\u0437\u044e\u043c\u0435.<\/strong> \u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0434\u0430\u043d\u044b \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438. \u041c\u044b \u0442\u0430\u043a \u0443\u0436\u0435 \u0434\u0435\u043b\u0430\u043b\u0438 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043d\u043e \u0442\u0430\u043c \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u043b\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c 1 \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 (3) \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043e \u0438 \u0432 (3) \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445.<\/p>\n<h3>2.3. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f*<\/h3>\n<p>\u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 &#171;\u043f\u043e\u0434\u0433\u043e\u043d\u043a\u0430&#187; \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y_i|x_i, \\theta)\" alt=\"p(y_i|x_i, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c8\/061\/073\/5c8061073f9a66b98630ebb7261e26c0.svg\" width=\"82\" height=\"22\"\/> \u043f\u043e\u0434 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{true}(y_i|x_i)\" alt=\"p_{true}(y_i|x_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/477\/b06\/78e\/477b0678e621718bd273a41fa01a3ba5.svg\" width=\"92\" height=\"22\"\/> \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f? \u0414\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 &#171;\u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u0435&#187; \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041f\u0443\u0441\u0442\u044c \u0434\u043b\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b97\/ac3\/add\/b97ac3addec17053b3c9b3033391c67f.svg\" width=\"7\" height=\"16\"\/>-\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x_i\" alt=\"x_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/de2\/d06\/c68\/de2d06c68afcbfcce2acedd95eaddace.svg\" width=\"18\" height=\"15\"\/> \u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{true}(y|x_i)\" alt=\"p_{true}(y|x_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee9\/123\/08c\/ee912308c6df28fc4e78861a9526aa33.svg\" width=\"85\" height=\"22\"\/>. \u041c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 (\u0441\u0442\u0440\u0435\u043c\u044f\u0449\u0435\u0435\u0441\u044f \u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 (\u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0435\u0433\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ac9\/518\/b43\/ac9518b430e345f6ea2b1a7ecda90e7c.svg\" width=\"17\" height=\"17\"\/>), \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0440\u0430\u0432\u043d\u044b <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x_i\" alt=\"x_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/730\/203\/3bf\/7302033bf89dec8cfe148257ba60b80f.svg\" width=\"18\" height=\"15\"\/>, \u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0432\u0437\u044f\u0442 \u0438\u0437 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y_i)\" alt=\"p(y_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ed\/7fc\/9ca\/4ed7fc9ca18a5d1b153d06e95268d3e5.svg\" width=\"42\" height=\"22\"\/>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\text{Set}_i = \\{ (x_i, y_i^{(k)}) \\}_{k=1}^K,\\ \\ \\ y_i^{(k)} \\sim p_{true}(y|x_i)\" alt=\"\\text{Set}_i = \\{ (x_i, y_i^{(k)}) \\}_{k=1}^K,\\ \\ \\ y_i^{(k)} \\sim p_{true}(y|x_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b52\/086\/4b4\/b520864b4f60e11f450654caa9315e7a.svg\" width=\"338\" height=\"30\"\/><\/p>\n<p>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\text{Set}_1 \\cup \\dots \\cup \\text{Set}_N\" alt=\"\\text{Set}_1 \\cup \\dots \\cup \\text{Set}_N\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/715\/ca7\/389\/715ca7389678d60c3504ced9e84aa774.svg\" width=\"142\" height=\"19\"\/> \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a i.i.d.-\u0432\u044b\u0431\u043e\u0440\u043a\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043b\u0438\u0448\u044c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"N\" alt=\"N\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0ff\/b26\/511\/0ffb26511dc449df33ddbe9d069288c3.svg\" width=\"17\" height=\"17\"\/> \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x\" alt=\"x\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d2\/0f6\/330\/1d20f63307cb41c827f843e8c973bf0d.svg\" width=\"11\" height=\"12\"\/>. \u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043d\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(x)\" alt=\"p(x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bc5\/a7b\/eae\/bc5a7beae6f9226453be7ebc5eb0cae4.svg\" width=\"36\" height=\"22\"\/>, \u044d\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y_i^{(k)}\" alt=\"y_i^{(k)}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/710\/4fa\/d55\/7104fad552b5486262c9804abcf1a7e1.svg\" width=\"29\" height=\"30\"\/> \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p(\\text{Set}_i|x_i, \\theta) = \\prod\\limits_{k=1}^K p(y_i^{(k)}|x_i, \\theta)\" alt=\"p(\\text{Set}_i|x_i, \\theta) = \\prod\\limits_{k=1}^K p(y_i^{(k)}|x_i, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3f9\/b46\/dda\/3f9b46dda31eb7314ebfbeb98f68a5d8.svg\" width=\"248\" height=\"60\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\begin{split} -\\log p(\\text{Set}_i|x_i, \\theta) &amp; = -\\sum\\limits_{k=1}^K \\log p(y_i^{(k)}|x_i, \\theta) \\\\ &amp; \\underset{K \\to \\infty}{\\to} -\\sum\\limits_{y \\in Y} p_{true}(y|x_i) \\log p(y|x_i, \\theta) \\\\ &amp; = -\\mathbb{E}_{y \\sim p_{true}(y|x_i)} \\log p(y|x_i, \\theta) \\\\ &amp; = H(p_{true}(y|x_i), p(y|x_i, \\theta)) \\end{split}\" alt=\"\\begin{split} -\\log p(\\text{Set}_i|x_i, \\theta) &amp; = -\\sum\\limits_{k=1}^K \\log p(y_i^{(k)}|x_i, \\theta) \\\\ &amp; \\underset{K \\to \\infty}{\\to} -\\sum\\limits_{y \\in Y} p_{true}(y|x_i) \\log p(y|x_i, \\theta) \\\\ &amp; = -\\mathbb{E}_{y \\sim p_{true}(y|x_i)} \\log p(y|x_i, \\theta) \\\\ &amp; = H(p_{true}(y|x_i), p(y|x_i, \\theta)) \\end{split}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/faf\/a78\/c3f\/fafa78c3fbb8ada238b6e2f6988ea9fd.svg\" width=\"441\" height=\"164\"\/><\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K \\to \\infty\" alt=\"K \\to \\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b6\/356\/289\/7b635628970b127f6a73ec8c07ee73d0.svg\" width=\"66\" height=\"17\"\/> \u043c\u0438\u043d\u0443\u0441 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\text{Set}_i\" alt=\"\\text{Set}_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e7\/6c0\/271\/5e76c0271b6e136a8d4575ec56de1eec.svg\" width=\"33\" height=\"20\"\/> \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0440\u0430\u0432\u0435\u043d \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{true}(y|x_i)\" alt=\"p_{true}(y|x_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/80b\/d33\/8d6\/80bd338d6a7e342c4d0c8d688364b27c.svg\" width=\"85\" height=\"22\"\/> \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y|x_i, \\theta)\" alt=\"p(y|x_i, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/520\/b0a\/352\/520b0a352f1b5acfee84980dbcf0d923.svg\" width=\"76\" height=\"22\"\/>. \u041e\u0442\u0441\u044e\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438 (\u0438\u043b\u0438, \u0447\u0442\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430) \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u0435.<\/p>\n<h3>2.4. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438*<\/h3>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0441\u043b\u0443\u0447\u0430\u044e \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438. \u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u043f\u0430\u0440\u044b <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(x_i, y_i)\" alt=\"(x_i, y_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b2a\/889\/c9e\/b2a889c9e993eb7fee9688f92d48dff1.svg\" width=\"57\" height=\"22\"\/> \u0442\u043e\u0447\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043e\u0442\u0432\u0435\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y_i \\in Y\" alt=\"y_i \\in Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/765\/536\/0a9\/7655360a964be07d15afd27a07e9a76c.svg\" width=\"54\" height=\"20\"\/>, \u0442\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f9b\/975\/306\/f9b97530606cec320784a037d84c38ae.svg\" width=\"15\" height=\"16\"\/>, \u0438\u043c\u0435\u044e\u0449\u0435\u0435 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y_i\" alt=\"y_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/56f\/974\/4c7\/56f9744c7d78f05e73b026e747691fb2.svg\" width=\"16\" height=\"15\"\/> \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e 1 (\u0442\u0430\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%92%D1%8B%D1%80%D0%BE%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5_(%D0%BC%D0%B0%D1%82%D0%B5%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B0)\">\u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u044b\u043c<\/a>, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0433\u043e \u0435\u0449\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 &#171;\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c&#187;).<\/p>\n<p>\u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B5%D0%BB%D1%8C%D1%82%D0%B0-%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F\">\u0434\u0435\u043b\u044c\u0442\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0414\u0438\u0440\u0430\u043a\u0430<\/a> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\delta(x)\" alt=\"\\delta(x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/830\/959\/193\/83095919388649a154c42fabc41e8e04.svg\" width=\"35\" height=\"22\"\/>. \u041e\u043d\u0430 \u0440\u0430\u0432\u043d\u0430 \u043d\u0443\u043b\u044e \u0432\u043e \u0432\u0441\u0435\u0445 \u0442\u043e\u0447\u043a\u0430\u0445 \u043a\u0440\u043e\u043c\u0435 \u043d\u0443\u043b\u044f, \u0432 \u043d\u0443\u043b\u0435 \u0440\u0430\u0432\u043d\u0430 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438, \u0430 \u0435\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u0440\u0430\u0432\u0435\u043d \u0435\u0434\u0438\u043d\u0438\u0446\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (\u0447\u0430\u0441\u0442\u044c 1, \u0444\u043e\u0440\u043c\u0443\u043b\u0430 4) \u0441 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\mu=0\" alt=\"\\mu=0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/34b\/4eb\/cee\/34b4ebcee2761db3d9a475c136191f00.svg\" width=\"47\" height=\"20\"\/> \u0438 \u0443\u0441\u0442\u0440\u0435\u043c\u0438\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sigma\" alt=\"\\sigma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fd1\/473\/958\/fd147395861efe4209f5aba04e7f0cda.svg\" width=\"11\" height=\"12\"\/> \u043a \u043d\u0443\u043b\u044e, \u0442\u043e \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u0435\u043b\u044c\u0442\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\delta(y - y_{true})\" alt=\"\\delta(y - y_{true})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6a1\/39d\/2f6\/6a139d2f6885985a47836241ff7f4854.svg\" width=\"93\" height=\"22\"\/>. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c, \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u043c \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438. \u041f\u0443\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u0435\u0442 \u0434\u043b\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y\" alt=\"y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9ca\/292\/3e6\/9ca2923e6712bdfc5ceafbe6859f7b58.svg\" width=\"10\" height=\"15\"\/> \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y|x, \\theta)\" alt=\"p(y|x, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e8\/738\/855\/5e87388556bbe61a245f933b99bbc069.svg\" width=\"69\" height=\"22\"\/>. \u0420\u0430\u0441\u043f\u0438\u0448\u0435\u043c \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e \u043c\u0435\u0436\u0434\u0443 \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\begin{split} H(\\delta(y - y_{true}), p(y|x, \\theta)) &amp; = -\\displaystyle\\int_{-\\infty}^\\infty \\delta(y - y_{true}) \\log p(y|x, \\theta) \\,dy \\\\ &amp; = -\\log p(y|x, \\theta) \\end{split} \\tag{10}\" alt=\"\\begin{split} H(\\delta(y - y_{true}), p(y|x, \\theta)) &amp; = -\\displaystyle\\int_{-\\infty}^\\infty \\delta(y - y_{true}) \\log p(y|x, \\theta) \\,dy \\\\ &amp; = -\\log p(y|x, \\theta) \\end{split} \\tag{10}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/476\/046\/f1d\/476046f1d784bc0b740809b5abd6e7a1.svg\" width=\"697\" height=\"74\"\/><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u0431\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"H\" alt=\"H\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/962\/156\/0e2\/9621560e208e2c7a84db2ef61b831d76.svg\" width=\"17\" height=\"17\"\/> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u043e\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y\" alt=\"y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0b7\/241\/69d\/0b724169dbad65d9edf6bbe376022709.svg\" width=\"10\" height=\"15\"\/>, \u0438 \u043f\u043e\u0434\u044b\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y_{true}\" alt=\"y_{true}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a0\/a46\/b36\/5a0a46b364fcc32643f35fe47762c03a.svg\" width=\"37\" height=\"15\"\/>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u044b (10) \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"-\\log p(y|x, \\theta)\" alt=\"-\\log p(y|x, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/038\/dc5\/305\/038dc5305578bd50f2d78ffe3add18ab.svg\" width=\"114\" height=\"22\"\/>, \u0447\u0442\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y|x, \\theta)\" alt=\"p(y|x, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6d7\/937\/7dc\/6d79377dc2d5e1b676412d9c1c5f3bc0.svg\" width=\"69\" height=\"22\"\/>. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043c\u044b \u0438 \u0434\u0435\u043b\u0430\u043b\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 2. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <em>\u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0442\u043e\u0436\u0435 \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435 (10) \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"-\\log p(y|x, \\theta)\" alt=\"-\\log p(y|x, \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ec3\/697\/4ec\/ec36974ec970bd5a5449aebd32af6112.svg\" width=\"114\" height=\"22\"\/> \u0438 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f (\u0447\u0430\u0441\u0442\u044c1, \u0444\u043e\u0440\u043c\u0443\u043b\u0430 7), \u0435\u0441\u043b\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y\" alt=\"y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e03\/381\/a72\/e03381a7206e013aaf3d45ebdd524a59.svg\" width=\"10\" height=\"15\"\/> \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0433\u0438\u0431\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.<\/p>\n<h3>\u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438*<\/h3>\n<p>\u0412 \u0437\u0430\u0434\u0430\u0447\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0432\u044b\u0431\u043e\u0440\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c: \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0437\u0434\u0440\u0430\u0432\u044b\u0439 \u0441\u043c\u044b\u0441\u043b, \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e \u043c\u0435\u0442\u0440\u0438\u043a\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043d\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6c\/777\/907\/f6c777907e375ce19a5a609bd6b34986.svg\" width=\"15\" height=\"16\"\/> \u0438 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u0435\u043e\u0440\u0438\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0431 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(y|x)\" alt=\"p(y|x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1e7\/8e6\/624\/1e78e66244477b6eed1047592e2ce431.svg\" width=\"51\" height=\"22\"\/>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c (\u0441\u0442\u0430\u0442\u044c\u044f 1, \u0444\u043e\u0440\u043c\u0443\u043b\u044b 5-7).<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0437\u0430\u0434\u0430\u0447\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0415\u0441\u0442\u044c \u043b\u0438 \u0437\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430? \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438, \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438. \u041d\u043e \u0445\u043e\u0440\u043e\u0448\u0430 \u043b\u0438 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0438\u043b\u0438 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c? \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{pred}[1], \\dots, p_{pred}[K]\" alt=\"p_{pred}[1], \\dots, p_{pred}[K]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1a7\/3cf\/cc7\/1a73cfcc7fe04507b5903bfc37641dbd.svg\" width=\"168\" height=\"23\"\/> \u0438 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_{true}[1], \\dots, p_{true}[K]\" alt=\"p_{true}[1], \\dots, p_{true}[K]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/012\/308\/3ff\/0123083ffccb94662905c18f94ffc342.svg\" width=\"166\" height=\"22\"\/>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c 1 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"loss(p_{true}, p_{pred}) = \\sum\\limits_{i=1}^K (p_{true}[i] - p_{pred}[i])^2\" alt=\"loss(p_{true}, p_{pred}) = \\sum\\limits_{i=1}^K (p_{true}[i] - p_{pred}[i])^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bcf\/6ab\/506\/bcf6ab5064b964dd0a237a2053666109.svg\" width=\"342\" height=\"60\"\/><\/p>\n<p>\u0421\u043c\u044b\u0441\u043b \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u043e\u0440\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u044f\u0441\u0435\u043d, \u043d\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0447\u0435\u043c \u0431\u043b\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043a \u0438\u0441\u0442\u0438\u043d\u0435, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c. \u0410 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c.<\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043b\u0443\u0447\u0448\u0435: \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0438\u043b\u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430? \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e\u0442\u0435\u0440\u044c \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u043c \u0441\u043f\u0443\u0441\u043a\u043e\u043c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e\u0442\u0435\u0440\u044c \u043f\u043e \u043b\u043e\u0433\u0438\u0442\u0430\u043c (\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 softmax \u0438\u043b\u0438 sigmoid). \u041f\u0443\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439, \u0432\u0435\u0440\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043b\u0430\u0441\u0441, \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u043b\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0442\u0430, \u0440\u0430\u0432\u043d\u043e\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m\" alt=\"m\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/13c\/431\/956\/13c431956a4476cd577579c178982201.svg\" width=\"17\" height=\"12\"\/>. \u041e\u0442\u0441\u044e\u0434\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0430\u0432\u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sigma(m)\" alt=\"\\sigma(m)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb0\/a93\/582\/cb0a935824fe895498dca33a0d338828.svg\" width=\"43\" height=\"22\"\/>, \u0433\u0434\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sigma\" alt=\"\\sigma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/171\/dae\/a5b\/171daea5b602f3b2795d97d5f497d3f6.svg\" width=\"11\" height=\"12\"\/> &#8212; \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u044b (6). \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c \u043f\u043e \u043b\u043e\u0433\u0438\u0442\u0443 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m\" alt=\"m\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d6\/206\/c39\/3d6206c393edf0eba550ee216fa7e0dd.svg\" width=\"17\" height=\"12\"\/>.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\cfrac{\\partial loss}{\\partial m} = 1 - \\sigma(m)\" alt=\"\\cfrac{\\partial loss}{\\partial m} = 1 - \\sigma(m)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/631\/d72\/633\/631d7263390e8e0398984a99d6c7899a.svg\" width=\"153\" height=\"56\"\/><\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\cfrac{\\partial loss}{\\partial m} = -2 \\sigma(m) (1 - \\sigma(m))^2\" alt=\"\\cfrac{\\partial loss}{\\partial m} = -2 \\sigma(m) (1 - \\sigma(m))^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/734\/c0e\/5bb\/734c0e5bbe391b6e50d329c3e168918a.svg\" width=\"244\" height=\"56\"\/><\/p>\n<p>\u041f\u0440\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m \\to -\\infty\" alt=\"m \\to -\\infty\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/997\/129\/aa1\/997129aa1fa4b1ce8c210612bf8004fc.svg\" width=\"81\" height=\"16\"\/> (\u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u0435\u0442 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442) \u043f\u0440\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u043a 1, \u0430 \u043f\u0440\u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u043a \u043d\u0443\u043b\u044e. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0447\u0435\u0442\u0435\u043d\u0438\u0438 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u044b \u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u043c \u0441\u043f\u0443\u0441\u043a\u043e\u043c (\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0431\u043b\u0438\u0437\u043e\u043a \u043a \u043d\u0443\u043b\u044e), \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u0443\u044e \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e, \u0430 \u043d\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>\u0425\u043e\u0442\u044f, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044d\u0442\u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u0432\u0435\u0434\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0431\u044b\u0442\u044c \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c\u0438 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0443\u0447\u0438\u0432\u0430\u0442\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438.<\/p>\n<hr\/>\n<p><em>\u041a\u043e\u043d\u0435\u0446 \u0447\u0430\u0441\u0442\u0438 2. \u0427\u0430\u0441\u0442\u044c 3, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u0430\u044f \u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0443, \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u00a0\u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u0421\u043f\u0430\u0441\u0438\u0431\u043e<a class=\"mention\" href=\"\/users\/ivankomarov\">@ivankomarov<\/a>\u0438 <a class=\"mention\" href=\"\/users\/yorko\">@yorko<\/a>\u0437\u0430 \u0446\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0443\u0447\u0442\u0435\u043d\u044b \u043f\u0440\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.<\/em><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/ods\/blog\/714670\/\"> https:\/\/habr.com\/ru\/company\/ods\/blog\/714670\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/company\/ods\/blog\/713920\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0438 \u0435\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: \u0432 \u0447\u0435\u043c \u0440\u043e\u043b\u044c\u00a0<strong>\u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438<\/strong>,\u00a0<strong>\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u044b \u0438 softmax<\/strong>, \u043a\u0430\u043a \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 &#171;\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c&#187; \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0442\u043e\u0436\u0435 \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438. \u0414\u0430\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0441\u044b\u043b\u043e\u043a \u043a \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u043c \u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u043c, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 (\u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f) \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043e\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f \u043a \u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0443 \u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f\u043c.<\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u0440\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u043c\u0438. \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 &#8212; \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u043e\u0440\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e \u043d\u043e\u0432\u043e\u043c\u0443 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043f\u043e\u043d\u044f\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0439 \u0438 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0438\u0437 \u043d\u0430\u0443\u0447\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0442\u0435\u043c\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438 (<a href=\"https:\/\/arxiv.org\/abs\/1312.6114\">Kingma and Welling, 2013<\/a>), \u043d\u0435\u0439\u0440\u043e\u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b (<a href=\"https:\/\/arxiv.org\/abs\/2112.10510\">M\u00fcller et al., 2021<\/a>) \u0438 \u0434\u0430\u0436\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 \u0441\u043e\u0437\u043d\u0430\u043d\u0438\u044f (<a href=\"https:\/\/mitpress.mit.edu\/9780262045353\/active-inference\/\">Friston et al., 2022<\/a>).<\/p>\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/h3>\n<ul>\n<li>\n<p><strong>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435<\/strong>\u00a0\u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e \u0438 \u0435\u0435 \u0441\u0432\u044f\u0437\u044c \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u044f\u0434 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u043a\u0442\u043e\u0432 \u043f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax \u0438 sigmoid.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435<\/strong>\u00a0\u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0441\u0432\u044f\u0437\u0438 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438 \u0441 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430, \u0438 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0432 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u043e\u0439* \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.  <\/p>\n<p>1.\u00a0\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.1. \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.2. \u0424\u0443\u043d\u043a\u0446\u0438\u044f softmax \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.3. \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 softmax \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f hardmax*<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.4. \u0424\u0443\u043d\u043a\u0446\u0438\u044f sigmoid \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<br \/>2.\u00a0\u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0432 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.1. \u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0441 \u043d\u0435\u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.2. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0438 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u041a\u0443\u043b\u044c\u0431\u0430\u043a\u0430-\u041b\u0435\u0439\u0431\u043b\u0435\u0440\u0430<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.3. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f*<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.4. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438*<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.5. \u041a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438*<\/p>\n<h2>1. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h2>\n<h3>1.1. \u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 . \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043c\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u043b\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f  \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u043e \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e (\u0445\u043e\u0442\u044f \u043d\u0430 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u043d\u043e \u043b\u0438\u0448\u044c \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438, \u0438 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e). \u0412 \u0437\u0430\u0434\u0430\u0447\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0441\u0435\u043b, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 .<\/p>\n<p>\u041f\u0443\u0441\u0442\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442  \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u0438 \u0432\u0437\u044f\u0442\u044b \u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (i.i.d., \u0441\u043c. \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0440\u0430\u0437\u0434\u0435\u043b 3.4). \u0414\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b , \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0442 . \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 2.3 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043d\u043e \u0432\u0432\u0438\u0434\u0443 \u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u0435\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437. \u041f\u0435\u0440\u0432\u043e\u0435 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043d\u0438\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 i.i.d.-\u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b, \u0432\u0442\u043e\u0440\u043e\u0435 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438:<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u0443 \u0432\u0435\u043b\u0438\u0447\u0438\u043d<\/p>\n<\/p>\n<p>\u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 .<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u044d\u0442\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u0431\u044b\u043b\u0430 \u0441\u0432\u0435\u0434\u0435\u043d\u0430 \u043a \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0438 \u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 (\u0447\u0430\u0441\u0442\u044c 1, \u0444\u043e\u0440\u043c\u0443\u043b\u0430 7). \u041d\u043e \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u041d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u044b\u043b\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441 \u0435\u0435 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u044c \u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0432\u0435\u0441\u0442\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043a \u0437\u0430\u0434\u0430\u0447\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9E%D0%BF%D1%82%D0%B8%D0%BC%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F_(%D0%BC%D0%B0%D1%82%D0%B5%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B0)\">\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438<\/a>, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c, \u0438 \u043c\u044b \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c (2) \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>\u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439<\/strong> (\u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0439 \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439, \u0438\u043b\u0438 <em>logloss<\/em>). \u041e\u043d\u0430 \u0440\u0430\u0432\u043d\u0430 \u043c\u0438\u043d\u0443\u0441 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 .<\/p>\n<h4>\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f<\/h4>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0437\u0430 , \u0433\u0434\u0435  &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041a \u043c\u0435\u0442\u043a\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 (\u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442\u0443) \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c one-hot \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0432\u0435\u043a\u0442\u043e\u0440 , \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0440\u0430\u0432\u0435\u043d \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 (2) \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<\/p>\n<p>\u041b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u0443\u043c\u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e &#8212; \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u0440\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443. \u0414\u043b\u044f \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e (2).<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/em> \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (3) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438, \u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (2) \u0435\u0435 \u0447\u0430\u0441\u0442\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043e \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c 1 \u043a\u043b\u0430\u0441\u0441\u0443 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c . \u041e \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<h4>\u0411\u0438\u043d\u0430\u0440\u043d\u0430\u044f \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430, \u0442\u043e \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u0435\u0442 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e  \u043e\u0442 0 \u0434\u043e 1, \u043e\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0430  \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041f\u0443\u0441\u0442\u044c  \u0440\u0430\u0432\u043d\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432\u0435\u0440\u0435\u043d, \u0438\u043d\u0430\u0447\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 (3) \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c, \u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0424\u043e\u0440\u043c\u0443\u043b\u044b (18) \u0438 (19) \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <em>\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439<\/em> (\u043e\u043d\u0438 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b \u0435\u0441\u043b\u0438  \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432), \u0444\u043e\u0440\u043c\u0443\u043b\u0430 (18) \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0435\u0439<\/em>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0427\u0430\u0441\u0442\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043c\u044b \u043e \u043d\u0435\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438. \u0421\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0447\u0442\u043e-\u0442\u043e \u0443\u043f\u0443\u0441\u0442\u0438\u043b\u0438. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0440\u043e\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<h3>1.2. \u0424\u0443\u043d\u043a\u0446\u0438\u044f softmax \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h3>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041d\u043e \u043c\u043e\u0434\u0435\u043b\u044c &#8212; \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0435\u0449\u0435 \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430. \u041e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u0439: \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438, \u043b\u0438\u0431\u043e \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f, \u043b\u0438\u0431\u043e \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c. \u041f\u0443\u0441\u0442\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c  \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u043b\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0432\u044b\u0434\u0430\u0435\u0442  \u0447\u0438\u0441\u0435\u043b \u043e\u0442  \u0434\u043e . \u0427\u0442\u043e\u0431\u044b \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u0437  \u0447\u0438\u0441\u0435\u043b \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0434\u0432\u0443\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c:<\/p>\n<ol>\n<li>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0438\u0436\u0435 \u043d\u0443\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u0421\u0443\u043c\u043c\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0435<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435 \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u0430 \u043d\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u0430 \u0438\u0445 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u044b: \u0435\u0441\u043b\u0438 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u043d\u0435\u043a\u043e\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442  \u0434\u043e , \u0442\u043e \u0441\u0430\u043c\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442  \u0434\u043e . \u0427\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u043b\u043e\u0441\u044c \u0432\u0442\u043e\u0440\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435, \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u0441\u0443\u043c\u043c\u0443 \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439. \u0422\u0430\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f -\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 softmax. \u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043d\u0430\u0431\u043e\u0440 \u0438\u0437  \u0447\u0438\u0441\u0435\u043b \u043e\u0442  \u0434\u043e  (\u043e\u043d\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <strong>\u043b\u043e\u0433\u0438\u0442\u0430\u043c\u0438<\/strong>, \u0430\u043d\u0433\u043b. <em>logits<\/em>)  \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0437  \u0447\u0438\u0441\u0435\u043b . Softmax \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u0432\u0443\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439: \u0432\u0437\u044f\u0442\u0438\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 -\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, softmax &#8212; \u044d\u0442\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b (\u043b\u043e\u0433\u0438\u0442\u043e\u0432) \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0439 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c 1 \u0438 2. \u041e\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 &#8212; \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0447\u0438\u0441\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 (\u0442. \u0435. \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c 1 \u0438 2). \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 sparsemax (<a href=\"https:\/\/arxiv.org\/abs\/1602.02068\">Martins and Astudillo, 2016<\/a>).<\/p>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c, \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f  \u043b\u043e\u0433\u0438\u0442\u043e\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f softmax, \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c: \u043e\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438. \u0417\u0430\u0442\u043e \u0442\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u043c \u0441\u043f\u0443\u0441\u043a\u043e\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f softmax \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u0443\u0435\u043c\u0430.<\/p>\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f softmax \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u0438\u043d\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Keras \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 <code>'softmax'<\/code> \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043b\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u044c <code>CategoricalCrossentropy()<\/code>, \u0430 \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043b\u043e\u0439 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0442\u0435\u0440\u044c <code>CategoricalCrossentropy (from_logits=True)<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0440\u0430\u0441\u0447\u0435\u0442 softmax (\u0438 \u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435). \u0421 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043d\u043e \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435. \u0412 PyTorch \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c <code>LogSoftmax<\/code> \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 <code>NLLLoss<\/code> (negative log-likelihood), \u0430 \u043c\u043e\u0436\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c <code>torch.nn.functional.cross_entropy<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0440\u0430\u0441\u0447\u0435\u0442 <code>LogSoftmax<\/code>.<\/p>\n<h2>1.3. \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 softmax \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f hardmax*<\/h2>\n<p>\u0423 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 softmax (5) \u0435\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e: \u0435\u0441\u043b\u0438 \u043a\u043e \u0432\u0441\u0435\u043c \u043b\u043e\u0433\u0438\u0442\u0430\u043c  \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 , \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438  \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u0438\u0437 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u0432 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435 \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435 \u0441\u043e\u043a\u0440\u0430\u0442\u044f\u0442\u0441\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438\u0442\u044b   \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 , \u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438   \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f: \u0435\u0441\u043b\u0438 , \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438   \u0441\u0442\u0430\u043d\u0443\u0442 \u0431\u043b\u0438\u0436\u0435 \u0434\u0440\u0443\u0433 \u043a \u0434\u0440\u0443\u0433\u0443, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0438, \u0435\u0441\u043b\u0438 \u0436\u0435 1&#8243; alt=&#187;C>1&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6b2\/7e0\/f90\/6b27e0f90efa696cf514244223009d80.svg&#187; width=&#187;50&#8243; height=&#187;17&#8243;\/>, \u0442\u043e \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0438. \u042d\u0442\u043e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u0435\u0441\u043b\u0438 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f &#171;<a href=\"https:\/\/jdhao.github.io\/2022\/02\/27\/temperature_in_softmax\/\">\u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043e\u0439<\/a>&#187; softmax.<\/p>\n<p>\u041f\u0440\u0438  \u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441, \u043b\u043e\u0433\u0438\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c 1, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b &#8212; \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c 0, \u0442\u0430\u043a\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 <em>hardmax<\/em>. \u0418\u043d\u043e\u0433\u0434\u0430 \u0435\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u043a\u0430\u043a <em>argmax<\/em>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e hardmax \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c one-hot \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f argmax.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0438\u0434\u043d\u043e \u0442\u043e, \u043a\u0430\u043a \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u0438\u044f <em>soft<\/em> \u0438 <em>hard<\/em><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-344930","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=344930"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344930\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=344930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=344930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=344930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}