{"id":291609,"date":"2018-10-30T21:20:02","date_gmt":"2018-10-30T18:20:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291609"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291609","title":{"rendered":"\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u0421 \u0446\u0435\u043b\u044c\u044e \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438, \u0440\u0435\u0448\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"vstuplenie\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041f\u0443\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f f:[x0,x1]-&gt;R<\/p>\n<p>  <\/p>\n<p>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e f \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 <\/p>\n<p>  <\/p>\n<ul>\n<li>P(x) = SUM W[i]*E(x,M[i])<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 <\/p>\n<p>  <\/p>\n<ul>\n<li>i = 1..n<\/li>\n<li>M[i] \u0438\u0437 R<\/li>\n<li>W[i] \u0438\u0437 R<\/li>\n<li>E(x,M) = { 0, \u043f\u0440\u0438 x&lt;M; 1\/2, \u043f\u0440\u0438 x=M; 1, \u043f\u0440\u0438 x&gt;M<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 M[i] \u043d\u0430 \u043e\u0442\u0440\u0435\u0437\u043a\u0435 (x0,x1) \u043d\u0430\u0439\u0434\u0443\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b W[i], \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 P(x) \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0430\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e f(x). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 M[i], \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0442\u0440\u0435\u0437\u043a\u0435 (x0,x1) \u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d W[i] \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u044b P(x).<\/p>\n<p>  <\/p>\n<h2 id=\"a-vot-i-neyroset\">\u0410 \u0432\u043e\u0442 \u0438 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 P(x) = SUM W[i]*E(x,M[i]) \u043a \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0441 \u043e\u0434\u043d\u0438\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u043c, \u043e\u0434\u043d\u0438\u043c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u043c \u0438 n \u043d\u0435\u0439\u0440\u043e\u043d\u0430\u043c\u0438 \u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u044f<\/p>\n<p>  <\/p>\n<ul>\n<li>P(x) = SUM W[i]*S(K[i]+B[i]) + C<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0433\u0434\u0435<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f x \u2014 &#171;\u0432\u0445\u043e\u0434\u043d\u043e\u0439&#187; \u0441\u043b\u043e\u0439, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u0430<\/li>\n<li>{K, B} \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b &#171;\u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e&#187; \u0441\u043b\u043e\u044f, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0438\u0437 n \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u2014 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0430<\/li>\n<li>{W, C} \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b &#171;\u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e&#187; \u0441\u043b\u043e\u044f, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0441\u0432\u043e\u0438\u0445 \u0432\u0445\u043e\u0434\u043e\u0432.<\/li>\n<li>S \u2014 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0430,<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u043f\u0440\u0438 \u044d\u0442\u043e\u043c<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b &#171;\u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e&#187; \u0441\u043b\u043e\u044f K[i]=1<\/li>\n<li>\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b &#171;\u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e&#187; \u0441\u043b\u043e\u044f B[i] \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043d\u0430 \u043e\u0442\u0440\u0435\u0437\u043a\u0435 (-x1,-x0)<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 K, B, W \u0438 C \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u043d\u0430 \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u0445 (x,y) \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 f.<\/p>\n<p>  <\/p>\n<h3 id=\"sigmoida\">\u0421\u0438\u0433\u043c\u043e\u0438\u0434\u0430<\/h3>\n<p>  <\/p>\n<p>\u0421\u0438\u0433\u043c\u043e\u0438\u0434\u0430 \u2014 \u044d\u0442\u043e \u0433\u043b\u0430\u0434\u043a\u0430\u044f \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u0430\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0430\u044f \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/p>\n<p>  <\/p>\n<ul>\n<li>S(x) = 1 \/ (1 + exp(-x)).<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"programma\">\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/h2>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u043f\u0430\u043a\u0435\u0442 Tensorflow<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0443\u0437\u0435\u043b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 x = tf.placeholder(tf.float32, [None, 1], name=\"x\")  # \u0443\u0437\u0435\u043b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 y = tf.placeholder(tf.float32, [None, 1], name=\"y\")  # \u0441\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u043b\u043e\u0439 nn = tf.layers.dense(x, hiddenSize,                      activation=tf.nn.sigmoid,                      kernel_initializer=tf.initializers.ones(),                      bias_initializer=tf.initializers.random_uniform(minval=-x1, maxval=-x0),                      name=\"hidden\")  # \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u043b\u043e\u0439 model = tf.layers.dense(nn, 1,                         activation=None,                         name=\"output\")  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 cost = tf.losses.mean_squared_error(y, model)  train = tf.train.GradientDescentOptimizer(learn_rate).minimize(cost) <\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"obuchenie\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">init = tf.initializers.global_variables()  with tf.Session() as session:     session.run(init)      for _ in range(iterations):          train_dataset, train_values = generate_test_values()          session.run(train, feed_dict={             x: train_dataset,             y: train_values         }) <\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"polnyy-tekst\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">import math import numpy as np import tensorflow as tf import matplotlib.pyplot as plt  x0, x1 = 10, 20 # \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438  test_data_size = 2000 # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f iterations = 20000 # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f learn_rate = 0.01 # \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f  hiddenSize = 10 # \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u044f  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d def generate_test_values():     train_x = []     train_y = []      for _ in range(test_data_size):         x = x0+(x1-x0)*np.random.rand()         y = math.sin(x) # \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f         train_x.append([x])         train_y.append([y])      return np.array(train_x), np.array(train_y)  # \u0443\u0437\u0435\u043b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 x = tf.placeholder(tf.float32, [None, 1], name=\"x\")  # \u0443\u0437\u0435\u043b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 y = tf.placeholder(tf.float32, [None, 1], name=\"y\")  # \u0441\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u043b\u043e\u0439 nn = tf.layers.dense(x, hiddenSize,                      activation=tf.nn.sigmoid,                      kernel_initializer=tf.initializers.ones(),                      bias_initializer=tf.initializers.random_uniform(minval=-x1, maxval=-x0),                      name=\"hidden\")  # \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u043b\u043e\u0439 model = tf.layers.dense(nn, 1,                         activation=None,                         name=\"output\")  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 cost = tf.losses.mean_squared_error(y, model)  train = tf.train.GradientDescentOptimizer(learn_rate).minimize(cost)  init = tf.initializers.global_variables()  with tf.Session() as session:     session.run(init)      for _ in range(iterations):          train_dataset, train_values = generate_test_values()          session.run(train, feed_dict={             x: train_dataset,             y: train_values         })          if(_ % 1000 == 999):             print(\"cost = {}\".format(session.run(cost, feed_dict={                 x: train_dataset,                 y: train_values             })))      train_dataset, train_values = generate_test_values()      train_values1 = session.run(model, feed_dict={         x: train_dataset,     })      plt.plot(train_dataset, train_values, \"bo\",              train_dataset, train_values1, \"ro\")     plt.show()      with tf.variable_scope(\"hidden\", reuse=True):         w = tf.get_variable(\"kernel\")         b = tf.get_variable(\"bias\")         print(\"hidden:\")         print(\"kernel=\", w.eval())         print(\"bias = \", b.eval())      with tf.variable_scope(\"output\", reuse=True):         w = tf.get_variable(\"kernel\")         b = tf.get_variable(\"bias\")         print(\"output:\")         print(\"kernel=\", w.eval())         print(\"bias = \", b.eval())<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"vot-chto-poluchilos\">\u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/h2>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f17\/c45\/0ae\/f17c450ae2ff5415007525d41b2176e3.png\" alt=\"\u0413\u0440\u0430\u0444\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0430\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438\" title=\"\u0413\u0440\u0430\u0444\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0430\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438\"><\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0438\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/li>\n<li>\u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u2014 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"vyvod-konsoli\">\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043d\u0441\u043e\u043b\u0438<\/h2>\n<p>  <\/p>\n<pre><code>cost = 0.15786637365818024 cost = 0.10963975638151169 cost = 0.08536215126514435 cost = 0.06145831197500229 cost = 0.04406769573688507 cost = 0.03488277271389961 cost = 0.026663536205887794 cost = 0.021445846185088158 cost = 0.016708852723240852 cost = 0.012960446067154408 cost = 0.010525770485401154 cost = 0.008495906367897987 cost = 0.0067353141494095325 cost = 0.0057082874700427055 cost = 0.004624188877642155 cost = 0.004093789495527744 cost = 0.0038146725855767727 cost = 0.018593043088912964 cost = 0.010414039716124535 cost = 0.004842184949666262 hidden: kernel= [[1.1523403  1.181032   1.1671464  0.9644377  0.8377886  1.0919508   0.87283015 1.0875995  0.9677301  0.6194152 ]] bias =  [-14.812331 -12.219926 -12.067375 -14.872566 -10.633507 -14.014006  -13.379829 -20.508204 -14.923473 -19.354435] output: kernel= [[ 2.0069902 ]  [-1.0321712 ]  [-0.8878887 ]  [-2.0531905 ]  [ 1.4293027 ]  [ 2.1250408 ]  [-1.578137  ]  [ 4.141281  ]  [-2.1264815 ]  [-0.60681605]] bias =  [-0.2812019]<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"ishodnyy-kod\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/dprotopopov\/nnfunc\">https:\/\/github.com\/dprotopopov\/nnfunc<\/a><\/p>\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\/428281\/\"> https:\/\/habr.com\/post\/428281\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u0421 \u0446\u0435\u043b\u044c\u044e \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438, \u0440\u0435\u0448\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/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-291609","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291609","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=291609"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291609\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}