{"id":427340,"date":"2024-07-25T21:36:43","date_gmt":"2024-07-25T21:36:43","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=427340"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=427340","title":{"rendered":"<span>\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u0441 TensorFlow<\/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><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0431\u044b\u043b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d \u042d\u043d\u0434\u0440\u044e \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u0432 1967 \u0433\u043e\u0434\u0443 \u0434\u043b\u044f \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441\u0432\u044f\u0437\u0438. <\/p>\n<p><strong>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0412\u0438\u0442\u0435\u0440\u0431\u0438<\/strong> \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0432 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0441 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u043c\u0430\u0440\u043a\u043e\u0432\u0441\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 <strong>\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439,<\/strong> \u0432\u044b\u0437\u0432\u0430\u0432\u0448\u0438\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439. <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430:<\/p>\n<ul>\n<li>\n<p><strong>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438<\/strong>: \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u0441 \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0412 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u043c\u0430\u0440\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 (\u0438\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f) \u0434\u0430\u044e\u0442 \u043d\u0430\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u043e\u0432\u044b \u0448\u0430\u043d\u0441\u044b \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"S1\" alt=\"S1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bbe\/669\/c91\/bbe669c91a6a165e8b7dafeea9587816.svg\" width=\"22\" height=\"17\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"S2 \" alt=\"S2 \" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0b3\/e27\/6c2\/0b3e276c29f4bdf683c8cfefcfe31f08.svg\" width=\"22\" height=\"17\"\/>\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"S3\" alt=\"S3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f91\/982\/bce\/f91982bce874603f47560b76ec96891a.svg\" width=\"22\" height=\"17\"\/>, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a , <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"P(S2)\" alt=\"P(S2)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7c6\/5e8\/497\/7c65e849737d354ca9b384af1d162d65.svg\" width=\"52\" height=\"22\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"P(S3)\" alt=\"P(S3)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/344\/ea8\/879\/344ea887957c106c5a2d933bb462950b.svg\" width=\"52\" height=\"22\"\/>, \u0433\u0434\u0435 \u0441\u0443\u043c\u043c\u0430 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0432\u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"1\" alt=\"1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4d3\/ce1\/e8d\/4d3ce1e8d1d6285d510d0c3919fd6043.svg\" width=\"10\" height=\"16\"\/>.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432<\/strong>: \u043c\u0430\u0442\u0440\u0438\u0446\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u0430\u0436\u0434\u0430\u044f \u044f\u0447\u0435\u0439\u043a\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a_{ij}\" alt=\"a_{ij}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5da\/676\/f34\/5da676f34aa0106716d982f25f2eacd9.svg\" width=\"22\" height=\"17\"\/> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0438\u0437 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"S_i\" alt=\"S_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/237\/9bb\/fbc\/2379bbfbc2901e9bd557c5f45fdb1669.svg\" width=\"18\" height=\"20\"\/> \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"S_j\" alt=\"S_j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/246\/adc\/7bc\/246adc7bc18e91091f108606be6ea327.svg\" width=\"19\" height=\"22\"\/>. \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044f, \u043a\u0430\u043a \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u0412 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u043c\u0430\u0440\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0435\u0441\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"S_i\" alt=\"S_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/27d\/7c7\/76e\/27d7c776eaad60cde7da361a0de4c23f.svg\" width=\"18\" height=\"20\"\/> \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"t\" alt=\"t\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d17\/320\/72b\/d1732072b9c18306e840c072bd21e8f0.svg\" width=\"7\" height=\"16\"\/> , \u0442\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a_{ij}\" alt=\"a_{ij}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1de\/b2f\/d64\/1deb2fd64e87469a7af64f7b10c2c0ab.svg\" width=\"22\" height=\"17\"\/> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435  <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"S_j\" alt=\"S_j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/418\/a10\/05e\/418a1005e2bc587f54e3c8685c36953d.svg\" width=\"19\" height=\"22\"\/> \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"t+1\" alt=\"t+1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/813\/df3\/3c0\/813df33c0b144288e454413137898b90.svg\" width=\"40\" height=\"17\"\/>.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u044d\u043c\u0438\u0441\u0441\u0438\u0439<\/strong>: \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u042d\u043c\u0438\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442, \u043a\u0430\u043a \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O_k \" alt=\"O_k \" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/316\/4b2\/745\/3164b2745f807d770fa96fc8577edb72.svg\" width=\"24\" height=\"20\"\/>\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"S_i\" alt=\"S_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/130\/31d\/6aa\/13031d6aa736ef5684ba92c5da2e45f9.svg\" width=\"18\" height=\"20\"\/>, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_i(O_k)\" alt=\"b_i(O_k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ca4\/43d\/1ec\/ca443d1ec0af93d5f004e4536372abe0.svg\" width=\"54\" height=\"22\"\/>. \u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u044d\u0442\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0438 \u0441\u0443\u043c\u043c\u0430 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0440\u0430\u0432\u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"1\" alt=\"1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7c\/d34\/4c2\/b7cd344c2ee6ebb9e949424ac75d2453.svg\" width=\"10\" height=\"16\"\/>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439, \u0438 \u0435\u0441\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <em>\u0441\u043e\u043b\u043d\u0435\u0447\u043d<\/em>\u043e \u0438 <em>\u0434\u043e\u0436\u0434\u043b\u0438\u0432\u043e<\/em>. \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c\u0438: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"P(\\text{\u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e}) = 0.6\" alt=\"P(\\text{\u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e}) = 0.6\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f26\/ddc\/4eb\/f26ddc4ebc0673c8a70917c474ace8fa.svg\" width=\"152\" height=\"25\"\/> ) \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"P(\\text{\u0434\u043e\u0436\u0434\u043b\u0438\u0432\u043e}) = 0.4\" alt=\"P(\\text{\u0434\u043e\u0436\u0434\u043b\u0438\u0432\u043e}) = 0.4\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/390\/32f\/338\/39032f3384b004a9fc29e18b48214142.svg\" width=\"158\" height=\"25\"\/>. \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e, \u0442\u043e \u0437\u0430\u0432\u0442\u0440\u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\" 0.7\" alt=\" 0.7\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/93f\/0f6\/777\/93f0f677762d8f4b50df5d6df82f48c7.svg\" width=\"25\" height=\"17\"\/>, \u0430 \u0434\u043e\u0436\u0434\u043b\u0438\u0432\u043e \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\" 0.3\" alt=\" 0.3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f12\/d5f\/a6f\/f12d5fa6f80f046ba7fd8a7f862cbeb3.svg\" width=\"25\" height=\"16\"\/>, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u044d\u043c\u0438\u0441\u0441\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e, \u0442\u043e \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"0.9\" alt=\"0.9\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/37a\/354\/b31\/37a354b316b36a2d4e342b26622bda28.svg\" width=\"25\" height=\"16\"\/> \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u0441\u043e\u043b\u043d\u0446\u0435, \u0430 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"0.1\" alt=\"0.1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eed\/bfe\/127\/eedbfe127e74164d2e70c91e88b72993.svg\" width=\"25\" height=\"16\"\/> \u2014 \u0434\u043e\u0436\u0434\u044c, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<\/p>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u0432 TF<\/h4>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0441\u0430\u043c TensorFlow:<\/p>\n<pre><code class=\"bash\">pip install tensorflow<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f numpy.<\/p>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u044d\u0448, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"python\">import tensorflow as tf  class HMM:     def __init__(self, initial_prob, trans_prob, obs_prob):         self.initial_prob = tf.constant(initial_prob, dtype=tf.float64)         self.trans_prob = tf.constant(trans_prob, dtype=tf.float64)         self.obs_prob = tf.constant(obs_prob, dtype=tf.float64)         self.viterbi = tf.Variable(initial_value=tf.zeros([self.initial_prob.shape[0], None], dtype=tf.float64), trainable=False)      def get_emission(self, obs_idx):         return tf.gather(self.obs_prob, obs_idx)<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u044d\u0448\u0430 \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0448\u0430\u0433\u0435:<\/p>\n<pre><code class=\"python\">class HMM:     # \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438      def decode_op(self, obs_idx):         emissions = self.get_emission(obs_idx)         transitions = tf.matmul(self.viterbi, tf.transpose(emissions))         weighted_transitions = transitions * self.trans_prob         viterbi_update = tf.reduce_max(weighted_transitions, axis=1)         return tf.reshape(viterbi_update, tf.shape(self.viterbi))<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438:<\/p>\n<pre><code class=\"python\">class HMM:     # \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 decode_op      def backpt_op(self):         back_transitions = tf.matmul(self.viterbi, tf.ones([self.viterbi.shape[1], self.trans_prob.shape[0]], dtype=tf.float64))         weighted_back_transitions = back_transitions * self.trans_prob         return tf.argmax(weighted_back_transitions, axis=1)<\/code><\/pre>\n<p>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">import numpy as np  # \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 HMM initial_prob = np.array([0.6, 0.4]) trans_prob = np.array([[0.7, 0.3], [0.4, 0.6]]) obs_prob = np.array([[0.5, 0.5], [0.1, 0.9]])  # \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 observations = np.array([0, 1, 1])  # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 hmm = HMM(initial_prob, trans_prob, obs_prob)  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 TensorFlow with tf.Session() as sess:     sess.run(tf.global_variables_initializer())          # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u044d\u0448\u0430 \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u043c\u0438     viterbi_init = sess.run(hmm.initial_prob)          backpts = np.ones((hmm.trans_prob.shape[0], len(observations)), dtype='int32') * -1          for t in range(1, len(observations)):         feed_dict = {hmm.viterbi: viterbi_init}         viterbi, backpt = sess.run([hmm.decode_op(observations[t]), hmm.backpt_op()], feed_dict=feed_dict)         backpts[:, t] = backpt          # \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439     tokens = [np.argmax(viterbi)]     for i in range(len(observations) - 1, 0, -1):         tokens.append(backpts[tokens[-1], i])     tokens.reverse()      print('Most likely hidden states are', tokens)<\/code><\/pre>\n<hr\/>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432  \u0442\u0435\u043b\u0435\u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044f\u0445, \u0431\u0438\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u043a\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0438 \u0442.\u0434.<\/p>\n<p><em>\u0412\u0441\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b DS \u0438 ML \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u043d\u0430 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u0430\u0445 OTUS: <\/em><a href=\"https:\/\/otus.pw\/HOlx\/\"><em>\u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435<\/em><\/a><em> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u0430 <\/em><a href=\"https:\/\/otus.pw\/p0AB\/\"><em>\u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435<\/em><\/a><em> \u2014 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0443\u0440\u043e\u043a\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\/articles\/824162\/\"> https:\/\/habr.com\/ru\/articles\/824162\/<\/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><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0431\u044b\u043b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d \u042d\u043d\u0434\u0440\u044e \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u0432 1967 \u0433\u043e\u0434\u0443 \u0434\u043b\u044f \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441\u0432\u044f\u0437\u0438. <\/p>\n<p><strong>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0412\u0438\u0442\u0435\u0440\u0431\u0438<\/strong> \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0432 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0441 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u043c\u0430\u0440\u043a\u043e\u0432\u0441\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 <strong>\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439,<\/strong> \u0432\u044b\u0437\u0432\u0430\u0432\u0448\u0438\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439. <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430:<\/p>\n<ul>\n<li>\n<p><strong>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438<\/strong>: \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u0441 \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0412 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u043c\u0430\u0440\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 (\u0438\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f) \u0434\u0430\u044e\u0442 \u043d\u0430\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u043e\u0432\u044b \u0448\u0430\u043d\u0441\u044b \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f , \u0438 , \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a ,  \u0438 , \u0433\u0434\u0435 \u0441\u0443\u043c\u043c\u0430 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0432\u043d\u0430 .<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432<\/strong>: \u043c\u0430\u0442\u0440\u0438\u0446\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u0430\u0436\u0434\u0430\u044f \u044f\u0447\u0435\u0439\u043a\u0430  \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0438\u0437 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f  \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 . \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044f, \u043a\u0430\u043a \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u0412 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u043c\u0430\u0440\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0435\u0441\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438  \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438  , \u0442\u043e  \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435   \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 .<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u044d\u043c\u0438\u0441\u0441\u0438\u0439<\/strong>: \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u042d\u043c\u0438\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442, \u043a\u0430\u043a \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 , \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a . \u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u044d\u0442\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0438 \u0441\u0443\u043c\u043c\u0430 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0440\u0430\u0432\u043d\u0430 .<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439, \u0438 \u0435\u0441\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <em>\u0441\u043e\u043b\u043d\u0435\u0447\u043d<\/em>\u043e \u0438 <em>\u0434\u043e\u0436\u0434\u043b\u0438\u0432\u043e<\/em>. \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c\u0438:  ) \u0438 . \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e, \u0442\u043e \u0437\u0430\u0432\u0442\u0440\u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e, \u0430 \u0434\u043e\u0436\u0434\u043b\u0438\u0432\u043e \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u044d\u043c\u0438\u0441\u0441\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e, \u0442\u043e \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e  \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u0441\u043e\u043b\u043d\u0446\u0435, \u0430 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e  \u2014 \u0434\u043e\u0436\u0434\u044c, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<\/p>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u0432 TF<\/h4>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0441\u0430\u043c TensorFlow:<\/p>\n<pre><code class=\"bash\">pip install tensorflow<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f numpy.<\/p>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u044d\u0448, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"python\">import tensorflow as tf  class HMM:     def __init__(self, initial_prob, trans_prob, obs_prob):         self.initial_prob = tf.constant(initial_prob, dtype=tf.float64)         self.trans_prob = tf.constant(trans_prob, dtype=tf.float64)         self.obs_prob = tf.constant(obs_prob, dtype=tf.float64)         self.viterbi = tf.Variable(initial_value=tf.zeros([self.initial_prob.shape[0], None], dtype=tf.float64), trainable=False)      def get_emission(self, obs_idx):         return tf.gather(self.obs_prob, obs_idx)<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u044d\u0448\u0430 \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0448\u0430\u0433\u0435:<\/p>\n<pre><code class=\"python\">class HMM:     # \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438      def decode_op(self, obs_idx):         emissions = self.get_emission(obs_idx)         transitions = tf.matmul(self.viterbi, tf.transpose(emissions))         weighted_transitions = transitions * self.trans_prob         viterbi_update = tf.reduce_max(weighted_transitions, axis=1)         return tf.reshape(viterbi_update, tf.shape(self.viterbi))<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438:<\/p>\n<pre><code class=\"python\">class HMM:     # \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 decode_op      def backpt_op(self):         back_transitions = tf.matmul(self.viterbi, tf.ones([self.viterbi.shape[1], self.trans_prob.shape[0]], dtype=tf.float64))         weighted_back_transitions = back_transitions * self.trans_prob         return tf.argmax(weighted_back_transitions, axis=1)<\/code><\/pre>\n<p>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">import numpy as np  # \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 HMM initial_prob = np.array([0.6, 0.4]) trans_prob = np.array([[0.7, 0.3], [0.4, 0.6]]) obs_prob = np.array([[0.5, 0.5], [0.1, 0.9]])  # \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 observations = np.array([0, 1, 1])  # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 hmm = HMM(initial_prob, trans_prob, obs_prob)  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 TensorFlow with tf.Session() as sess:     sess.run(tf.global_variables_initializer())          # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u044d\u0448\u0430 \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u043c\u0438     viterbi_init = sess.run(hmm.initial_prob)          backpts = np.ones((hmm.trans_prob.shape[0], len(observations)), dtype='int32') * -1          for t in range(1, len(observations)):         feed_dict = {hmm.viterbi: viterbi_init}         viterbi, backpt = sess.run([hmm.decode_op(observations[t]), hmm.backpt_op()], feed_dict=feed_dict)         backpts[:, t] = backpt          # \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439     tokens = [np.argmax(viterbi)]     for i in range(len(observations) - 1, 0, -1):         tokens.append(backpts[tokens[-1], i])     tokens.reverse()      print('Most likely hidden states are', tokens)<\/code><\/pre>\n<hr\/>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0412\u0438\u0442\u0435\u0440\u0431\u0438 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432  \u0442\u0435\u043b\u0435\u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044f\u0445, \u0431\u0438\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u043a\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0438 \u0442.\u0434.<\/p>\n<p><em>\u0412\u0441\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b DS \u0438 ML \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u043d\u0430 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u0430\u0445 OTUS: <\/em><a href=\"https:\/\/otus.pw\/HOlx\/\"><em>\u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435<\/em><\/a><em> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u0430 <\/em><a href=\"https:\/\/otus.pw\/p0AB\/\"><em>\u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435<\/em><\/a><em> \u2014 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0443\u0440\u043e\u043a\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\/articles\/824162\/\"> https:\/\/habr.com\/ru\/articles\/824162\/<\/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-427340","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/427340","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=427340"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/427340\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=427340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=427340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=427340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}