{"id":338305,"date":"2022-09-13T15:00:19","date_gmt":"2022-09-13T15:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=338305"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=338305","title":{"rendered":"<span>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 DALL-E<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/687508\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ff\/qh\/no\/ffqhnotdffvev2ewkwcekssyula.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ff\/qh\/no\/ffqhnotdffvev2ewkwcekssyula.png\"\/><\/div>\n<p><\/a><br \/>  \u0412 \u042f\u043d\u0432\u0430\u0440\u0435 2021 \u0433\u043e\u0434\u0430 Open AI \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 DALL-E, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u043b\u044e\u0431\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e, \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0435\u043c\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044f\u043c\u0438, \u043d\u043e \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043c\u0435 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0451 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Text2Image \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c DALL-E, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0445\u0430\u0440\u0434\u043a\u043e\u0440 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e DALL-E \u043f\u043e\u0447\u0442\u0438 \u0441 \u043d\u0443\u043b\u044f.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2><font color=\"#3AC1EF\">GPT<\/font><\/h2>\n<p>  DALL-E \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439, \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0438\u0445 \u2014 \u044d\u0442\u043e GPT.<\/p>\n<p>  GPT \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 Transformers, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0414\u0435\u043a\u043e\u0434\u0435\u0440\u0430. GPT \u0443\u0447\u0438\u0442\u0441\u044f \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0432 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<h3><font color=\"#3AC1EF\">\u258d Attention<\/font><\/h3>\n<p>  \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c Attention \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c \u043a\u043e\u0433\u043d\u0438\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432.<\/p>\n<p>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432:<\/p>\n<ol>\n<li>Key \u2014 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u0430 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0437\u0432\u043d\u0435.<\/li>\n<li>Query \u2014 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u0430 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430.<\/li>\n<li>Value \u2014 \u0440\u0435\u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430<\/li>\n<\/ol>\n<p>  \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 <code>Query<\/code> \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 <code>Key<\/code> \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>SoftMax<\/code> \u0434\u0430\u0441\u0442 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430.<\/p>\n<p>  \u0423\u043c\u043d\u043e\u0436\u0438\u0432 <code>Value<\/code> \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u043d\u0430 \u0435\u0433\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0443\u043c\u043c\u0443 \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440 \u043c\u044b \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u044d\u043c\u0431\u0435\u043d\u0434\u0438\u043d\u0433\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 (\u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044f) \u0438, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0442\u043e\u043a\u0435\u043d\u043e\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/yx\/vw\/ou\/yxvwoujcadhlalw2xgq3dnoezjq.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/yx\/vw\/ou\/yxvwoujcadhlalw2xgq3dnoezjq.png\"\/><\/p>\n<p>  \u041e\u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0441\u0435\u0431\u044f \u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0440\u043e\u0439 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/sd\/er\/xk\/sderxkzfbmlbkoq3thnxszv6dic.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/sd\/er\/xk\/sderxkzfbmlbkoq3thnxszv6dic.png\"\/><\/p>\n<h2><font color=\"#3AC1EF\">VQ-GAN<\/font><\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/_c\/im\/zm\/_cimzmorx4c2gm260aylkast714.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/_c\/im\/zm\/_cimzmorx4c2gm260aylkast714.png\"\/><\/p>\n<p>  VQ-GAN \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0441\u0436\u0438\u043c\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u0435\u0442\u043a\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 (\u0442\u043e\u043a\u0435\u043d\u043e\u0432) \u0438 \u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430, \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430 \u0438 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>  VQ-GAN \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0438\u0434\u0435\u0439 VQVAE \u0438 GAN.<\/p>\n<h3><font color=\"#3AC1EF\">\u258d VQ-VAE (Vector Quantized Variational Autoencoder)<\/font><\/h3>\n<p>  \u0418\u0434\u0435\u044f VQ-VAE \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u0441\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0436\u0438\u043c\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0435 \u0441\u043a\u0440\u044b\u0442\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438 \u0440\u0430\u0437\u0436\u0438\u043c\u0430\u0442\u044c \u0432 \u0441\u043a\u0440\u044b\u0442\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u043c\u0438 \u043f\u043e\u0442\u0435\u0440\u044f\u043c\u0438.<\/p>\n<p>  \u042d\u043d\u043a\u043e\u0434\u0435\u0440 \u0431\u0435\u0440\u0451\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 512\u00d7512 \u0438 \u0441\u0436\u0438\u043c\u0430\u0435\u0442 (\u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438) \u0434\u043e 256\u00d71, \u0438\u0449\u0435\u0442 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0432 \u0441\u043a\u0440\u044b\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u043a\u043e\u0434\u0435\u0440 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0440\u0430\u0437\u0436\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 512\u00d7512.<\/p>\n<h3><font color=\"#3AC1EF\">\u258d VQ-VAE + GAN = VQ-GAN<\/font><\/h3>\n<p>  \u042d\u043d\u043a\u043e\u0434\u0435\u0440 \u0432\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 \u0441\u0436\u0430\u0442\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0441\u043e\u0441\u0435\u0434\u0430 \u0432 \u0441\u043a\u0440\u044b\u0442\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0430 \u0414\u0435\u043a\u043e\u0434\u0435\u0440 \u0440\u0430\u0437\u0436\u0438\u043c\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0422\u0443\u0442 \u0432 \u0438\u0433\u0440\u0443 \u0432\u0445\u043e\u0434\u0438\u0442 \u0447\u0430\u0441\u0442\u0438\u0447\u043a\u0430 GAN, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440. \u0414\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043f\u043e\u0442\u0435\u0440\u044c \u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u042d\u043d\u043a\u043e\u0434\u0435\u0440\u0443 \u0438 \u0414\u0435\u043a\u043e\u0434\u0435\u0440\u0443, \u043a\u0430\u043a \u043e\u0431\u043c\u0430\u043d\u0443\u0442\u044c \u0414\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440 \u0438 \u0432 \u0440\u0430\u0437\u044b \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<h2><font color=\"#3AC1EF\">\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438<\/font><\/h2>\n<p>  \u042d\u043d\u043a\u043e\u0434\u0435\u0440 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 X \u0432 \u0441\u0435\u0442\u043a\u0443 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/wo\/8x\/jp\/wo8xjp_mz9v2ojwqclhxo0vx5r8.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/wo\/8x\/jp\/wo8xjp_mz9v2ojwqclhxo0vx5r8.png\"\/><\/p>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0432 \u0441\u0435\u0442\u043a\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 q(\u1e91)<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/em\/4t\/0x\/em4t0xzi-zd-vr5eugntl6pet0y.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/em\/4t\/0x\/em4t0xzi-zd-vr5eugntl6pet0y.png\"\/><\/p>\n<p>  \u0414\u0435\u043a\u043e\u0434\u0435\u0440 \u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u0443\u044e\u0442 \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u043a\u0443<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/s7\/ry\/us\/s7ryusemwyec3_td7hbwfluno8e.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/s7\/ry\/us\/s7ryusemwyec3_td7hbwfluno8e.png\"\/><\/p>\n<p>  \u0414\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f VQ-GAN \u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u044b\u0445 \u0434\u0432\u0430 \u041b\u043e\u0441\u0441\u0430 (\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c):<\/p>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/tp\/wx\/sq\/tpwxsqel7oig2nm231nbrrdngge.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/tp\/wx\/sq\/tpwxsqel7oig2nm231nbrrdngge.png\"\/><\/p>\n<p>  \u0414\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u0440\u0440\u0440\u2026<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0434\u0430\u0436\u0435 \u0438\u0437 \u043e\u0447\u0435\u043d\u044c \u0441\u0436\u0430\u0442\u043e\u0439 \u0441\u0435\u0442\u043a\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/i2\/kx\/i5\/i2kxi5vejpufzabvysagkwcnfoa.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/i2\/kx\/i5\/i2kxi5vejpufzabvysagkwcnfoa.png\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0448 \u0434\u0435\u043a\u043e\u0434\u0435\u0440:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/jy\/xw\/s5\/jyxws5wj5z9-ghb3x1panzigilk.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/jy\/xw\/s5\/jyxws5wj5z9-ghb3x1panzigilk.png\"\/><\/p>\n<h2><font color=\"#3AC1EF\">GPT + VQ-GAN = DALL-E<\/font><\/h2>\n<p>  \u00ab\u041c\u044b \u0443\u043c\u0435\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GPT \u0438 \u0443\u043c\u0435\u0435\u043c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0430\u0432\u0442\u043e\u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c?\u00bb \u2014 \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0437 Open AI \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 DALL-E.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0431\u0443\u0447\u0438\u0442\u044c GPT \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043a\u0441\u0442, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 VQ-GAN \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041d\u0430 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u0438 \u043e\u043d\u0430 \u043d\u0430\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u00ab\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c\u00bb \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0432 \u044f\u0437\u044b\u043a \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435: \u0422\u0435\u043a\u0441\u0442 \u04c0 \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430.<\/p>\n<p>  \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430, \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430 VQGAN \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 32*32 \u0438 \u0443\u0447\u0438\u043c GPT \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c 128 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 1024 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, GPT \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u043d\u0430 \u0432\u0445\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0441\u0442, \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430 VQGAN \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0432\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u0442\u0435\u043a\u0441\u0442\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/vr\/va\/wa\/vrvawaf_oijtv9qgs49catfjnls.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/vr\/va\/wa\/vrvawaf_oijtv9qgs49catfjnls.png\"\/><\/p>\n<h2><font color=\"#3AC1EF\">\u0427\u0442\u043e \u043f\u043e \u043a\u043e\u0434\u0443?<\/font><\/h2>\n<p>  \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0451\u043c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u043e\u043a\u0443\u0441\u044b \u0432 \u043a\u043e\u0434. \u042d\u0442\u043e \u043b\u0435\u0433\u0447\u0435, \u0447\u0435\u043c \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435!<\/p>\n<p>  (\u0414\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Google Colab)<\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e GPT<\/font><\/h3>\n<p>  <\/p>\n<pre><code class=\"python\">!pip install datasets &amp;>> install.log <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">!git clone https:\/\/github.com\/karpathy\/minGPT &amp;>> install.log    !cd minGPT; git checkout 3ed14b2cec0dfdad3f4b2831f2b4a86d11aef150 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">!git clone https:\/\/github.com\/karpathy\/minGPT &amp;>> install.log import sys sys.path.append('minGPT') import numpy as np import torch import torch.nn as nn from torch.nn import functional as F import math from torch.utils.data import Dataset from mingpt.model import GPT, GPTConfig from mingpt.trainer import Trainer, TrainerConfig from mingpt.utils import sample   import logging logging.basicConfig(         format=\"%(asctime)s - %(levelname)s - %(name)s -   %(message)s\",         datefmt=\"%m\/%d\/%Y %H:%M:%S\",         level=logging.INFO, ) <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 VQ-GAN<\/font><\/h3>\n<p>  <\/p>\n<pre><code class=\"python\"># \u042d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e, \u043d\u043e \u0446\u0435\u043b\u044c \u0437\u0434\u0435\u0441\u044c # - \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0451 \u043a \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438.  # \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 VQGAN print('Downloading VQGAN model weights') !curl -L 'https:\/\/heibox.uni-heidelberg.de\/d\/8088892a516d4e3baf92\/files\/?p=%2Fckpts%2Flast.ckpt&amp;dl=1' > vqgan_im1024.ckpt !curl -L 'https:\/\/heibox.uni-heidelberg.de\/d\/8088892a516d4e3baf92\/files\/?p=%2Fconfigs%2Fmodel.yaml&amp;dl=1' > vqgan_im1024.yaml #\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a VQGAN print('Installing requirements') !git clone https:\/\/github.com\/CompVis\/taming-transformers &amp;> \/dev\/null !pip install einops omegaconf pytorch_lightning &amp;> \/dev\/null  # \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 VQGAN import sys, einops, torch sys.path.append('.\/taming-transformers') from omegaconf import OmegaConf from taming.models import cond_transformer, vqgan from PIL import Image from matplotlib import pyplot as plt  def load_vqgan_model(config_path, checkpoint_path):     config = OmegaConf.load(config_path)     if config.model.target == 'taming.models.vqgan.VQModel':         model = vqgan.VQModel(**config.model.params)         model.eval().requires_grad_(False)         model.init_from_ckpt(checkpoint_path)     elif config.model.target == 'taming.models.cond_transformer.Net2NetTransformer':         parent_model = cond_transformer.Net2NetTransformer(**config.model.params)         parent_model.eval().requires_grad_(False)         parent_model.init_from_ckpt(checkpoint_path)         model = parent_model.first_stage_model     else:         raise ValueError(f'unknown model type: {config.model.target}')     del model.loss     return model  print('Loading VQGAN model') device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') vqgan_model = load_vqgan_model('vqgan_im1024.yaml', 'vqgan_im1024.ckpt').to(device)    print('Dataset Prep') !pip install openimages !wget https:\/\/storage.googleapis.com\/localized-narratives\/annotations\/open_images_validation_captions.jsonl  import json  with open('\/content\/open_images_validation_captions.jsonl', 'r') as json_file:     json_list = list(json_file)  for json_str in json_list[:5]:     result = json.loads(json_str)  import urllib3 import boto3 import botocore import concurrent.futures import os from tqdm.notebook import tqdm  def _download_single_image(arguments):     if os.path.exists(arguments[\"dest_file_path\"]):         return      try:         with open(arguments[\"dest_file_path\"], \"wb\") as dest_file:             arguments[\"s3_client\"].download_fileobj(                 \"open-images-dataset\",                 arguments[\"image_file_object_path\"],                 dest_file,             )      except urllib3.exceptions.ProtocolError as error:         _logger.warning(             f\"Unable to download image {arguments['image_file_object_path']} -- skipping\",             error,         )   def download_images_by_id(image_ids,section, images_directory):      # \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437 AWS S3, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442 boto S3     s3_client = boto3.client(         's3',         config=botocore.config.Config(signature_version=botocore.UNSIGNED),     )     # \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438    # \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438     download_args_list = []     for image_id in image_ids:         image_file_name = image_id + \".jpg\"         download_args = {             \"s3_client\": s3_client,             \"image_file_object_path\": section + \"\/\" + image_file_name,             \"dest_file_path\": os.path.join(images_directory, image_file_name),         }         download_args_list.append(download_args)              # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 ThreadPoolExecutor \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439     with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:          # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441 \u0438\u0442\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432         list(tqdm(executor.map(_download_single_image, download_args_list),                   total=len(download_args_list), desc=\"Downloading images\")) !mkdir -p ims def get_openimages(n_images=2000):   print('Downloading images')   download_images_by_id([json.loads(s)['image_id'] for s in json_list[:n_images]], 'validation', 'ims\/')   data = [json.loads(s) for s in json_list[:n_images]]   return data <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">type(vqgan_model) # \u041d\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c vqgan \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442<\/font><\/h3>\n<p>  <\/p>\n<pre><code class=\"python\"># @title \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u043c\u0430\u0440\u043a\u0435\u0440\u044b \u043f\u0435\u0440\u0435\u0434 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 from torch.utils.data import Dataset import numpy as np  max_text_length = 128 vocab = 'abcdefghijklmnopqrstuvwxzy '  def encode_char(c):   if c in vocab:     return vocab.index(c)   return 50 # 'special character'  class PatchDataset(Dataset):      def __init__(self, image_fns, labels, block_size=255, max_text_length=128):         # \u041f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0442\u043e\u043a\u0435\u043d\u044b VQGAN \u0438\u0437 \u0432\u0435\u0440\u0441\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 256 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0439 \u044d\u043c\u0431\u0435\u043d\u0434\u0438\u043d\u0433\u043e\u0432 CLIP         self.ims = [] # # \u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 VQGAN         self.conds = []                  for fn, caption in tqdm(zip(image_fns, labels)):             self.ims.append(fn)             self.conds.append(caption)          # 1024 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u0434\u0430 VQGAN + \u043d\u0430\u0448\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430         chars = range(1024+53)         data_size, vocab_size = len(image_fns), len(chars)         print('data has %d characters, %d unique.' % (data_size, vocab_size))         self.stoi = { ch:i for i,ch in enumerate(chars) }         self.itos = { i:ch for i,ch in enumerate(chars) }         self.block_size = block_size # + max_text_length &lt;&lt; TODO?         self.vocab_size = vocab_size          def __len__(self):         return len(self.ims)# was len(self.data) - self.block_size              def __getitem__(self, idx):                  fn = self.ims[idx]         caption = self.conds[idx]                  # \u0417\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e vegan         pil_im = Image.open(fn).convert('RGB').resize((256, 256))         im_tensor = torch.tensor(np.array(pil_im)).permute(2, 0, 1) \/ 255         with torch.no_grad():             z, a, b = vqgan_model.encode(im_tensor.to(device).unsqueeze(0) * 2 - 1)         im_idxs = b[-1] # 16*16                  # \u0417\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u0439\u0442\u0435 \u0442\u0435\u043a\u0441\u0442:         char_idxs = [encode_char(c) for c in caption.lower()[:max_text_length]]         while len(char_idxs) &lt; max_text_length:             char_idxs += [51]         # 52 - \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0446 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432.         char_idxs += [52]         # \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u0441 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438 \u043e\u0442 vegan, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c 1024         char_idxs = [c+1024 for c in char_idxs]                  # \u041a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u0435\u043c         dix = [self.stoi[int(s)] for s in char_idxs]         dix += [self.stoi[int(s)] for s in im_idxs]                  # \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 x \u0438 y         x = torch.tensor(dix[:-1], dtype=torch.long)         y = torch.tensor(dix[1:], dtype=torch.long)         return x, y <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">data = get_openimages(n_images=6000) # 2 \u0442\u044b\u0441\u044f\u0447\u0438 \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044e, 20 \u0442\u044b\u0441\u044f\u0447 \u043d\u0430 \u043b\u0443\u0447\u0448\u0443\u044e \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u041d\u0430\u0448 \u043d\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 image_fns = ['ims\/'+d['image_id']+'.jpg' for d in data] labels = [d['caption'] for d in data] dset = PatchDataset(image_fns, labels, max_text_length=max_text_length) x, y = dset[0] x.shape, y.shape, x[-3:], y[-3:] # Y - \u044d\u0442\u043e x, \u0441\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0439 \u043d\u0430 1. <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u0440\u0440\u0440\u0440&#8230;<\/font><\/h3>\n<p>  \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 <code>max_epochs<\/code> \u0438 <code>n_images<\/code> (\u043d\u0430 \u044d\u0442\u043e\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0434\u043e 20000) \u2014 \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u0434\u043e\u043b\u044c\u0448\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0422\u0430\u043a-\u0436\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n<pre><code class=\"python\">block_size=255+max_text_length+1 # \u0427\u0442\u043e\u0431\u044b \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0434\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 mconf = GPTConfig(dset.vocab_size, block_size,                   n_layer=8, n_head=8, n_embd=512) model = GPT(mconf)  # \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 tconf = TrainerConfig(max_epochs=10, batch_size=32, learning_rate=6e-4,                       lr_decay=True, warmup_tokens=512*20, final_tokens=2*len(dset)*block_size,                       num_workers=0) # num_workers=0, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u043d\u043e\u0433\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 trainer = Trainer(model, dset, None, tconf) trainer.train() <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u041d\u0430\u043a\u043e\u043d\u0435\u0446 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438<\/font><\/h3>\n<p>  <\/p>\n<pre><code class=\"python\">prompt = 'Green cat' #@param   # \u0417\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u043e\u043c\u0442 \u0442\u0430\u043a, \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 char_idxs = [encode_char(c) for c in prompt.lower()[:max_text_length]] while len(char_idxs) &lt; max_text_length:     char_idxs += [51] char_idxs += [52] char_idxs = [c+1024 for c in char_idxs]  # \u0411\u0440\u0440\u0440\u0440... fig, axs = plt.subplots(3, 3, figsize=(12, 12)) for i in tqdm(range(9)):     x = torch.tensor([dset.stoi[s] for s in char_idxs], dtype=torch.long)[None,...].to(device)     y = sample(model, x, 256, temperature=1., sample=True, top_k=200)[0]     completion = [dset.itos[int(i)] for i in y]     ccc = completion[-256:]     ccc = [min(c, 1023) for c in ccc]     with torch.no_grad():         zs = vqgan_model.quantize.get_codebook_entry(torch.tensor(ccc).to(device), (1, 16, 16, 256))         axs[i%3, i\/\/3].imshow(vqgan_model.decode(zs).add(1).div(2).cpu().squeeze().permute(1, 2, 0).clip(0, 1)) <\/code><\/pre>\n<p>  <\/p>\n<h2><font color=\"#3AC1EF\">\u0412\u044b\u0432\u043e\u0434\u044b<\/font><\/h2>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 Open AI \u043d\u0430\u0434 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 DALL-E \u0434\u0430\u043b\u0430 \u0442\u043e\u043b\u0447\u043e\u043a \u043a \u0431\u0443\u0440\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044e Text-to-image, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043d\u0430\u043c \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c\u0438, \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u043b\u0435\u043d\u043d\u044b\u0435 \u043a \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e:<\/p>\n<p>  DALL-E 2, Midjourney, Imagen, Stable Diffusion \u0438 \u0442.\u0434.<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043e \u0432\u0441\u0435\u0445 \u0441\u0442\u043e\u0440\u043e\u043d \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u0432\u0430\u0448\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0439\u0442\u0438.<\/p>\n<p>  \u041f\u043e\u0442\u044b\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c\u043a\u0443 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/colab.research.google.com\/drive\/1d1csN9wtq-caO-D3hMCIwmgJ3iQgZnsX#scrollTo=Nf-7OACvRZDX\">\u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043b\u0430\u0431\u0435<\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/fg\/f6\/kr\/fgf6krmdixzh4pbisfod4pivx0g.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/fg\/f6\/kr\/fgf6krmdixzh4pbisfod4pivx0g.jpeg\" data-blurred=\"true\"\/><br \/>  <i><font color=\"#999999\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0437 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 RuDALL-E \u043e\u0442 \u0421\u0431\u0435\u0440\u0430<\/font><\/i><\/p>\n<blockquote><p><b><font color=\"#3AC1EF\"><a href=\"https:\/\/bit.ly\/3KZeaxv\">0x0A-0x5B=?<\/a><\/font><\/b><\/p><\/blockquote>\n<p><a href=\"http:\/\/ruvds.com\/ru-rub?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=Nikuson&amp;utm_content=kak_rabotaet_dall_e\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/sz\/7j\/pf\/sz7jpfj8i1pa6ocj-eia09dev4q.png\" data-src=\"https:\/\/habrastorage.org\/webt\/sz\/7j\/pf\/sz7jpfj8i1pa6ocj-eia09dev4q.png\"\/><\/a><\/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\/company\/ruvds\/blog\/687508\/\"> https:\/\/habr.com\/ru\/company\/ruvds\/blog\/687508\/<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/687508\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ff\/qh\/no\/ffqhnotdffvev2ewkwcekssyula.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ff\/qh\/no\/ffqhnotdffvev2ewkwcekssyula.png\"\/><\/div>\n<p><\/a><br \/>  \u0412 \u042f\u043d\u0432\u0430\u0440\u0435 2021 \u0433\u043e\u0434\u0430 Open AI \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 DALL-E, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u043b\u044e\u0431\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e, \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0435\u043c\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044f\u043c\u0438, \u043d\u043e \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043c\u0435 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0451 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Text2Image \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c DALL-E, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0445\u0430\u0440\u0434\u043a\u043e\u0440 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e DALL-E \u043f\u043e\u0447\u0442\u0438 \u0441 \u043d\u0443\u043b\u044f.  <\/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-338305","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338305","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=338305"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338305\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=338305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=338305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=338305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}