{"id":291593,"date":"2018-10-30T15:35:14","date_gmt":"2018-10-30T12:35:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291593"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291593","title":{"rendered":"\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0442\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u043e\u0442 Google \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 Colaboratory"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041d\u0435\u0434\u0430\u0432\u043d\u043e Google \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0438\u043c <a href=\"https:\/\/cloud.google.com\/tpu\/\">\u0442\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c<\/a> (tensor processing unit, TPU) \u043d\u0430 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f <a href=\"https:\/\/colab.research.google.com\">Colaboratory<\/a>. \u0422\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 (ASIC), \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f Google \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 TensorFlow. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0430 TPU \u0441\u0432\u0435\u0440\u0442\u043e\u0447\u043d\u0443\u044e \u0441\u0435\u0442\u044c \u043d\u0430 Keras, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 CIFAR-10. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/colab.research.google.com\/drive\/1FWI2XEovgVptqD7GpNx9pb6a7JQcA2cI\">\u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435<\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sl\/ut\/ho\/slutho5dsyeduk2biql9rcsblnu.jpeg\"><br \/>  <i>\u0424\u043e\u0442\u043e <a href=\"https:\/\/cloud.google.com\/tpu\/\">cloud.google.com<\/a><\/i><\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h2>\u0422\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b<\/h2>\n<p>  \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b TPU (<a href=\"https:\/\/habr.com\/post\/402955\/\">\u0437\u0434\u0435\u0441\u044c<\/a>, <a href=\"https:\/\/habr.com\/post\/350042\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438 <a href=\"https:\/\/habr.com\/company\/squadra-group\/blog\/326308\/\">\u0437\u0434\u0435\u0441\u044c<\/a>), \u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/habr.com\/post\/422317\/\">\u043f\u043e\u0447\u0435\u043c\u0443 TPU \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b TPU, \u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u043d\u0435\u0439\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439.<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c TPU \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e, \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 420 TFlops (\u0442\u0440\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443), \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 128 \u0413\u0411 \u043f\u0430\u043c\u044f\u0442\u0438 High Bandwidth Memory. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 Colaboratory \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e TPU \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 180 TFlops \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 64 \u0413\u0411 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u044f \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 TPU.<\/p>\n<p>  \u0422\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u043f\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u044f\u0434\u0440\u0430, \u0432\u0441\u0435\u0433\u043e \u0432 TPU \u0432\u043e\u0441\u0435\u043c\u044c \u044f\u0434\u0435\u0440. \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 TPU \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u0432\u0441\u0435\u0445 \u044f\u0434\u0440\u0430\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438: \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044f\u0434\u0440\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u043f\u0438\u044f \u0433\u0440\u0430\u0444\u0430 TensorFlow \u0441 \u043e\u0434\u043d\u043e\u0439 \u0432\u043e\u0441\u044c\u043c\u043e\u0439 \u043e\u0431\u044a\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u0430 \u0442\u0435\u043d\u0437\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u2014 \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e (matrix unit, MXU). \u041e\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0445\u0438\u0442\u0440\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Systolic_array\">\u0441\u0438\u0441\u0442\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432<\/a> \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 128\u0445128 \u0434\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f TPU, \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u0438\u043d\u0438-\u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0438\u043b\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043a\u0440\u0430\u0442\u043d\u0430 128 (<a href=\"https:\/\/cloud.google.com\/tpu\/docs\/tpus\">\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/a>). \u0422\u0430\u043a\u0436\u0435 \u0438\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0430\u043c\u044f\u0442\u0438 TPU \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u0438\u043d\u0438-\u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0431\u044b\u043b\u0430 \u043a\u0440\u0430\u0442\u043d\u0430 8.<\/p>\n<h2>\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 Colaboratory<\/h2>\n<p>  <a href=\"https:\/\/colab.research.google.com\">Colaboratory <\/a> \u2014 \u044d\u0442\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043e\u0442 Google \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u041d\u0430 \u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 TensorFlow, Keras, sklearn, pandas \u0438 \u0442.\u043f. \u0421\u0430\u043c\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0430 Colaboratory \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0438, \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043d\u0430 Jupyter. \u041d\u043e\u0443\u0442\u0431\u0443\u043a\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 Google Drive, \u043c\u043e\u0436\u043d\u043e \u0438\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c \u0438 \u0434\u0430\u0436\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u043e\u0443\u0442\u0431\u0443\u043a \u043d\u0430 Colaboratory (<i>\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043a\u043b\u0438\u043a\u0430\u0431\u0435\u043b\u044c\u043d\u0430<\/i>):<\/p>\n<p>  <a href=\"https:\/\/habrastorage.org\/webt\/fq\/l4\/ie\/fql4ie08wjywkhceevz--lclzio.png\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4b\/gp\/sn\/4bgpsnbpkhwyqrid6fixnaurcbw.png\"><\/a><\/p>\n<p>  \u0412\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u0434 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0432 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 Google. \u041c\u0430\u0448\u0438\u043d\u0430 \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u0430\u043c \u043d\u0430 12 \u0447\u0430\u0441\u043e\u0432, \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u0430 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0435\u0449\u0435 12 \u0447\u0430\u0441\u043e\u0432. \u0422\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u0435\u0439\u0442\u0435 \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0435\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0438\u043b\u0438 Google Drive, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Colaboratory \u0435\u0441\u0442\u044c <a href=\"https:\/\/habr.com\/post\/358146\/\">\u0437\u0434\u0435\u0441\u044c<\/a>, <a href=\"https:\/\/habr.com\/post\/348058\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438 <a href=\"https:\/\/www.asozykin.ru\/deep_learning\/2018\/04\/04\/Google-Colaboratory-for-Deep-Learning.html\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0442\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043d\u0430 Colaboratory<\/h2>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Colaboratory \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0435\u043b\u0435\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 GPU \u0438\u043b\u0438 TPU. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0432 \u043c\u0435\u043d\u044e Runtime -&gt; Change runtime type -&gt; Hardware accelerator. \u0412 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u00abTPU\u00bb:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1f\/7r\/vt\/1f7rvtfjvdowdjwrz0ctgyyly7s.png\" alt=\"image\"><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u0438\u043f\u0430 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0435\u043b\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0443\u0442\u0431\u0443\u043a Colaboratory, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d TPU. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0438 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b. \u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043d\u043e\u0432\u043e. <\/p>\n<h2>\u041d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u043d\u0430 Keras \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f CIFAR-10<\/h2>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0430 TPU \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c \u043d\u0430 Keras, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437 <a href=\"https:\/\/www.cs.toronto.edu\/~kriz\/cifar.html\">\u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 CIFAR-10<\/a>. \u042d\u0442\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 10 \u043a\u043b\u0430\u0441\u0441\u043e\u0432: \u0441\u0430\u043c\u043e\u043b\u0435\u0442, \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c, \u043f\u0442\u0438\u0446\u0430, \u043a\u043e\u0442, \u043e\u043b\u0435\u043d\u044c, \u0441\u043e\u0431\u0430\u043a\u0430, \u043b\u044f\u0433\u0443\u0448\u043a\u0430, \u043b\u043e\u0448\u0430\u0434\u044c, \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0438 \u0433\u0440\u0443\u0437\u043e\u0432\u0438\u043a. \u041a\u043b\u0430\u0441\u0441\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f, \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443.<\/p>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 CIFAR-10 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Keras:<\/p>\n<pre><code class=\"python\">(x_train, y_train), (x_test, y_test) = cifar10.load_data()<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u044f \u0437\u0430\u0432\u0435\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0432\u0430 \u0440\u0430\u0437\u0430: \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f TPU, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0443\u0447\u0430\u0442\u044c, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u043b\u044f CPU, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b.<\/p>\n<pre><code class=\"python\">def create_model():     input_layer = Input(shape=(32, 32, 3), dtype=tf.float32, name='Input')     x = BatchNormalization()(input_layer)     x = Conv2D(32, (3, 3), padding='same', activation='relu')(x)     x = Conv2D(32, (3, 3), activation='relu', padding='same')(x)     x = MaxPooling2D(pool_size=(2, 2))(x)     x = Dropout(0.25)(x)     x = BatchNormalization()(x)     x = Conv2D(64, (3, 3), padding='same', activation='relu')(x)     x = Conv2D(64, (3, 3), activation='relu')(x)     x = MaxPooling2D(pool_size=(2, 2))(x)     x = Dropout(0.25)(x)     x = Flatten()(x)     x = Dense(512, activation='relu')(x)     x = Dropout(0.5)(x)     output_layer = Dense(10, activation='softmax')(x)     model = Model(inputs=[input_layer], outputs=[output_layer])     model.compile(         optimizer=tf.train.AdamOptimizer(0.001),         loss=tf.keras.losses.sparse_categorical_crossentropy,         metrics=['sparse_categorical_accuracy'])     return model<\/code><\/pre>\n<p>  \u041f\u043e\u043a\u0430 \u043d\u0430 TPU \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u044b Keras, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 \u0438\u0437 TensorFlow.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c Keras \u0434\u043b\u044f CPU, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f TPU:<\/p>\n<pre><code class=\"python\">cpu_model = create_model()<\/code><\/pre>\n<h2>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u043d\u0430 Keras \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f TPU<\/h2>\n<p>  \u041c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 Keras \u0438 TensorFlow \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043d\u0430 GPU \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041d\u0430 TPU \u043f\u043e\u043a\u0430 \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043d\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f TPU.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043d\u0430\u043c TPU. \u041d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Colaboratory \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"python\">TPU_WORKER = 'grpc:\/\/' + os.environ['COLAB_TPU_ADDR']<\/code><\/pre>\n<p>  \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u0434\u0440\u0435\u0441 TPU \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u2014 <code>grpc:\/\/10.102.233.146:8470<\/code>. \u0410\u0434\u0440\u0435\u0441\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u043b\u0438\u0441\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f TPU \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>keras_to_tpu_model<\/code>:<\/p>\n<pre><code class=\"python\">tf.logging.set_verbosity(tf.logging.INFO) tpu_model = tf.contrib.tpu.keras_to_tpu_model(     cpu_model,     strategy=tf.contrib.tpu.TPUDistributionStrategy(         tf.contrib.cluster_resolver.TPUClusterResolver(TPU_WORKER)))<\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Info. \u0412\u043e\u0442 \u0447\u0442\u043e \u0432 \u043b\u043e\u0433\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<p>  <code>INFO:tensorflow:Querying Tensorflow master (b'grpc:\/\/10.102.233.146:8470') for TPU system metadata.<br \/>  INFO:tensorflow:Found TPU system:<br \/>  INFO:tensorflow:*** Num TPU Cores: 8<br \/>  INFO:tensorflow:*** Num TPU Workers: 1<br \/>  INFO:tensorflow:*** Num TPU Cores Per Worker: 8<br \/>  ...<br \/>  WARNING:tensorflow:tpu_model (from tensorflow.contrib.tpu.python.tpu.keras_support) is experimental and may change or be removed at any time, and without warning.<\/code><\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043d TPU \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043d\u0430\u043c\u0438 \u0440\u0430\u043d\u0435\u0435 \u0430\u0434\u0440\u0435\u0441\u0443, \u0432 \u043d\u0435\u043c 8 \u044f\u0434\u0435\u0440. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435, \u0447\u0442\u043e <code>tpu_model<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0430 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0430 \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 Keras \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430 TPU \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f. <\/p>\n<h2>\u041e\u0431\u0443\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 TPU<\/h2>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f TPU \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0434\u043b\u044f Keras \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>fit<\/code>:<\/p>\n<pre><code class=\"python\">history = tpu_model.fit(x_train, y_train,     batch_size=128*8,     epochs=50,     verbose=2)<\/code><\/pre>\n<p>  \u041a\u0430\u043a\u0438\u0435 \u0437\u0434\u0435\u0441\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041c\u044b \u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f TPU \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0438\u043d\u0438-\u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u0440\u0430\u0442\u0435\u043d 128. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044f\u0434\u0440\u0435 TPU \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0434\u043d\u043e\u0439 \u0432\u043e\u0441\u044c\u043c\u043e\u0439 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u0438\u043d\u0438-\u0432\u044b\u0431\u043e\u0440\u043a\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0438\u043d\u0438-\u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0435\u043c \u0432 128*8, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e 128 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044f\u0434\u0440\u0430 TPU. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 256 \u0438\u043b\u0438 512, \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0448\u0435.<\/p>\n<p>  \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u044d\u043f\u043e\u0445\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 6 \u0441.<\/p>\n<p>  \u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 50 \u044d\u043f\u043e\u0445\u0435:<br \/>  <code>Epoch 50\/50<br \/>   - 6s - loss: 0.2727 - sparse_categorical_accuracy: 0.9006<\/code><\/p>\n<p>  \u0414\u043e\u043b\u044f \u0432\u0435\u0440\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0430 90,06%. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f TPU:<\/p>\n<pre><code class=\"python\">scores = tpu_model.evaluate(x_test, y_test, verbose=0, batch_size=batch_size * 8) print(\"\u0414\u043e\u043b\u044f \u0432\u0435\u0440\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: %.2f%%\" % (scores[1]*100))<\/code><\/pre>\n<p>  <code>\u0414\u043e\u043b\u044f \u0432\u0435\u0440\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: 80.79%<\/code><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0432\u0435\u0441\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">tpu_model.save_weights(\"cifar10_model.h5\")<\/code><\/pre>\n<p>  TensorFlow \u0432\u044b\u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0435\u0441\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0441 TPU \u043d\u0430 CPU:<br \/>  <code>INFO:tensorflow:Copying TPU weights to the CPU<\/code><\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0435\u0441\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0434\u0438\u0441\u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b Colaboratory. \u041a\u043e\u0433\u0434\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430, \u0442\u043e \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0435\u0435 \u0441\u043e\u0442\u0440\u0443\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0442\u0435\u0440\u044f\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0441\u0430, \u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0445 \u043d\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440:<\/p>\n<pre><code class=\"python\">from google.colab import files files.download(\"cifar10_model.h5\")<\/code><\/pre>\n<h2>\u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 CPU<\/h2>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043d\u0430 TPU, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CPU. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0432 \u043d\u0435\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 TPU \u0432\u0435\u0441\u0430:<\/p>\n<pre><code class=\"python\">model = create_model() model.load_weights(\"cifar10_model.h5\")<\/code><\/pre>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0441 \u0435\u0435 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e \u0438\u0437 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 CIFAR-10:<\/p>\n<pre><code class=\"python\">index=111 plt.imshow(toimage(x_test[index])) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/za\/z3\/f-\/zaz3f-jatj-5crlgsih84gsakg0.png\"><\/p>\n<p>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u043b\u0435\u0442. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"python\"># \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 CIFAR-10 classes=['\u0441\u0430\u043c\u043e\u043b\u0435\u0442', '\u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c', '\u043f\u0442\u0438\u0446\u0430', '\u043a\u043e\u0442', '\u043e\u043b\u0435\u043d\u044c', '\u0441\u043e\u0431\u0430\u043a\u0430', '\u043b\u044f\u0433\u0443\u0448\u043a\u0430', '\u043b\u043e\u0448\u0430\u0434\u044c', '\u043a\u043e\u0440\u0430\u0431\u043b\u044c', '\u0433\u0440\u0443\u0437\u043e\u0432\u0438\u043a'] x = x_test[index] # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c, \u0442.\u043a. Keras \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 x = np.expand_dims(x, axis=0) # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 prediction = model.predict(x) # \u041f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0441\u0435\u0442\u0438 print(prediction) # \u041f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 prediction = np.argmax(prediction) print(classes[prediction])<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432, \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u043b\u0438\u0437\u043a\u0438 \u043a \u043d\u0443\u043b\u044e, \u043a\u0440\u043e\u043c\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0430\u043c\u043e\u043b\u0435\u0442\u0443. <\/p>\n<p>  <code>[[9.81738389e-01 2.91262069e-07 1.82225723e-02 9.78524668e-07<br \/>   5.89265142e-07 6.76223244e-10 1.03252004e-10 9.23009047e-09<br \/>   3.71878523e-05 3.16599618e-08]]<br \/>  \u0441\u0430\u043c\u043e\u043b\u0435\u0442<\/code><\/p>\n<p>  \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e!<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>  \u0423\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c TPU \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Colaboratory, \u0435\u0433\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u043d\u0430 Keras. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 CIFAR-10 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u0435\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 TPU. \u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 GPU \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c (\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0430\u043c\u0438 \u0432\u044b\u0431\u0440\u0430\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0435\u043b\u044f GPU \u0432\u043c\u0435\u0441\u0442\u043e TPU \u0438 \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0438\u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u0437\u0430\u043d\u043e\u0432\u043e). <\/p>\n<p>  \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 <a href=\"https:\/\/habr.com\/post\/354602\/\">\u0438\u0437\u043c\u0435\u0440\u044f\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c TPU \u0438 GPU V100 \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0441\u0435\u0442\u0438 ResNet-50<\/a>. \u041d\u0430 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 TPU \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043a\u0430\u043a \u0438 \u0447\u0435\u0442\u044b\u0440\u0435 GPU V100. \u041f\u0440\u0438\u044f\u0442\u043d\u043e, \u0447\u0442\u043e Google \u0434\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0449\u043d\u044b\u0439 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e!<\/p>\n<p>  \u0412\u0438\u0434\u0435\u043e \u0441 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 Keras \u043d\u0430 TPU.  <\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/60xbDEpA49M?rel=0&amp;showinfo=1&amp;hl=en-US\" style=\"border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;\" allowfullscreen scrolling=\"no\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/colab.research.google.com\/drive\/1FWI2XEovgVptqD7GpNx9pb6a7JQcA2cI\">\u041d\u043e\u0443\u0442\u0431\u0443\u043a Colaboratory \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 Keras \u043d\u0430 TPU<\/a>.<\/li>\n<li><a href=\"https:\/\/colab.research.google.com\/gist\/ceshine\/f196d6b030adb1ec3a8d0b50642709dc\/keras-fashion-mnist-tpu.ipynb\">\u041d\u043e\u0443\u0442\u0431\u0443\u043a Colaboratory \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 TPU \u043c\u043e\u0434\u0435\u043b\u0438 Keras \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u0435\u0436\u0434\u044b \u0438 \u043e\u0431\u0443\u0432\u0438 \u0438\u0437 Fashion MNIST<\/a>.<\/li>\n<li><a href=\"https:\/\/cloud.google.com\/tpu\/\">\u0422\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 Google<\/a>.<\/li>\n<li><a href=\"https:\/\/cloud.google.com\/tpu\/docs\/tpus\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432<\/a>.<\/li>\n<\/ol>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/428117\/\"> https:\/\/habr.com\/post\/428117\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041d\u0435\u0434\u0430\u0432\u043d\u043e Google \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0438\u043c <a href=\"https:\/\/cloud.google.com\/tpu\/\">\u0442\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c<\/a> (tensor processing unit, TPU) \u043d\u0430 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f <a href=\"https:\/\/colab.research.google.com\">Colaboratory<\/a>. \u0422\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 (ASIC), \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f Google \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 TensorFlow. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0430 TPU \u0441\u0432\u0435\u0440\u0442\u043e\u0447\u043d\u0443\u044e \u0441\u0435\u0442\u044c \u043d\u0430 Keras, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 CIFAR-10. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 <a href=\"https:\/\/colab.research.google.com\/drive\/1FWI2XEovgVptqD7GpNx9pb6a7JQcA2cI\">\u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435<\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sl\/ut\/ho\/slutho5dsyeduk2biql9rcsblnu.jpeg\"><br \/>  <i>\u0424\u043e\u0442\u043e <a href=\"https:\/\/cloud.google.com\/tpu\/\">cloud.google.com<\/a><\/i><\/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-291593","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291593","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=291593"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291593\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}