{"id":331455,"date":"2022-04-04T09:00:06","date_gmt":"2022-04-04T09:00:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=331455"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=331455","title":{"rendered":"<span>Q-Learning \u0432 \u0441\u0444\u0435\u0440\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u0434\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u0435\u043c Q-learning \u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0432 \u0441\u0444\u0435\u0440\u0435 \u043c\u0430\u0439\u043d\u0438\u043d\u0433\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044f \u0435\u0433\u043e \u0438\u0437 \u0445\u0430\u043e\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430, \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0432\u044f\u0437\u0435\u0439 \u0438 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0439, \u0432 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0439 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/756\/465\/3fc\/7564653fc11c1e1d19c88fb4d9592a0a.png\" width=\"624\" height=\"351\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/756\/465\/3fc\/7564653fc11c1e1d19c88fb4d9592a0a.png\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>Reinforcement Learning<\/strong><\/p>\n<p>Reinforcement Learning (RL) &#8212; \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f (ML). \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 RL \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439. \u041e\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430\u0433\u0440\u0430\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043e\u0449\u0440\u044f\u044e\u0442 \u0438\u0445 \u0437\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u2013 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442 \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u044b\u0445 \u0438\u0433\u0440\u0430\u0445, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0442\u0440\u0430\u0444\u0438\u043a\u0430, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0443\u0442\u0435\u0439 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. <\/p>\n<p><strong>Q-Learning<\/strong><\/p>\n<p>Q-Learning \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 RL \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f model-free \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044f\u0445. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0434\u0435\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 ML. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0442\u0430\u043a\u0438\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 Deep Q Networks. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 Q-learning.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e\u0439 \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u044b\u043b\u043a\u043e\u0439 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u041c\u0430\u0440\u043a\u043e\u0432\u0441\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u2013 \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u0430 \u043d\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0443\u0442\u0438.<\/p>\n<p>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f s \u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f a \u0445\u0440\u0430\u043d\u0438\u0442 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u044f\u043c\u0438 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. <\/p>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0430\u0433\u0435\u043d\u0442\u043e\u0432. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e exploitation \u0438 exploration. \u0412 \u0440\u0435\u0436\u0438\u043c\u0435 exploitation \u0430\u0433\u0435\u043d\u0442\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/23f\/01b\/4f3\/23f01b4f3af3511c227c43571f80cf85.png\" width=\"209\" height=\"64\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/23f\/01b\/4f3\/23f01b4f3af3511c227c43571f80cf85.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 exploration \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e. \u0412\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0430\u0433\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 s\u2019. \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0432\u044b\u0431\u043e\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. <\/p>\n<p>\u0412\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0436\u0438\u043c\u0430\u043c\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c exploitation \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439.<\/p>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Q-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b96\/6c8\/009\/b966c80097197591c7474fe06ff1efc2.png\" width=\"541\" height=\"48\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b96\/6c8\/009\/b966c80097197591c7474fe06ff1efc2.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Temporal Difference. \u041e\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f:<\/p>\n<p>1.\u00a0\u00a0\u00a0\u00a0 R(s, a) &#8212; \u043d\u0430\u0433\u0440\u0430\u0434\u0443 \u0437\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 a \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 s<\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1fe\/792\/10c\/1fe79210c1ecf291fe26c8168325bce2.png\" alt=\"\u00a0- \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e \u0432\u0441\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c a\u2019 \" title=\"\u00a0- \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e \u0432\u0441\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c a\u2019 \" width=\"121\" height=\"38\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1fe\/792\/10c\/1fe79210c1ecf291fe26c8168325bce2.png\"\/><figcaption>\u00a0&#8212; \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e \u0432\u0441\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c a\u2019 <\/figcaption><\/figure>\n<p>\u00a0 <\/p>\n<ol start=\"2\">\n<li>\n<p>Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 s\u2019. \u0412\u044b\u0431\u043e\u0440 s\u2019 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u043b\u043e\u0433\u0438\u043a\u0435. <\/p>\n<\/li>\n<\/ol>\n<p>\u0411\u0443\u0434\u0443\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0438\u0441\u043a\u043e\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u043c <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bd4\/9ba\/994\/bd49ba9946cb46413b0a2badca15c965.png\" width=\"93\" height=\"32\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bd4\/9ba\/994\/bd49ba9946cb46413b0a2badca15c965.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u00a0\u2013 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u043b\u0438\u0437\u043a\u0438\u0435 \u043d\u0430\u0433\u0440\u0430\u0434\u044b \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b, \u0447\u0435\u043c \u0434\u0430\u043b\u0435\u043a\u0438\u0435, \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0438\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0439\u0442\u0438 \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0438\u0439 \u043f\u0443\u0442\u044c \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u044b, \u0430 (\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u0430 \u0437\u0435\u043b\u0435\u043d\u044b\u043c) \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 d (\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u0430 \u043a\u0440\u0430\u0441\u043d\u044b\u043c) \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0433\u0440\u0430\u0444\u0435 G:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/003\/c5b\/92a\/003c5b92a6a3084908e726a02f6af12a.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0413\u0440\u0430\u0444 G\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0413\u0440\u0430\u0444 G\" width=\"299\" height=\"350\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/003\/c5b\/92a\/003c5b92a6a3084908e726a02f6af12a.png\"\/><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0413\u0440\u0430\u0444 G<\/figcaption><\/figure>\n<p>\u0417\u0430\u0434\u0430\u0435\u043c \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u044f: \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0440\u0435\u0431\u0440\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u043e\u0438\u0442\u044c 15 \u0435\u0434\u0438\u043d\u0438\u0446, \u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0448\u0438\u043d\u0443 d \u2013 999 \u0435\u0434\u0438\u043d\u0438\u0446. \u041f\u0440\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0438 \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 d \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u0433\u0440\u0430\u0444\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c <\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/55a\/667\/105\/55a667105ac9757d3b09c66d8787c77e.png\" width=\"128\" height=\"36\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/55a\/667\/105\/55a667105ac9757d3b09c66d8787c77e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430\u0433\u0440\u0430\u0434 \u0434\u043b\u044f \u0430\u0433\u0435\u043d\u0442\u0430:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f37\/551\/177\/f37551177864be54a3e3d102b6cd7d9f.png\" alt=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 1. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0430\u0433\u0440\u0430\u0434\" title=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 1. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0430\u0433\u0440\u0430\u0434\" width=\"361\" height=\"111\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f37\/551\/177\/f37551177864be54a3e3d102b6cd7d9f.png\"\/><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 1. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0430\u0433\u0440\u0430\u0434<\/figcaption><\/figure>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0443\u043b\u044f\u043c\u0438:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/008\/5ae\/e63\/0085aee63225545ea15ab0ed1a125334.png\" alt=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 2. Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\" title=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 2. Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\" width=\"361\" height=\"111\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/008\/5ae\/e63\/0085aee63225545ea15ab0ed1a125334.png\"\/><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 2. Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0430<\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0435\u043d. \u041f\u0443\u0441\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0443\u0442\u044c &lt;a, b, d>. \u0418\u0437-\u0437\u0430 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 Q \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0430\u0433\u0435\u043d\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0433\u0440\u0430\u0434.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Q_0 (a,b)=Q_(-1) (a,b)+[R(a,b)+\u03b3 \u3016 max\u252c(a^' )  Q(b,a^' )\u3017\u2061\u3016-Q_(-1) (a,b)]=0+[15+\u03b3\u00d70-0]=15\u3017\" alt=\"Q_0 (a,b)=Q_(-1) (a,b)+[R(a,b)+\u03b3 \u3016 max\u252c(a^' )  Q(b,a^' )\u3017\u2061\u3016-Q_(-1) (a,b)]=0+[15+\u03b3\u00d70-0]=15\u3017\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ba\/e12\/39d\/4bae1239d03e49fa169cb3680cda3431.svg\" width=\"0\" height=\"0\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Q_0 (b,d)=Q_(-1) (b,d)+[R(b,d)+\u03b3 \u3016 max\u252c(a^' )  Q(d,a^' )\u3017\u2061\u3016-Q_(-1) (b,d)]=0+[999+\u03b3\u00d70-0]=999\u3017\" alt=\"Q_0 (b,d)=Q_(-1) (b,d)+[R(b,d)+\u03b3 \u3016 max\u252c(a^' )  Q(d,a^' )\u3017\u2061\u3016-Q_(-1) (b,d)]=0+[999+\u03b3\u00d70-0]=999\u3017\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/657\/cfa\/aeb\/657cfaaebbfdf0ae2fa150fa5c21e070.svg\" width=\"0\" height=\"0\"\/><\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/be2\/281\/570\/be2281570c248310dbaa0ca6a664ec17.png\" alt=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 3. \u041f\u0435\u0440\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d>&#187; title=&#187;\u0422\u0430\u0431\u043b\u0438\u0446\u0430 3. \u041f\u0435\u0440\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d>&#187; width=&#187;361&#8243; height=&#187;111&#8243; data-src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/be2\/281\/570\/be2281570c248310dbaa0ca6a664ec17.png&#187;\/><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 3. \u041f\u0435\u0440\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438 exploitation \u0430\u0433\u0435\u043d\u0442\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u043f\u0443\u0442\u044c &lt;a, b, d>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Q_1 (a,b)=15+[15+0.8\u00d7999-15]=814,2\" alt=\"Q_1 (a,b)=15+[15+0.8\u00d7999-15]=814,2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cd4\/fad\/8ec\/cd4fad8ece3b6f85f2a628e6e620af28.svg\" width=\"381\" height=\"22\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Q_1 (b,d)=999+[999+0.8\u00d70-999]=999\" alt=\"Q_1 (b,d)=999+[999+0.8\u00d70-999]=999\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb1\/694\/a38\/cb1694a38fd25b6ad2788df5fcef18b3.svg\" width=\"372\" height=\"22\"\/><\/p>\n<p>\u041a\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Q_2 (a,b)=814.2+[15+0.8\u00d7999-814.2]=814.2+0=814.2\" alt=\"Q_2 (a,b)=814.2+[15+0.8\u00d7999-814.2]=814.2+0=814.2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/339\/ec8\/780\/339ec878089d7ba510e64a351dadba92.svg\" width=\"530\" height=\"22\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Q_2 (b,d)=999+[999+0.8\u00d70-999]=999\" alt=\"Q_2 (b,d)=999+[999+0.8\u00d70-999]=999\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aa2\/a5b\/317\/aa2a5b3172a2622bb780aef2d5a5f8a4.svg\" width=\"372\" height=\"22\"\/><\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5c8\/fbc\/1b0\/5c8fbc1b0f184bfdab5e281526869645.png\" alt=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 4. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d>&#187; title=&#187;\u0422\u0430\u0431\u043b\u0438\u0446\u0430 4. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d>&#187; width=&#187;361&#8243; height=&#187;111&#8243; data-src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c8\/fbc\/1b0\/5c8fbc1b0f184bfdab5e281526869645.png&#187;\/><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 4. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u0432\u044b\u0431\u043e\u0440\u0435 \u043f\u0443\u0442\u0438 &lt;a, c, d> \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0430\u0433\u0435\u043d\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u0443\u0442\u044c &lt;a, d>. \u0422\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (a, d) \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \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=\"Q_t (a,d)= 0+[999+\u03b3\u00d70-0]=999\" alt=\"Q_t (a,d)= 0+[999+\u03b3\u00d70-0]=999\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/031\/aef\/4d3\/031aef4d374b321a8d912d9c04fdd298.svg\" width=\"319\" height=\"22\"\/><\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5fa\/7ed\/ff1\/5fa7edff1b4c56f5f3a2cd1b6d0b7a41.png\" alt=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 5. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f Q-\u0442\u0430\u0431\u043b\u0438\u0446\u044b\" title=\"\u0422\u0430\u0431\u043b\u0438\u0446\u0430 5. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f Q-\u0442\u0430\u0431\u043b\u0438\u0446\u044b\" width=\"361\" height=\"111\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5fa\/7ed\/ff1\/5fa7edff1b4c56f5f3a2cd1b6d0b7a41.png\"\/><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 5. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f Q-\u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/figcaption><\/figure>\n<p>\u0412 \u0440\u0435\u0436\u0438\u043c\u0435 exploitation \u0430\u0433\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 &lt;a,d>. <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u0448\u043b\u0438\u0441\u044c. \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u043d\u0430\u0434\u043e \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u044b a \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0439\u0442\u0438 \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 d. <\/p>\n<p>\u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c &#8212; &lt;a,d>. <\/p>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7d9\/470\/6de\/7d94706deeb61dd752b07d4d33bd008c.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u0413\u0440\u0430\u0444 G \u0441 \u0443\u0447\u0435\u0442\u043e\u043c Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u0413\u0440\u0430\u0444 G \u0441 \u0443\u0447\u0435\u0442\u043e\u043c Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439\" width=\"286\" height=\"368\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7d9\/470\/6de\/7d94706deeb61dd752b07d4d33bd008c.png\"\/><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u0413\u0440\u0430\u0444 G \u0441 \u0443\u0447\u0435\u0442\u043e\u043c Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/figcaption><\/figure>\n<p><em>\u041d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0438 \u0446\u0438\u043a\u043b\u044b<\/em><\/p>\n<p>\u041d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u043b\u0438 \u0432\u044b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0433\u0440\u0430\u0434. \u00a0\u041d\u0430 \u044d\u0442\u0430\u043f\u0435 exploitation \u0430\u0433\u0435\u043d\u0442\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0431\u0440\u0430 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0445 \u043d\u0438\u0437\u043a\u043e\u0433\u043e Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u0446\u0438\u043a\u043b\u044b \u0432 \u043f\u0443\u0442\u0438. <\/p>\n<p><strong>Python \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/strong><\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430\u0433\u0440\u0430\u0434. \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439 \u0432\u044b\u0448\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0433\u0440\u0430\u0444 G \u0446\u0438\u043a\u043b \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 a \u2013 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e G\u2019. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/af3\/a02\/702\/af3a02702325e3666d46c75cfffa04c6.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. Graph G'\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. Graph G'\" width=\"269\" height=\"317\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/af3\/a02\/702\/af3a02702325e3666d46c75cfffa04c6.png\"\/><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. Graph G&#8217;<\/figcaption><\/figure>\n<pre><code>import numpy as np # \u0414\u0438\u0437\u0430\u0439\u043d \u043d\u0430\u0433\u0440\u0430\u0434 cycle_fine = -60 # \u0428\u0442\u0440\u0430\u0444 \u0437\u0430 \u0446\u0438\u043a\u043b absence_fine = -999 # \u0428\u0442\u0440\u0430\u0444 \u0437\u0430 \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 step_reward = 15 # \u041d\u0430\u0433\u0440\u0430\u0434\u0430 \u0437\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 finish_reward = 999 # \u041d\u0430\u0433\u0440\u0430\u0434\u0430 \u0437\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435  # \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0440\u0435\u0431\u0435\u0440 \u0433\u0440\u0430\u0444\u0430 adjacency_matrix = np.array([[1, 1, 1, 1],                              [0, 0, 0, 1],                              [0, 0, 0, 1],                              [0, 0, 0, 0]])  # \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043d\u0443\u043b\u044f\u043c\u0438 reward_matrix = np.zeros_like(adjacency_matrix) q_matrix = np.zeros_like(adjacency_matrix) # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430\u0433\u0440\u0430\u0434 mask = (adjacency_matrix != 0)  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0430\u0433\u0440\u0430\u0434\u043e\u0439 \u0437\u0430 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0431\u0440\u0430 reward_matrix[mask] = step_reward  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 reward_matrix[:, -1][mask[:, -1]] = finish_reward  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0448\u0442\u0440\u0430\u0444\u043e\u043c \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 reward_matrix[~mask] = absence_fine  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0446\u0438\u043a\u043b\u044b \u0448\u0442\u0440\u0430\u0444\u043e\u043c \u0437\u0430 \u0446\u0438\u043a\u043b\u044b, \u0446\u0438\u043a\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 adjacency_matrix \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0448\u0442\u0440\u0430\u0444\u043e\u043c \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 diagonal_mask = np.diagonal(adjacency_matrix != 0) diagonal_values = cycle_fine * diagonal_mask diagonal_values += absence_fine * ~diagonal_mask np.fill_diagonal(reward_matrix, diagonal_values) \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f: array([[ -60,   15,   15,  999],        [-999, -999, -999,  999],        [-999, -999, -999,  999],        [-999, -999, -999, -999]]) \u0414\u0430\u043b\u0435\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430\u0433\u0440\u0430\u0434 \u0438 Q-\u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0430\u0442\u044c \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.  # \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f import random epochs = 1000 eps = 0.2 # \u0414\u043e\u043b\u044f exploration alpha = 1 # \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f gamma = 0.8 # \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0438\u0441\u043a\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f num_states = reward_matrix.shape[1] - 1 for i in range(epochs): # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432     # \u0417\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     state = 0     while state != num_states:         eps_hat = random.uniform(0, 1) # \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0436\u0438\u043c         if eps_hat &lt; eps:             # Exploration             action = np.random.choice(range(0, num_states + 1))         else:             # Exploitation             action = np.argmax(q_matrix[state, :])         # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439         q_matrix[state, action] += alpha * (reward_matrix[state, action] + \\                                             gamma * np.max(q_matrix[action, :]) \\                                             - matrix[state, action])         state = action \u041f\u043e\u0441\u043b\u0435 1000 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043e\u0448\u043b\u0430\u0441\u044c: array([[ 739,  814,  814,  999],        [-199, -199, -199,  999],        [-199, -199, -199,  999],        [   0,    0,    0,    0]]) <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u0440\u0430\u0444, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7dd\/f2b\/68f\/7ddf2b68f9949b090d1851dc400a57e8.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u0413\u0440\u0430\u0444 G' \u0441 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u0413\u0440\u0430\u0444 G' \u0441 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438\" width=\"254\" height=\"398\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7dd\/f2b\/68f\/7ddf2b68f9949b090d1851dc400a57e8.png\"\/><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u0413\u0440\u0430\u0444 G&#8217; \u0441 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438<\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c Q-\u043c\u0430\u0442\u0440\u0438\u0446\u044b. <\/p>\n<pre><code>state = 0 print(state, end = \"->\") while state != num_states:     action = np.argmax(q_matrix[state, :])     print(action, end = \"->\")     state = action print(\"end\") 0->3->end <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 0 -> 3 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0443\u0442\u0438 &lt;a,d>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0438. <\/p>\n<p><strong>Process Mining<\/strong><\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043c\u0430\u0439\u043d\u0438\u043d\u0433\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041b\u043e\u0433 \u2013 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041b\u043e\u0433 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0430\u0434\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0430\u0434\u0438\u0439, \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0430\u0434\u0438\u044f\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. <\/p>\n<p>\u0413\u0440\u0430\u0444\u044b \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0440\u0430\u0439\u043d\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043e \u2013 \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u044f\u0437\u0435\u0439, \u0432\u0435\u0440\u0448\u0438\u043d, \u0446\u0438\u043a\u043b\u043e\u0432 \u0438 \u0431\u0443\u0442\u044b\u043b\u043e\u0447\u043d\u044b\u0445 \u0433\u043e\u0440\u043b\u044b\u0448\u0435\u043a (\u0441\u0442\u0430\u0434\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441). \u0412 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u0430\u043d \u0432 Q-learning. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u2013 \u043f\u043e\u0438\u0441\u043a \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0435\u0433\u043e \u043f\u0443\u0442\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435. \u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 SberPM. \u0420\u0430\u0437\u0432\u0438\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0431\u0440\u0430 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432 \u043d\u0430\u0433\u0440\u0430\u0434\u0430\u0445. <\/p>\n<p>Q-learning \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u044f\u0436\u0435\u043b\u044b\u0439 \u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u2013 \u0435\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"O(n^3 ).\" alt=\"O(n^3 ).\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/033\/b14\/f9b\/033b14f9b12b18abe778edaf124dcc28.svg\" width=\"55\" height=\"25\"\/><\/p>\n<p>\u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0435\u0433\u043e \u043f\u0443\u0442\u0438. Q-learning \u043e\u0434\u043d\u0430\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441 \u043d\u0430\u0433\u0440\u0430\u0434\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0443\u0431\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445, \u043d\u043e \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u043a \u043e\u043f\u0442\u0438\u043c\u0443\u043c\u0443 \u0432\u0435\u0442\u0432\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u043f\u0442\u0438\u043c\u0443\u043c\u043e\u0432. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/658909\/\"> https:\/\/habr.com\/ru\/post\/658909\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u0434\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u0435\u043c Q-learning \u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0432 \u0441\u0444\u0435\u0440\u0435 \u043c\u0430\u0439\u043d\u0438\u043d\u0433\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044f \u0435\u0433\u043e \u0438\u0437 \u0445\u0430\u043e\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430, \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0432\u044f\u0437\u0435\u0439 \u0438 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0439, \u0432 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0439 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p><strong>Reinforcement Learning<\/strong><\/p>\n<p>Reinforcement Learning (RL) &#8212; \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f (ML). \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 RL \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439. \u041e\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430\u0433\u0440\u0430\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043e\u0449\u0440\u044f\u044e\u0442 \u0438\u0445 \u0437\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u2013 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442 \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u044b\u0445 \u0438\u0433\u0440\u0430\u0445, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0442\u0440\u0430\u0444\u0438\u043a\u0430, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0443\u0442\u0435\u0439 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. <\/p>\n<p><strong>Q-Learning<\/strong><\/p>\n<p>Q-Learning \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 RL \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f model-free \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044f\u0445. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0434\u0435\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 ML. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0442\u0430\u043a\u0438\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 Deep Q Networks. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 Q-learning.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e\u0439 \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u044b\u043b\u043a\u043e\u0439 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u041c\u0430\u0440\u043a\u043e\u0432\u0441\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u2013 \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u0430 \u043d\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0443\u0442\u0438.<\/p>\n<p>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f s \u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f a \u0445\u0440\u0430\u043d\u0438\u0442 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u044f\u043c\u0438 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. <\/p>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0430\u0433\u0435\u043d\u0442\u043e\u0432. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e exploitation \u0438 exploration. \u0412 \u0440\u0435\u0436\u0438\u043c\u0435 exploitation \u0430\u0433\u0435\u043d\u0442\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 exploration \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e. \u0412\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0430\u0433\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 s\u2019. \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0432\u044b\u0431\u043e\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. <\/p>\n<p>\u0412\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0436\u0438\u043c\u0430\u043c\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c exploitation \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439.<\/p>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Q-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Temporal Difference. \u041e\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f:<\/p>\n<p>1.\u00a0\u00a0\u00a0\u00a0 R(s, a) &#8212; \u043d\u0430\u0433\u0440\u0430\u0434\u0443 \u0437\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 a \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 s<\/p>\n<figure class=\"float\"><figcaption>\u00a0&#8212; \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e \u0432\u0441\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c a\u2019 <\/figcaption><\/figure>\n<p>\u00a0 <\/p>\n<ol start=\"2\">\n<li>\n<p>Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 s\u2019. \u0412\u044b\u0431\u043e\u0440 s\u2019 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u043b\u043e\u0433\u0438\u043a\u0435. <\/p>\n<\/li>\n<\/ol>\n<p>\u0411\u0443\u0434\u0443\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0438\u0441\u043a\u043e\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u043c <\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u00a0\u2013 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u043b\u0438\u0437\u043a\u0438\u0435 \u043d\u0430\u0433\u0440\u0430\u0434\u044b \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b, \u0447\u0435\u043c \u0434\u0430\u043b\u0435\u043a\u0438\u0435, \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0438\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0439\u0442\u0438 \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0438\u0439 \u043f\u0443\u0442\u044c \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u044b, \u0430 (\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u0430 \u0437\u0435\u043b\u0435\u043d\u044b\u043c) \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 d (\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u0430 \u043a\u0440\u0430\u0441\u043d\u044b\u043c) \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0433\u0440\u0430\u0444\u0435 G:<\/p>\n<figure class=\"\"><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0413\u0440\u0430\u0444 G<\/figcaption><\/figure>\n<p>\u0417\u0430\u0434\u0430\u0435\u043c \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u044f: \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0440\u0435\u0431\u0440\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u043e\u0438\u0442\u044c 15 \u0435\u0434\u0438\u043d\u0438\u0446, \u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0448\u0438\u043d\u0443 d \u2013 999 \u0435\u0434\u0438\u043d\u0438\u0446. \u041f\u0440\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0438 \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 d \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u0433\u0440\u0430\u0444\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c <\/p>\n<figure class=\"float\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430\u0433\u0440\u0430\u0434 \u0434\u043b\u044f \u0430\u0433\u0435\u043d\u0442\u0430:<\/p>\n<figure class=\"\"><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 1. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0430\u0433\u0440\u0430\u0434<\/figcaption><\/figure>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0443\u043b\u044f\u043c\u0438:<\/p>\n<figure class=\"\"><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 2. Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0430<\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0435\u043d. \u041f\u0443\u0441\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0443\u0442\u044c &lt;a, b, d>. \u0418\u0437-\u0437\u0430 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 Q \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0430\u0433\u0435\u043d\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0433\u0440\u0430\u0434.<\/p>\n<figure class=\"\">&#187; title=&#187;\u0422\u0430\u0431\u043b\u0438\u0446\u0430 3. \u041f\u0435\u0440\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d>&#187; width=&#187;361&#8243; height=&#187;111&#8243; data-src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/be2\/281\/570\/be2281570c248310dbaa0ca6a664ec17.png&#187;\/><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 3. \u041f\u0435\u0440\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438 exploitation \u0430\u0433\u0435\u043d\u0442\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u043f\u0443\u0442\u044c &lt;a, b, d>.<\/p>\n<p>\u041a\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f.<\/p>\n<figure class=\"\">&#187; title=&#187;\u0422\u0430\u0431\u043b\u0438\u0446\u0430 4. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d>&#187; width=&#187;361&#8243; height=&#187;111&#8243; data-src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c8\/fbc\/1b0\/5c8fbc1b0f184bfdab5e281526869645.png&#187;\/><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 4. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0443\u0442\u0438 &lt;a, b, d><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u0432\u044b\u0431\u043e\u0440\u0435 \u043f\u0443\u0442\u0438 &lt;a, c, d> \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0430\u0433\u0435\u043d\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u0443\u0442\u044c &lt;a, d>. \u0422\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (a, d) \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"\"><figcaption>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 5. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f Q-\u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/figcaption><\/figure>\n<p>\u0412 \u0440\u0435\u0436\u0438\u043c\u0435 exploitation \u0430\u0433\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 &lt;a,d>. <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u0448\u043b\u0438\u0441\u044c. \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u043d\u0430\u0434\u043e \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u044b a \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0439\u0442\u0438 \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 d. <\/p>\n<p>\u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c &#8212; &lt;a,d>. <\/p>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u0413\u0440\u0430\u0444 G \u0441 \u0443\u0447\u0435\u0442\u043e\u043c Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/figcaption><\/figure>\n<p><em>\u041d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0438 \u0446\u0438\u043a\u043b\u044b<\/em><\/p>\n<p>\u041d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u043b\u0438 \u0432\u044b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0433\u0440\u0430\u0434. \u00a0\u041d\u0430 \u044d\u0442\u0430\u043f\u0435 exploitation \u0430\u0433\u0435\u043d\u0442\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0431\u0440\u0430 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0445 \u043d\u0438\u0437\u043a\u043e\u0433\u043e Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u0446\u0438\u043a\u043b\u044b \u0432 \u043f\u0443\u0442\u0438. <\/p>\n<p><strong>Python \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/strong><\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430\u0433\u0440\u0430\u0434. \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439 \u0432\u044b\u0448\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0433\u0440\u0430\u0444 G \u0446\u0438\u043a\u043b \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 a \u2013 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e G\u2019. <\/p>\n<figure class=\"\"><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. Graph G&#8217;<\/figcaption><\/figure>\n<pre><code>import numpy as np # \u0414\u0438\u0437\u0430\u0439\u043d \u043d\u0430\u0433\u0440\u0430\u0434 cycle_fine = -60 # \u0428\u0442\u0440\u0430\u0444 \u0437\u0430 \u0446\u0438\u043a\u043b absence_fine = -999 # \u0428\u0442\u0440\u0430\u0444 \u0437\u0430 \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 step_reward = 15 # \u041d\u0430\u0433\u0440\u0430\u0434\u0430 \u0437\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 finish_reward = 999 # \u041d\u0430\u0433\u0440\u0430\u0434\u0430 \u0437\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435  # \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0440\u0435\u0431\u0435\u0440 \u0433\u0440\u0430\u0444\u0430 adjacency_matrix = np.array([[1, 1, 1, 1],                              [0, 0, 0, 1],                              [0, 0, 0, 1],                              [0, 0, 0, 0]])  # \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043d\u0443\u043b\u044f\u043c\u0438 reward_matrix = np.zeros_like(adjacency_matrix) q_matrix = np.zeros_like(adjacency_matrix) # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430\u0433\u0440\u0430\u0434 mask = (adjacency_matrix != 0)  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0430\u0433\u0440\u0430\u0434\u043e\u0439 \u0437\u0430 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0431\u0440\u0430 reward_matrix[mask] = step_reward  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 reward_matrix[:, -1][mask[:, -1]] = finish_reward  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0448\u0442\u0440\u0430\u0444\u043e\u043c \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 reward_matrix[~mask] = absence_fine  # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0446\u0438\u043a\u043b\u044b \u0448\u0442\u0440\u0430\u0444\u043e\u043c \u0437\u0430 \u0446\u0438\u043a\u043b\u044b, \u0446\u0438\u043a\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 adjacency_matrix \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0448\u0442\u0440\u0430\u0444\u043e\u043c \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 diagonal_mask = np.diagonal(adjacency_matrix != 0) diagonal_values = cycle_fine * diagonal_mask diagonal_values += absence_fine * ~diagonal_mask np.fill_diagonal(reward_matrix, diagonal_values) \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f: array([[ -60,   15,   15,  999],        [-999, -999, -999,  999],        [-999, -999, -999,  999],        [-999, -999, -999, -999]]) \u0414\u0430\u043b\u0435\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430\u0433\u0440\u0430\u0434 \u0438 Q-\u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0430\u0442\u044c \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.  # \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f import random epochs = 1000 eps = 0.2 # \u0414\u043e\u043b\u044f exploration alpha = 1 # \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f gamma = 0.8 # \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0438\u0441\u043a\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f num_states = reward_matrix.shape[1] - 1 for i in range(epochs): # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432     # \u0417\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     state = 0     while state != num_states:         eps_hat = random.uniform(0, 1) # \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0436\u0438\u043c         if eps_hat &lt; eps:             # Exploration             action = np.random.choice(range(0, num_states + 1))         else:             # Exploitation             action = np.argmax(q_matrix[state, :])         # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c Q-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439         q_matrix[state, action] += alpha * (reward_matrix[state, action] + \\                                             gamma * np.max(q_matrix[action, :]) \\                                             - matrix[state, action])         state = action \u041f\u043e\u0441\u043b\u0435 1000 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043e\u0448\u043b\u0430\u0441\u044c: array([[ 739,  814,  814,  999],        [-199, -199, -199,  999],        [-199, -199, -199,  999],        [   0,    0,    0,    0]]) <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u0440\u0430\u0444, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"\"><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u0413\u0440\u0430\u0444 G&#8217; \u0441 Q-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438<\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c Q-\u043c\u0430\u0442\u0440\u0438\u0446\u044b. <\/p>\n<pre><code>state = 0 print(state, end = \"->\") while state != num_states:     action = np.argmax(q_matrix[state, :])     print(action, end = \"->\")     state = action print(\"end\") 0->3->end <\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 0 -> 3 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0443\u0442\u0438 &lt;a,d>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0438. <\/p>\n<p><strong>Process Mining<\/strong><\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043c\u0430\u0439\u043d\u0438\u043d\u0433\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041b\u043e\u0433 \u2013 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041b\u043e\u0433 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0430\u0434\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0430\u0434\u0438\u0439, \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0430\u0434\u0438\u044f\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. <\/p>\n<p>\u0413\u0440\u0430\u0444\u044b \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0440\u0430\u0439\u043d\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043e \u2013 \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u044f\u0437\u0435\u0439, \u0432\u0435\u0440\u0448\u0438\u043d, \u0446\u0438\u043a\u043b\u043e\u0432 \u0438 \u0431\u0443\u0442\u044b\u043b\u043e\u0447\u043d\u044b\u0445 \u0433\u043e\u0440\u043b\u044b\u0448\u0435\u043a (\u0441\u0442\u0430\u0434\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441). \u0412 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u0430\u043d \u0432 Q-learning. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u2013 \u043f\u043e\u0438\u0441\u043a \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0435\u0433\u043e \u043f\u0443\u0442\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435. \u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 SberPM. \u0420\u0430\u0437\u0432\u0438\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0431\u0440\u0430 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432 \u043d\u0430\u0433\u0440\u0430\u0434\u0430\u0445. <\/p>\n<p>Q-learning \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u044f\u0436\u0435\u043b\u044b\u0439 \u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u2013 \u0435\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <\/p>\n<p>\u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0435\u0433\u043e \u043f\u0443\u0442\u0438. Q-learning \u043e\u0434\u043d\u0430\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441 \u043d\u0430\u0433\u0440\u0430\u0434\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0443\u0431\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445, \u043d\u043e \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u043a \u043e\u043f\u0442\u0438\u043c\u0443\u043c\u0443 \u0432\u0435\u0442\u0432\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u043f\u0442\u0438\u043c\u0443\u043c\u043e\u0432. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/658909\/\"> https:\/\/habr.com\/ru\/post\/658909\/<\/a><br \/><\/br><\/br><\/p>\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-331455","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331455","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=331455"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331455\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}