{"id":316147,"date":"2021-01-10T15:01:09","date_gmt":"2021-01-10T15:01:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=316147"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=316147","title":{"rendered":"\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u043a\u0430 \u0438 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u043d\u0430 Python"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442 \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0441 \u0438\u0445 \u0433\u043e\u0440\u043d\u044b\u043c\u0438 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044f\u043c\u0438, \u0445\u0440\u0435\u0431\u0442\u0430\u043c\u0438 \u0438 \u0434\u043e\u043b\u0438\u043d\u0430\u043c\u0438. \u042d\u0442\u0438 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u044b \u043f\u043e\u0442\u0435\u0440\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u0432\u044b\u043f\u0443\u043a\u043b\u044b\u0445 \u0438 \u0433\u043b\u0430\u0434\u043a\u0438\u0445 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043e\u0432 \u043f\u043e\u0442\u0435\u0440\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <a href=\"https:\/\/towardsdatascience.com\/animations-of-multiple-linear-regression-with-python-73010a4d7b11\">\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439<\/a> \u0438 <a href=\"https:\/\/towardsdatascience.com\/animations-of-logistic-regression-with-python-31f8c9cb420\">\u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439<\/a> \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0439. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u044b \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0438 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 <a href=\"http:\/\/yann.lecun.com\/exdb\/mnist\/\">MNIST<\/a>.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/536606\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/il\/ey\/eo\/ileyeofcgjsdc52q3jildv6alkk.jpeg\"><\/div>\n<p><\/a><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1 \u2014 \u041b\u0430\u043d\u0434\u0448\u0430\u0444\u0442 \u043f\u043e\u0442\u0435\u0440\u044c \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441 56 \u0441\u043b\u043e\u044f\u043c\u0438 (VGG-56, <a href=\"https:\/\/arxiv.org\/abs\/1712.09913\">\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/a>)<\/i><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<hr>\n<p>  \u041d\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u044b\u0445 \u043f\u043e\u0442\u0435\u0440\u044c. \u041b\u0430\u043d\u0434\u0448\u0430\u0444\u0442 \u043f\u043e\u0442\u0435\u0440\u044c \u2014 \u044d\u0442\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0435\u0440\u0451\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043d\u0430\u0448\u0438\u0445 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430\u0448\u0435\u0439 \u0446\u0435\u043b\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0442\u0440\u0430\u0442 \u0432 \u0442\u0440\u0451\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u0445, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0432\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u0430\u0440\u044c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0430\u0448\u0438\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c\u0438. \u0421\u0442\u043e\u0438\u0442, \u043e\u0434\u043d\u0430\u043a\u043e, \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043e\u0432 \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0432 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0441 \u043d\u0438\u0437\u043a\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c\u044e. \u0422\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 VGG \u0441 56 \u0441\u043b\u043e\u044f\u043c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 1. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  \u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f (\u0441 784 \u0443\u0437\u043b\u0430\u043c\u0438), \u0434\u0432\u0443\u0445 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u043b\u043e\u0451\u0432 (\u0441 50 \u0438 500 \u0443\u0437\u043b\u0430\u043c\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e) \u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f (\u0441 10 \u0443\u0437\u043b\u0430\u043c\u0438). \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0433\u043c\u043e\u0432\u0438\u0434\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438. \u041d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u0430 \u043f\u0440\u0435\u0434\u0432\u0437\u044f\u0442\u043e\u0441\u0442\u0438. \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 28&#215;28 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439, \u0440\u0443\u043a\u043e\u043f\u0438\u0441\u043d\u044b\u0445 \u0446\u0438\u0444\u0440 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442 0 \u0434\u043e 9 \u0438\u0437 <a href=\"http:\/\/yann.lecun.com\/exdb\/mnist\/\">\u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 MNIST<\/a>. \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 784*50+50*500+500*10=69,200 \u0432\u0435\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u042f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u0430 w<i>250, 5 (2) \u0438 w<\/i>251,5(2), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442 250-\u0439 \u0438 251-\u0439 \u0443\u0437\u043b\u044b \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u0441 6-\u043c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0412 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 6-\u0439 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0446\u0438\u0444\u0440\u044b \u00ab5\u00bb \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438. \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 2 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0418\u0437 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u044f\u0441\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0439\u0440\u043e\u043d\u0430\u043c\u0438 \u2014 \u0438 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u0435\u0441\u043e\u0432\u044b\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u2014 \u0431\u044b\u043b\u0438 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u043e\u043f\u0443\u0449\u0435\u043d\u044b.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ka\/ay\/ud\/kaayuda96lxsrbmiiwas7cb7wa8.png\"><\/div>\n<p>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2 \u2014 \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438<\/i><\/p>\n<p>  \u041c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c MNIST \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python. \u0420\u0443\u043a\u043e\u043f\u0438\u0441\u043d\u044b\u0435 \u0446\u0438\u0444\u0440\u044b \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 MNIST \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432 \u043e\u0442\u0442\u0435\u043d\u043a\u0430\u0445 \u0441\u0435\u0440\u043e\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0443\u0442\u0451\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u0438\u0437 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 0-255 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d 0-1,2 \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u044b \u0434\u0435\u043b\u0438\u043c x-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 255.<\/p>\n<pre><code class=\"python\"># Import libraries import numpy as np import gzip from sklearn.preprocessing import OneHotEncoder import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy.special import expit import celluloid from celluloid import Camera from matplotlib import animation   # Open MNIST-files:  def open_images(filename):     with gzip.open(filename, &quot;rb&quot;) as file:              data=file.read()         return np.frombuffer(data,dtype=np.uint8, offset=16).reshape(-1,28,28).astype(np.float32)   def open_labels(filename):     with gzip.open(filename,&quot;rb&quot;) as file:         data = file.read()         return np.frombuffer(data,dtype=np.uint8, offset=8).astype(np.float32)       X_train=open_images(&quot;C:\\\\Users\\\\tobia\\\\train-images-idx3-ubyte.gz&quot;).reshape(-1,784).astype(np.float32)  X_train=X_train\/255 # rescale pixel values to 0-1  y_train=open_labels(&quot;C:\\\\Users\\\\tobia\\\\train-labels-idx1-ubyte.gz&quot;) oh=OneHotEncoder(categories='auto')  y_train_oh=oh.fit_transform(y_train.reshape(-1,1)).toarray() # one-hot-encoding of y-values<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u044b \u043f\u043e\u0442\u0435\u0440\u044c, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u043c \u0432\u0435\u0441\u0430\u043c w_250, 5(2) \u0438 w_251,5(2). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0432\u0435\u0441\u0430\u043c w_a \u0438 w_b. \u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 J \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b \u0443\u0441\u0440\u0435\u0434\u043d\u0451\u043d\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u043c \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 10 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c N:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ox\/fd\/ko\/oxfdkoge6szerl8oqxafeapuqgc.png\"><\/div>\n<p>  \u0421 y \u0438 pred, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<i> y<\/i> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0443\u0442\u0451\u043c \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0441\u043b\u043e\u0439. \u0412\u044b\u0432\u043e\u0434 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043b\u043e\u044f. \u0412\u0445\u043e\u0434\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0435\u0441\u043e\u0432\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043b\u043e\u044f. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f. \u0412\u0435\u0441\u043e\u0432\u044b\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043c\u0430\u043b\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<a href=\"https:\/\/docs.scipy.org\/doc\/numpy-1.15.1\/reference\/generated\/numpy.random.randn.html\"> \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0441\u0435\u0432\u0434\u043e\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b numpy<\/a>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/docs.scipy.org\/doc\/numpy-1.15.0\/reference\/generated\/numpy.random.seed.html\">seed<\/a>\u00a0 \u043c\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0430 \u0432\u0435\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>w_a<\/i> \u0438 <i>w_b<\/i>. \u041c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 Python \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">hidden_0=50 # number of nodes of first hidden layer hidden_1=500 # number of nodes of second hidden layer  # Set up cost function: def costs(x,y,w_a,w_b,seed_):           np.random.seed(seed_) # insert random seed          w0=np.random.randn(hidden_0,784)  # weight matrix of 1st hidden layer         w1=np.random.randn(hidden_1,hidden_0) # weight matrix of 2nd hidden layer         w2=np.random.randn(10,hidden_1) # weight matrix of output layer         w2[5][250] = w_a # set value for weight w_250,5(2)         w2[5][251] = w_b # set value for weight w_251,5(2)         a0 = expit(w0 @ x.T)  # output of 1st hidden layer         a1=expit(w1 @ a0)  # output of 2nd hidden layer         pred= expit(w2 @ a1) # output of final layer         return np.mean(np.sum((y-pred)**2,axis=0)) # costs w.r.t. w_a and w_b<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0432\u0435\u0441\u043e\u0432 \u0438 \u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0435\u0442\u043a\u0443, \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u0435\u0441\u0430 \u0434\u043b\u044f w_a \u0438 w_b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u044b w_a \u0438 w_b \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0435\u0442\u043a\u0435 \u043c\u044b \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u044b \u043f\u043e\u0442\u0435\u0440\u044c:<\/p>\n<pre><code class=\"python\"># Set range of values for meshgrid:  m1s = np.linspace(-15, 17, 40)    m2s = np.linspace(-15, 18, 40)   M1, M2 = np.meshgrid(m1s, m2s) # create meshgrid   # Determine costs for each coordinate in meshgrid:  zs_100 = np.array([costs(X_train[0:100],y_train_oh[0:100].T                                  ,np.array([[mp1]]), np.array([[mp2]]),135)                          for mp1, mp2 in zip(np.ravel(M1), np.ravel(M2))]) Z_100 = zs_100.reshape(M1.shape) # z-values for N=100  zs_10000 = np.array([costs(X_train[0:10000],y_train_oh[0:10000].T                                  ,np.array([[mp1]]), np.array([[mp2]]),135)                          for mp1, mp2 in zip(np.ravel(M1), np.ravel(M2))]) Z_10000 = zs_10000.reshape(M1.shape) # z-values for N=10,000   # Plot loss landscapes:  fig = plt.figure(figsize=(10,7.5)) # create figure ax0 = fig.add_subplot(121, projection='3d' ) ax1 = fig.add_subplot(122, projection='3d' )  fontsize_=20 # set axis label fontsize labelsize_=12 # set tick label size  # Customize subplots:  ax0.view_init(elev=30, azim=-20) ax0.set_xlabel(r'$w_a$', fontsize=fontsize_, labelpad=9) ax0.set_ylabel(r'$w_b$', fontsize=fontsize_, labelpad=-5) ax0.set_zlabel(&quot;costs&quot;, fontsize=fontsize_, labelpad=-30) ax0.tick_params(axis='x', pad=5, which='major', labelsize=labelsize_) ax0.tick_params(axis='y', pad=-5, which='major', labelsize=labelsize_) ax0.tick_params(axis='z', pad=5, which='major', labelsize=labelsize_) ax0.set_title('N:100',y=0.85,fontsize=15) # set title of subplot   ax1.view_init(elev=30, azim=-30) ax1.set_xlabel(r'$w_a$', fontsize=fontsize_, labelpad=9) ax1.set_ylabel(r'$w_b$', fontsize=fontsize_, labelpad=-5) ax1.set_zlabel(&quot;costs&quot;, fontsize=fontsize_, labelpad=-30) ax1.tick_params(axis='y', pad=-5, which='major', labelsize=labelsize_) ax1.tick_params(axis='x', pad=5, which='major', labelsize=labelsize_) ax1.tick_params(axis='z', pad=5, which='major', labelsize=labelsize_) ax1.set_title('N:10,000',y=0.85,fontsize=15)  # Surface plots of costs (= loss landscapes):   ax0.plot_surface(M1, M2, Z_100, cmap='terrain', #surface plot                              antialiased=True,cstride=1,rstride=1, alpha=0.75) ax1.plot_surface(M1, M2, Z_10000, cmap='terrain', #surface plot                              antialiased=True,cstride=1,rstride=1, alpha=0.75) plt.tight_layout() plt.show()<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ez\/mm\/v1\/ezmmv1c5gzpk4u_pjecb2y00nww.png\"><\/div>\n<p>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3 \u2014 \u041b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432<\/i><\/p>\n<p>  \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 3 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0434\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0445 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u044c \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0432\u0435\u0441\u0430\u043c\u0438 (w_250, 5 (2) \u0438 w_251,5(2)) \u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u0435\u0441\u0430\u043c\u0438. \u041b\u0435\u0432\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0432\u044b\u0445 100 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 MNIST, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0441\u043f\u0440\u0430\u0432\u0430 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0432\u044b\u0445 10 000 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0438\u043c\u0441\u044f \u043a \u043b\u0435\u0432\u043e\u043c\u0443 \u0433\u0440\u0430\u0444\u0438\u043a\u0443, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u0447\u0435\u0440\u0442\u044b \u043d\u0435\u0432\u044b\u043f\u0443\u043a\u043b\u044b\u0445 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043e\u0432 \u043f\u043e\u0442\u0435\u0440\u044c: \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u044b, \u043f\u043b\u0430\u0442\u043e, \u0445\u0440\u0435\u0431\u0442\u044b (\u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u00ab\u0441\u0435\u0434\u043b\u043e\u0432\u044b\u043c\u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438\u00bb) \u0438 \u00ab\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439\u00bb \u043c\u0438\u043d\u0438\u043c\u0443\u043c. \u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u0440\u043c\u0438\u043d \u00ab\u043c\u0438\u043d\u0438\u043c\u0443\u043c\u00bb \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u043c \u043d\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u0442\u0435\u0441\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bv\/fc\/ux\/bvfcuxags85vhvwod9zg72fapok.png\"><\/div>\n<p>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4<\/i><\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u0443\u0441\u043a<\/h2>\n<p><\/font><br \/>  \u042d\u0442\u0438 \u00ab\u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u0430\u0440\u044c\u0435\u0440\u044b\u00bb \u0440\u0435\u0437\u043a\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u0441\u0442\u0438\u0440\u0443\u044e\u0442 \u0441 \u0433\u043b\u0430\u0434\u043a\u0438\u043c\u0438 \u0438 \u0432\u044b\u043f\u0443\u043a\u043b\u044b\u043c\u0438 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u0430\u043c\u0438 \u043f\u043e\u0442\u0435\u0440\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0438 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f\u0445. \u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u0438 \u00ab\u0431\u0430\u0440\u044c\u0435\u0440\u044b\u00bb \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u044e\u0442 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430 \u0438 \u0434\u0430\u0436\u0435 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u044d\u0442\u043e\u043c\u0443, \u0430 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 [3]. \u0414\u043b\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044f \u0440\u0435\u0448\u0438\u043b \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u0443\u0441\u043a \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043e\u043c \u043f\u043e\u0442\u0435\u0440\u044c \u0438 \u0442\u0440\u0435\u043c\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b\u043c\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438. \u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u0443\u0441\u043a \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0435\u0441\u043e\u0432) \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uz\/zl\/ef\/uzzlef2rfbwmdisj9uk3cwfjlb0.png\"><\/div>\n<p>  \u0433\u0434\u0435 \u2207J \u2014 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438, w \u2014 \u0432\u0435\u0441 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, e \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u044d\u043f\u043e\u0445\u0430 \u0438 \u03b1 \u2014 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0431\u0430 \u0432\u0435\u0441\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u0432\u0435\u0441\u043e\u0432 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u043e\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8i\/fs\/am\/8ifsamp5ujwenndkq_llwvkx6v4.png\"><\/div>\n<p>  \u0433\u0434\u0435 w\u1d62\u2c7c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0432\u0435\u0441 \u043c\u0435\u0436\u0434\u0443 j-\u043c \u0443\u0437\u043b\u043e\u043c \u0441\u043b\u043e\u044f \u0434\u043e \u0438 i-\u043c \u0443\u0437\u043b\u043e\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043b\u043e\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u0412\u0445\u043e\u0434 i-\u0433\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u0430 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a in\u1d62 (\u00b2) \u0438 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u0443\u043c\u043c\u0435 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0439 \u0441\u043b\u043e\u044f \u0434\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432\u0435\u0441\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u043a \u044d\u0442\u043e\u043c\u0443 \u0443\u0437\u043b\u0443. \u0412\u044b\u0445\u043e\u0434 * i*-\u0433\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u0430 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a out\u1d62 (\u00b2) \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u03c3(in\u1d62 (\u00b2)). \u0420\u0435\u0448\u0430\u044f \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0448\u0435, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ba\/ki\/x1\/bakix1zdfc7iue18fogkk1hpdbu.png\"><\/div>\n<p>  \u0441 * out\u2c7c (\u00b9), \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 j-\u0433\u043e \u0443\u0437\u043b\u0430 \u0432 \u0441\u043b\u043e\u0435, \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0435 \u0447\u0435\u0440\u0435\u0437 w\u1d62\u2c7c. \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d \u0441 n-\u043c \u0443\u0437\u043b\u043e\u043c. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>target\u1d62<\/i> \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 10 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432. \u0421\u0441\u044b\u043b\u0430\u044f\u0441\u044c \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043e\u043a 2, out\u2c7c (\u00b9) \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 h\u2082\u2085\u2080 \u0438\u043b\u0438 h\u2082\u2085\u2081, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u0432\u0435\u0441\u0430, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043d\u0430\u043c\u0435\u0440\u0435\u0432\u0430\u0435\u043c\u0441\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u043d\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0443\u044e. \u041e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0432\u043e\u0434, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/mattmazur.com\/2015\/03\/17\/a-step-by-step-backpropagation-example\/\">\u0437\u0434\u0435\u0441\u044c<\/a> [4].<\/p>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u044b\u0432\u043e\u0434 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0443 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043a\u043e\u0434\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u043e\u0439 &#8216;PRE&#8217;. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0442\u0440\u043e\u0433\u0430\u044f \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0443\u0437\u043b\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0435 \u0432 \u043a\u043e\u0434\u0435, \u043c\u044b \u0441\u0442\u0440\u0435\u043c\u0438\u043c\u0441\u044f \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0441\u043e\u0432\u044b\u0445 \u043c\u0430\u0442\u0440\u0438\u0446 \u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0440\u0438\u0446 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u0435\u0441\u043e\u0432 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0435 \u0441\u0440\u0430\u0437\u0443. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0432\u0435\u0441\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435. \u041d\u0430 Python \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0432\u0435\u0441\u043e\u0432 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\"># Store values of costs and weights in lists:  weights_2_5_250=[]  weights_2_5_251=[]  costs=[]   seed_= 135 # random seed N=100 # sample size   # Set up neural network:  class NeuralNetwork(object):     def __init__(self, lr=0.01):         self.lr=lr         np.random.seed(seed_) # set random seed         # Intialize weight matrices:          self.w0=np.random.randn(hidden_0,784)           self.w1=np.random.randn(hidden_1,hidden_0)         self.w2=np.random.randn(10,hidden_1)         self.w2[5][250] = start_a # set starting value for w_a         self.w2[5][251] = start_b # set starting value for w_b          def train(self, X,y):         a0 = expit(self.w0 @ X.T)           a1=expit(self.w1 @ a0)           pred= expit(self.w2 @ a1)         # Partial derivatives of costs w.r.t. the weights of the output layer:          dw2= (pred - y.T)*pred*(1-pred)  @ a1.T \/ len(X)   # ... averaged over the sample size         # Update weights:          self.w2[5][250]=self.w2[5][250] - self.lr * dw2[5][250]          self.w2[5][251]=self.w2[5][251] - self.lr * dw2[5][251]          costs.append(self.cost(pred,y)) # append cost values to list          def cost(self, pred, y):         return np.mean(np.sum((y.T-pred)**2,axis=0))      # Initial values of w_a\/w_b:  starting_points = [  (-9,15),(-10.1,15),(-11,15)]   for j in starting_points:     start_a,start_b=j     model=NeuralNetwork(10) # set learning rate to 10     for i in range(10000):  # 10,000 epochs                     model.train(X_train[0:N], y_train_oh[0:N])          weights_2_5_250.append(model.w2[5][250]) # append weight values to list         weights_2_5_251.append(model.w2[5][251]) # append weight values to list  # Create sublists of costs and weight values for each starting point:  costs = np.split(np.array(costs),3)  weights_2_5_250 = np.split(np.array(weights_2_5_250),3) weights_2_5_251 = np.split(np.array(weights_2_5_251),3)<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0430 \u0438\u0437 \u0442\u044b\u0441\u044f\u0447 \u0432\u0435\u0441\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445\u0441\u044f \u0432 \u043c\u043e\u0434\u0435\u043b\u0438, \u0442\u043e \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043d\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u03b1=10. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0435\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c, \u0442\u0430\u043a\u0436\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043b\u0438\u0448\u044c \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u043e\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u0435\u0441\u0430 \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0438 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u043a\u0430 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0442\u0440\u0451\u043c \u0440\u0430\u0437\u043d\u044b\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c:<\/p>\n<pre><code class=\"python\">fig = plt.figure(figsize=(10,10)) # create figure ax = fig.add_subplot(111,projection='3d' )  line_style=[&quot;dashed&quot;, &quot;dashdot&quot;, &quot;dotted&quot;] #linestyles fontsize_=27 # set axis label fontsize labelsize_=17 # set tick label fontsize ax.view_init(elev=30, azim=-10) ax.set_xlabel(r'$w_a$', fontsize=fontsize_, labelpad=17) ax.set_ylabel(r'$w_b$', fontsize=fontsize_, labelpad=5) ax.set_zlabel(&quot;costs&quot;, fontsize=fontsize_, labelpad=-35) ax.tick_params(axis='x', pad=12, which='major', labelsize=labelsize_) ax.tick_params(axis='y', pad=0, which='major', labelsize=labelsize_) ax.tick_params(axis='z', pad=8, which='major', labelsize=labelsize_) ax.set_zlim(4.75,4.802) # set range for z-values in the plot  # Define which epochs to plot: p1=list(np.arange(0,200,20)) p2=list(np.arange(200,9000,100)) points_=p1+p2  camera=Camera(fig) # create Camera object for i in points_:     # Plot the three trajectories of gradient descent...     #... each starting from its respective starting point     #... and each with a unique linestyle:     for j in range(3):          ax.plot(weights_2_5_250[j][0:i],weights_2_5_251[j][0:i],costs[j][0:i],                 linestyle=line_style[j],linewidth=2,                 color=&quot;black&quot;, label=str(i))         ax.scatter(weights_2_5_250[j][i],weights_2_5_251[j][i],costs[j][i],                    marker='o', s=15**2,                color=&quot;black&quot;, alpha=1.0)     # Surface plot (= loss landscape):     ax.plot_surface(M1, M2, Z_100, cmap='terrain',                               antialiased=True,cstride=1,rstride=1, alpha=0.75)     ax.legend([f'epochs: {i}'], loc=(0.25, 0.8),fontsize=17) # set position of legend     plt.tight_layout()      camera.snap() # take snapshot after each iteration      animation = camera.animate(interval = 5, # set delay between frames in milliseconds                           repeat = False,                           repeat_delay = 0) animation.save('gd_1.gif', writer = 'imagemagick', dpi=100)  # save animation   <\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_w\/ed\/ot\/_wedotvnx96f4em9iidyw2qr7n0.gif\"><\/div>\n<p>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5 \u2014 \u0422\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u043a\u0430<\/i><\/p>\n<p>  \u041a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u043d\u0435\u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043e\u0432 \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043d\u0430\u043c\u0438 \u0432\u0435\u0441\u043e\u0432 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u044c. \u042d\u0442\u043e \u0438\u0434\u0451\u0442 \u0440\u0443\u043a\u0430 \u043e\u0431 \u0440\u0443\u043a\u0443 \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044d\u043f\u043e\u0445 \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u041a\u043e\u043d\u0442\u0443\u0440\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0443:<\/p>\n<pre><code class=\"python\">fig = plt.figure(figsize=(10,10)) # create figure ax0=fig.add_subplot(2, 1, 1)  ax1=fig.add_subplot(2, 1, 2)   # Customize subplots:  ax0.set_xlabel(r'$w_a$', fontsize=25, labelpad=0) ax0.set_ylabel(r'$w_b$', fontsize=25, labelpad=-20) ax0.tick_params(axis='both', which='major', labelsize=17) ax1.set_xlabel(&quot;epochs&quot;, fontsize=22, labelpad=5) ax1.set_ylabel(&quot;costs&quot;, fontsize=25, labelpad=7) ax1.tick_params(axis='both', which='major', labelsize=17)  contours_=21 # set the number of contour lines points_=np.arange(0,9000,100) # define which epochs to plot  camera = Camera(fig) # create Camera object for i in points_:     cf=ax0.contour(M1, M2, Z_100,contours_, colors='black', # contour plot                      linestyles='dashed', linewidths=1)     ax0.contourf(M1, M2, Z_100, alpha=0.85,cmap='terrain') # filled contour plots           for j in range(3):         ax0.scatter(weights_2_5_250[j][i],weights_2_5_251[j][i],marker='o', s=13**2,                color=&quot;black&quot;, alpha=1.0)         ax0.plot(weights_2_5_250[j][0:i],weights_2_5_251[j][0:i],                 linestyle=line_style[j],linewidth=2,                 color=&quot;black&quot;, label=str(i))                  ax1.plot(costs[j][0:i], color=&quot;black&quot;, linestyle=line_style[j])     plt.tight_layout()     camera.snap()      animation = camera.animate(interval = 5,                           repeat = True, repeat_delay = 0)  # create animation  animation.save('gd_2.gif', writer = 'imagemagick')  # save animation as gif<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hs\/tp\/1f\/hstp1ftdftfz9th_04flzx1hrlw.gif\"><\/div>\n<p>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 6 \u2014 \u0422\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u043a\u0430 \u0432 2D<\/i><\/p>\n<p>  \u041e\u0431\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u0443\u0441\u043a \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0441\u0442\u0440\u0435\u0432\u0430\u0442\u044c \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430\u0445, \u0441\u0435\u0434\u043b\u043e\u0432\u044b\u0445 \u0442\u043e\u0447\u043a\u0430\u0445 \u0438\u043b\u0438 \u043f\u043b\u0430\u0442\u043e \u0441 \u043d\u0435\u0432\u044b\u043f\u0443\u043a\u043b\u044b\u043c\u0438 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u0430\u043c\u0438 \u043f\u043e\u0442\u0435\u0440\u044c. \u0414\u043b\u044f \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0439 \u0431\u044b\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u043a\u0430 (ADAGRAD, Adam \u0438 \u0434\u0440.)\u2075. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u044b \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0432\u044b\u043f\u0443\u043a\u043b\u044b\u0435 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f w_<i>a \u0438 w_<\/i>b. \u0412\u044b\u043f\u0443\u043a\u043b\u043e\u0441\u0442\u044c \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442, \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u043b\u043e\u0435\u0432, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435\u0432\u044b\u043f\u0443\u043a\u043b\u044b\u043c \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u0430\u043c \u043f\u043e\u0442\u0435\u0440\u044c\u00b9.<\/p>\n<p>  \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043e\u0432 \u043f\u043e\u0442\u0435\u0440\u044c, \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0432\u0435\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043a\u0440\u044b\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 (<a href=\"https:\/\/gist.github.com\/b9d82ebfeaa580e4e12886902b5ac30d.git\">\u043a\u043e\u0434<\/a>). \u0420\u0435\u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043e\u0432 \u043f\u043e\u0442\u0435\u0440\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0438\u0436\u0435. \u0420\u0430\u0437\u043c\u0435\u0440 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0432\u0435\u0441\u043e\u0432, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 <i>w_a<\/i> \u0438 <i>w_b<\/i>, \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/93c\/a56\/802\/93ca5680259d0b5219e4268b529e3833.gif\"><\/div>\n<p>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 7 \u2014 N=500, w200\u201330(1), w200\u201331(1) (\u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c, <a href=\"https:\/\/gist.github.com\/dbc60bb7c6ef0b8ae3f8ceab8c334b57.git\">\u043a\u043e\u0434<\/a>)<\/i><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ecb\/640\/cf9\/ecb640cf922d8a9a364664752e50e807.gif\"><\/div>\n<p>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8 \u2014 N=1000, w5\u20135(1), w5\u20136(1) (\u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c, <a href=\"https:\/\/gist.github.com\/4f87869ae3e94eb6331fb9e213e9f343.git\">\u043a\u043e\u0434<\/a>)<\/i><\/p>\n<p>  \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043b\u0435\u0436\u0430\u0449\u0435\u0439 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u043e\u0432, \u043f\u043b\u0430\u0442\u043e \u0438\u043b\u0438 \u0445\u0440\u0435\u0431\u0442\u043e\u0432 \u0432\u0441\u0451 \u0435\u0449\u0451 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u044b \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0442, \u0447\u0442\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u044b \u043e\u0447\u0435\u043d\u044c \u0440\u0435\u0434\u043a\u0438 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u0445 \u0438 \u0447\u0442\u043e \u0441\u0435\u0434\u043b\u043e\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u043c\u0438, \u0447\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u044b \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0414\u0440\u0443\u0433\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u044b \u0434\u0430\u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442, \u0447\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0442\u0440\u0430\u0442, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430\u043c\u0438, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 [7].<\/p>\n<p>  \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c! \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 Jupyter Notebook \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u043c\u043e\u0451\u043c <a href=\"https:\/\/github.com\/BundleOfKent\/GradientDescentAnimation_NeuralNetwork\">GitHub<\/a>. <\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p><\/font>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/la\/vx\/xc\/lavxxccpdbzkcpqg7oqwg-4ovne.gif\"><\/div>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u0441\u044b\u043b\u043a\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\"><a href=\"http:\/\/yann.lecun.com\/exdb\/mnist\/\">\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 MNIST<\/a><\/p>\n<ol>\n<li>Li, Hao, et al. \u00abVisualizing the loss landscape of neural nets.\u00bb <i>Advances in neural information processing systems<\/i>. 2018.  <\/li>\n<li><a href=\"https:\/\/machinelearningmastery.com\/how-to-normalize-center-and-standardize-images-with-the-imagedatagenerator-in-keras\/\">\u041a\u0430\u043a \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0438\u043a\u0441\u0435\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 Keras<\/a>  <\/li>\n<li><a href=\"https:\/\/machinelearningmastery.com\/why-training-a-neural-network-is-hard\/\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c<\/a>  <\/li>\n<li><a href=\"https:\/\/mattmazur.com\/2015\/03\/17\/a-step-by-step-backpropagation-example\/\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438<\/a>  <\/li>\n<li>Staib, Matthew &amp; J. Reddi, Sashank &amp; Kale, Satyen &amp; Kumar, Sanjiv &amp; Sra, Suvrit. (2019). Escaping Saddle Points with Adaptive Gradient Methods.  <\/li>\n<li>Dauphin, Yann et al. \u00abIdentifying and attacking the saddle point problem in high-dimensional non-convex optimization.\u00bb <i>NIPS<\/i> (2014).  <\/li>\n<li>Choromanska, A., Henaff, M., Mathieu, M., Arous, G. B., &amp; LeCun, Y. (2015). The loss surfaces of multilayer networks. <i>Journal of Machine Learning Research<\/i>, <i>38<\/i>, 192\u2013204.  <\/li>\n<\/ol>\n<\/div><\/div>\n<p>  <a href=\"https:\/\/skillfactory.ru\/?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_banner&amp;utm_term=regular&amp;utm_content=habr_banner\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fe\/0r\/ha\/fe0rha1pi6e0jqdg3z3ztyrfhsm.png\" alt=\"image\"><\/div>\n<p><\/a><\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/dstpro?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DSPR&amp;utm_term=regular&amp;utm_content=100121\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 Data Science<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/dataanalystpro?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DAPR&amp;utm_term=regular&amp;utm_content=100121\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 Data Analyst<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u0443\u0440\u0441\u044b<\/b>                         <\/p>\n<div class=\"spoiler_text\"><strong>\u041f\u0420\u041e\u0424\u0415\u0421\u0421\u0418\u0418<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/java?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_JAVA&amp;utm_term=regular&amp;utm_content=100121\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/frontend?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_FR&amp;utm_term=regular&amp;utm_content=100121\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_WEBDEV&amp;utm_term=regular&amp;utm_content=100121\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/cybersecurity?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_HACKER&amp;utm_term=regular&amp;utm_content=100121\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u042d\u0442\u0438\u0447\u043d\u044b\u0439 \u0445\u0430\u043a\u0435\u0440<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/cplus?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_CPLUS&amp;utm_term=regular&amp;utm_content=100121\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/game-dev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_GAMEDEV&amp;utm_term=regular&amp;utm_content=100121\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430 Unity<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/iosdev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_IOSDEV&amp;utm_term=regular&amp;utm_content=100121\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043d\u0443\u043b\u044f<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/android?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ANDR&amp;utm_term=regular&amp;utm_content=100121\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043d\u0443\u043b\u044f<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<hr>\n<p>  <strong>\u041a\u0423\u0420\u0421\u042b<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/ml-programma-machine-learning-online?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ML&amp;utm_term=regular&amp;utm_content=100121\">\u041a\u0443\u0440\u0441 \u043f\u043e Machine Learning<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/ml-and-dl?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MLDL&amp;utm_term=regular&amp;utm_content=100121\">\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u043a\u0443\u0440\u0441 \u00abMachine Learning Pro + Deep Learning\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_PWS&amp;utm_term=regular&amp;utm_content=100121\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/javascript?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_FJS&amp;utm_term=regular&amp;utm_content=100121\">\u041a\u0443\u0440\u0441 \u043f\u043e JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/math_and_ml?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MATML&amp;utm_term=regular&amp;utm_content=100121\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438 Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/analytics?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_SDA&amp;utm_term=regular&amp;utm_content=100121\">\u041a\u0443\u0440\u0441 \u043f\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/devops?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DEVOPS&amp;utm_term=regular&amp;utm_content=100121\">\u041a\u0443\u0440\u0441 \u043f\u043e DevOps<\/a><\/li>\n<\/ul>\n<p>  <\/div>\n<\/p><\/div>\n<\/div>\n<p> \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\/skillfactory\/blog\/536606\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/536606\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442 \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0441 \u0438\u0445 \u0433\u043e\u0440\u043d\u044b\u043c\u0438 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044f\u043c\u0438, \u0445\u0440\u0435\u0431\u0442\u0430\u043c\u0438 \u0438 \u0434\u043e\u043b\u0438\u043d\u0430\u043c\u0438. \u042d\u0442\u0438 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u044b \u043f\u043e\u0442\u0435\u0440\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u0432\u044b\u043f\u0443\u043a\u043b\u044b\u0445 \u0438 \u0433\u043b\u0430\u0434\u043a\u0438\u0445 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043e\u0432 \u043f\u043e\u0442\u0435\u0440\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <a href=\"https:\/\/towardsdatascience.com\/animations-of-multiple-linear-regression-with-python-73010a4d7b11\">\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439<\/a> \u0438 <a href=\"https:\/\/towardsdatascience.com\/animations-of-logistic-regression-with-python-31f8c9cb420\">\u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439<\/a> \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0439. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u044b \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0438 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 <a href=\"http:\/\/yann.lecun.com\/exdb\/mnist\/\">MNIST<\/a>.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/536606\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/il\/ey\/eo\/ileyeofcgjsdc52q3jildv6alkk.jpeg\"><\/div>\n<p><\/a><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1 \u2014 \u041b\u0430\u043d\u0434\u0448\u0430\u0444\u0442 \u043f\u043e\u0442\u0435\u0440\u044c \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441 56 \u0441\u043b\u043e\u044f\u043c\u0438 (VGG-56, <a href=\"https:\/\/arxiv.org\/abs\/1712.09913\">\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/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-316147","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316147","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=316147"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316147\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}