{"id":52,"date":"2021-03-27T09:59:30","date_gmt":"2021-03-27T09:59:30","guid":{"rendered":"https:\/\/school.moongames.eu\/?p=52"},"modified":"2022-07-14T13:52:23","modified_gmt":"2022-07-14T13:52:23","slug":"gradient-descent","status":"publish","type":"post","link":"https:\/\/school.moongames.eu\/index.php\/2021\/03\/27\/gradient-descent\/","title":{"rendered":"Gradient Descent"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">the Diploma thesis learning &#8211; <time datetime=\"2021-03-27T09:59:30+00:00\">March 27, 2021<\/time><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> Machine learning has multiple methods to gradually improve solution by moving closer with intermediate result. One of more sophisticated methods is the Gradient Descent. Gradient descent is functional approach where you often approximate the result with some regard to difference of real (eg. measured) value and the predicted (function) value. In the statistics the difference is called error or the residual and is often used as cost function. The Gradient Descent tries to minimize the cost function. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are two main types of functions &#8211; the loss function and the cost function. The loss function is function which displays the loss on one sample, one element, whereas the cost function is total of all the individual loss functions combined.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example for linear regression we can use as cost function the Mean Squared Error (MSE). MSE displays how far from actual value the predicted value is. In other words how bad was the guess. The equation for Mean Squared Error is<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><a name=\"id3299108315\"><\/a><p class=\"ql-center-displayed-equation\" style=\"line-height: 49px;\"><span class=\"ql-right-eqno\"> (1) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-940e6f81fe82f390e8a4a3a632fe8893_l3.png\" height=\"49\" width=\"191\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;&#32; &#77;&#83;&#69;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#109;&#125;&#123;&#40;&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#95;&#123;&#105;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#105;&#125;&#41;&#94;&#50;&#125; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or vectorized <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-2890f5674316e61ea039ba002443b6fa_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#77;&#83;&#69;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125;&#40;&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#45;&#32;&#121;&#41;&#94;&#84;&#40;&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#45;&#32;&#121;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"203\" style=\"vertical-align: -6px;\"\/><\/code> where <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-ddbbb251a1eac6ff930e639227a7e32d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#121;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"9\" style=\"vertical-align: -4px;\"\/><\/code> is predicted value of model based on some parameters <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-d4ee28752517d6062a3ca0314890342d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"16\" style=\"vertical-align: 0px;\"\/><\/code>, <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-0af556714940c351c933bba8cf840796_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: -4px;\"\/><\/code> is real value for the parameters and <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-6b41df788161942c6f98604d37de8098_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#109;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"15\" style=\"vertical-align: 0px;\"\/><\/code> is a number of measurements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If we are looking on linear regression and our model <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-ddbbb251a1eac6ff930e639227a7e32d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#121;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"9\" style=\"vertical-align: -4px;\"\/><\/code> is equal to <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-a24d8be6b4e6c3cf4fe01aec6bb92491_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#121;&#95;&#105;&#125;&#32;&#61;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#88;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"17\" width=\"115\" style=\"vertical-align: -4px;\"\/><\/code> for any <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-998dba373bb08119e12a646c873be88c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#88;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"20\" style=\"vertical-align: -3px;\"\/><\/code> from vector <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-d4ee28752517d6062a3ca0314890342d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"16\" style=\"vertical-align: 0px;\"\/><\/code> (that is vector of size <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-433096b925cf790a3a8c4c7617e1293e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#49;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#109;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"58\" style=\"vertical-align: -5px;\"\/><\/code>) and <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-a4d1ad2852a85fc06295b1f20bf2e63f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#88;&#94;&#42;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"17\" width=\"22\" style=\"vertical-align: -5px;\"\/><\/code> is simplified version for multiplying the vectors in <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-c04f5e0a547a475e21041c8533011ac2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#61;&#32;&#88;&#94;&#42;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#92;&#116;&#104;&#101;&#116;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"87\" style=\"vertical-align: -4px;\"\/><\/code> to create <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-a24d8be6b4e6c3cf4fe01aec6bb92491_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#121;&#95;&#105;&#125;&#32;&#61;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#88;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"17\" width=\"115\" style=\"vertical-align: -4px;\"\/><\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  <p class=\"ql-center-displayed-equation\" style=\"line-height: 95px;\"><span class=\"ql-right-eqno\"> (2) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-1e2bf77ebcdfa2eef223f55595bebcc0_l3.png\" height=\"95\" width=\"494\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#32;&#32;&#32;&#32;&#88;&#32;&#38;&#61;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#120;&#95;&#123;&#50;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#120;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125;&#44;&#32;&#38; &#32;&#32;&#32;&#32;&#88;&#94;&#42;&#32;&#38;&#61;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#49;&#32;&#32;&#38;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#49;&#32;&#32;&#38;&#32;&#120;&#95;&#123;&#50;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#38;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#49;&#32;&#32;&#38;&#32;&#120;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125;&#44;&#32;&#38; &#32;&#32;&#32;&#92;&#116;&#104;&#101;&#116;&#97;&#32;&#61;&#32; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125;&#44;&#32;&#38;&#32;&#38; &#32;&#32;&#32;&#32;&#121;&#32;&#38;&#61;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#121;&#95;&#123;&#49;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#121;&#95;&#123;&#50;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#121;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expanding the calculation based on <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-2890f5674316e61ea039ba002443b6fa_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#77;&#83;&#69;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125;&#40;&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#45;&#32;&#121;&#41;&#94;&#84;&#40;&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#45;&#32;&#121;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"203\" style=\"vertical-align: -6px;\"\/><\/code> for <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-c04f5e0a547a475e21041c8533011ac2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#61;&#32;&#88;&#94;&#42;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#92;&#116;&#104;&#101;&#116;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"87\" style=\"vertical-align: -4px;\"\/><\/code> and <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-0af556714940c351c933bba8cf840796_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: -4px;\"\/><\/code>. First we are counting the loss function <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-5580bf4f512b887e0f792ff08babb38a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#45;&#32;&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"40\" style=\"vertical-align: -4px;\"\/><\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  <p class=\"ql-center-displayed-equation\" style=\"line-height: 303px;\"><span class=\"ql-right-eqno\"> (3) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-83a69b07678c5c6a78bb8053845b022c_l3.png\" height=\"303\" width=\"303\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#32;&#32;&#32;&#32;&#40;&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#45;&#32;&#121;&#41;&#32;&#38;&#61;&#32; &#32;&#32;&#32;&#92;&#66;&#105;&#103;&#103;&#40; &#32;&#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#49;&#32;&#32;&#38;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#49;&#32;&#32;&#38;&#32;&#120;&#95;&#123;&#50;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#38;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#49;&#32;&#32;&#38;&#32;&#120;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115; &#32;&#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#45; &#32;&#32;&#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#121;&#95;&#123;&#49;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#121;&#95;&#123;&#50;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#121;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#92;&#66;&#105;&#103;&#103;&#41;&#92;&#92; &#32;&#32;&#32;&#32;&#38;&#61; &#32;&#32;&#32;&#92;&#66;&#105;&#103;&#103;&#40; &#32;&#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#50;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#38;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#45; &#32;&#32;&#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#121;&#95;&#123;&#49;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#121;&#95;&#123;&#50;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#121;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#92;&#66;&#105;&#103;&#103;&#41;&#92;&#92; &#32;&#32;&#32;&#38;&#61; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#49;&#125;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#50;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#50;&#125;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#109;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">where again <code><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-a5cd840900e3eba12413c873adc24af1_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#77;&#83;&#69;&#32;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125;&#32;&#40;&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#45;&#32;&#121;&#41;&#94;&#84;&#40;&#92;&#104;&#97;&#116;&#123;&#121;&#125;&#32;&#45;&#32;&#121;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"203\" style=\"vertical-align: -6px;\"\/><\/code> is equal to<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  <p class=\"ql-center-displayed-equation\" style=\"line-height: 280px;\"><span class=\"ql-right-eqno\"> (4) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-63aba98b9a2f982cda8b6812bab7c5bf_l3.png\" height=\"280\" width=\"745\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#32;&#32;&#32;&#32;&#77;&#83;&#69;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#49;&#125;&#32;&#38; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#50;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#50;&#125;&#32;&#38; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#104;&#100;&#111;&#116;&#115;&#32;&#32;&#38; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#109;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#49;&#125;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#50;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#50;&#125;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#118;&#100;&#111;&#116;&#115;&#32;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#109;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125;&#123; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#40; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#40;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#49;&#125;&#41;&#40;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#49;&#125;&#41;&#32;&#43; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#104;&#100;&#111;&#116;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#41;&#125;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#40; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#40;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#94;&#50;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#45;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#121;&#95;&#123;&#49;&#125;&#41;&#32;&#43;&#32;&#40;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#94;&#50;&#32;&#120;&#95;&#123;&#49;&#125;&#94;&#50;&#32;&#45;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#121;&#95;&#123;&#49;&#125;&#41;&#32;&#43;&#32;&#40;&#45;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#121;&#95;&#123;&#49;&#125;&#32;&#45;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#121;&#95;&#123;&#49;&#125;&#32;&#43;&#32;&#121;&#95;&#123;&#49;&#125;&#94;&#50;&#41;&#32;&#43; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#104;&#100;&#111;&#116;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#41;&#32;&#92;&#92; &#32;&#32;&#32;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#40; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#40;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#94;&#50;&#32;&#43;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#45;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#121;&#95;&#123;&#49;&#125;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#94;&#50;&#32;&#120;&#95;&#123;&#49;&#125;&#94;&#50;&#32;&#45;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#49;&#125;&#32;&#121;&#95;&#123;&#49;&#125;&#32;&#43;&#32;&#121;&#95;&#123;&#49;&#125;&#94;&#50;&#41;&#32;&#43; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#104;&#100;&#111;&#116;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#41;&#92;&#92; &#32;&#32;&#32;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#109;&#125;&#123;&#40;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#94;&#50;&#32;&#43;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#105;&#125;&#32;&#45;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#121;&#95;&#123;&#105;&#125;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#94;&#50;&#32;&#120;&#95;&#123;&#105;&#125;&#94;&#50;&#32;&#45;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#105;&#125;&#32;&#121;&#95;&#123;&#105;&#125;&#32;&#43;&#32;&#121;&#95;&#123;&#105;&#125;&#94;&#50;&#41;&#125; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The Mean Squared Errror is great in telling how far from real values our prediction is, but it has problem of not telling us which way to go (as it is squared, so it is always positive). That is why it is necessary to create partial derivation of MSE (gradient).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To simplify the equations we will halve the MSE. Using <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-3278c9710e6ac90eaea9352c17e71ebe_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#102;&#114;&#97;&#99;&#123;&#77;&#83;&#69;&#125;&#123;&#50;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"35\" style=\"vertical-align: -6px;\"\/> does not really matter as we are changing the cost function by a scalar while searching for the minimum of the function.<\/p>\n\n\n\n<pre id=\"block-f459fd92-28e9-4f62-8cf0-29a01a21eab8\" class=\"wp-block-code\"><code>  <p class=\"ql-center-displayed-equation\" style=\"line-height: 50px;\"><span class=\"ql-right-eqno\"> (5) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-a540675dd86d8de5765d2f47005e2986_l3.png\" height=\"50\" width=\"497\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#32;&#32;&#32;&#32;&#77;&#83;&#69;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#109;&#125;&#123;&#40;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#94;&#50;&#32;&#43;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#105;&#125;&#32;&#45;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#121;&#95;&#123;&#105;&#125;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#94;&#50;&#32;&#120;&#95;&#123;&#105;&#125;&#94;&#50;&#32;&#45;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#105;&#125;&#32;&#121;&#95;&#123;&#105;&#125;&#32;&#43;&#32;&#121;&#95;&#123;&#105;&#125;&#94;&#50;&#41;&#125; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The cost function (in this case <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-3278c9710e6ac90eaea9352c17e71ebe_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#102;&#114;&#97;&#99;&#123;&#77;&#83;&#69;&#125;&#123;&#50;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"22\" width=\"35\" style=\"vertical-align: -6px;\"\/>) can be partially derived for each parameter of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-356a08e839ab6974a16448e16e56745d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#116;&#104;&#101;&#116;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: 0px;\"\/> (in this case <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-75d6047e74b4aeb24a7e2b78b54a11e5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#91;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#93;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"41\" style=\"vertical-align: -5px;\"\/>).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  <p class=\"ql-center-displayed-equation\" style=\"line-height: 109px;\"><span class=\"ql-right-eqno\"> (6) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-b6d6a09030b7a7d1e7b83f73ac5fc3cf_l3.png\" height=\"109\" width=\"279\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#32;&#32;&#32;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#100;&#102;&#125;&#123;&#100;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#125;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#109;&#125;&#123;&#40;&#50;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#43;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#105;&#125;&#32;&#45;&#32;&#50;&#32;&#121;&#95;&#123;&#105;&#125;&#41;&#125;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#109;&#125;&#123;&#40;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#105;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#105;&#125;&#41;&#125; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>  <p class=\"ql-center-displayed-equation\" style=\"line-height: 109px;\"><span class=\"ql-right-eqno\"> (7) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-6474f45ec6aaf82444138a8ee2070dcf_l3.png\" height=\"109\" width=\"313\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#32;&#32;&#32;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#100;&#102;&#125;&#123;&#100;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#125;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#109;&#125;&#123;&#40;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#120;&#95;&#123;&#105;&#125;&#32;&#43;&#32;&#50;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#105;&#125;&#94;&#50;&#32;&#45;&#32;&#50;&#32;&#120;&#95;&#123;&#105;&#125;&#32;&#121;&#95;&#123;&#105;&#125;&#41;&#125;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#38;&#61;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#109;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#116;&#105;&#109;&#101;&#115; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#109;&#125;&#123;&#120;&#95;&#123;&#105;&#125;&#32;&#40;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#32;&#43;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#32;&#120;&#95;&#123;&#105;&#125;&#32;&#45;&#32;&#121;&#95;&#123;&#105;&#125;&#41;&#125; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Using differentiation we can approach the local minimum using slope of the function (the slope is described by the first derivative). Having <em>MSE<\/em> function we can do partial derivation for each of the parameters and subtract the part of the slope of the previous solution to better approximate the function. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><p class=\"ql-center-displayed-equation\" style=\"line-height: 37px;\"><span class=\"ql-right-eqno\"> (8) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-7b04fa71fdce91b323ab995abd4537bc_l3.png\" height=\"37\" width=\"139\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#32;&#32;&#32;&#32;&#92;&#116;&#104;&#101;&#116;&#97;&#95;&#123;&#110;&#101;&#119;&#125;&#32;&#38;&#61;&#32;&#92;&#116;&#104;&#101;&#116;&#97;&#95;&#123;&#111;&#108;&#100;&#125;&#32;&#45;&#32;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#100;&#102;&#125;&#123;&#100;&#92;&#116;&#104;&#101;&#116;&#97;&#125; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now having the partial derivatives it is time to use them to improve the parameters. Only thing remaining is choosing the correct step size <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-8f0b6b1a01f8fcc2f95be0364c090397_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#97;&#108;&#112;&#104;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/>. It is important to choose proper size. Choose too big steps and it would mean jumping too far a back. Choose too small step size and it will take close to infinite amount of time to improve the parameters.. Often simple 1% change (<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-fef59435375469c4dfa5f6c25a323dc8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#61;&#32;&#48;&#46;&#48;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"66\" style=\"vertical-align: 0px;\"\/>) in time seems like a good fit as it is simple enough to not complicate the counting yet big enough to make change in time.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><p class=\"ql-center-displayed-equation\" style=\"line-height: 97px;\"><span class=\"ql-right-eqno\"> (9) <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/school.moongames.eu\/wp-content\/ql-cache\/quicklatex.com-5d20d0486f2f6981edab3ec988cc3b6f_l3.png\" height=\"97\" width=\"227\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#32;&#32;&#32;&#32;&#92;&#116;&#104;&#101;&#116;&#97;&#95;&#123;&#110;&#101;&#119;&#125;&#32;&#38;&#61;&#32;&#92;&#116;&#104;&#101;&#116;&#97;&#95;&#123;&#111;&#108;&#100;&#125;&#32;&#45;&#32;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#100;&#102;&#125;&#123;&#100;&#92;&#116;&#104;&#101;&#116;&#97;&#125;&#92;&#92; &#32;&#32;&#32;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49; &#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125;&#95;&#123;&#110;&#101;&#119;&#125;&#32;&#38;&#61;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#98;&#101;&#116;&#97;&#95;&#49; &#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125;&#95;&#123;&#111;&#108;&#100;&#125;&#32;&#45;&#32;&#92;&#97;&#108;&#112;&#104;&#97;&#32;&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#100;&#102;&#125;&#123;&#100;&#92;&#98;&#101;&#116;&#97;&#95;&#48;&#125;&#92;&#92;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#100;&#102;&#125;&#123;&#100;&#92;&#98;&#101;&#116;&#97;&#95;&#49;&#125;&#92; &#32;&#32;&#32;&#32;&#32;&#32;&#92;&#101;&#110;&#100;&#123;&#98;&#109;&#97;&#116;&#114;&#105;&#120;&#125; &#32;&#32;&#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And this is one iteration of Gradient Descent. Now few hundred, maybe thousands (depending on model and initial guess), to converge to local minimum.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>the Diploma thesis learning &#8211; March 27, 2021 Machine learning has multiple methods to gradually improve solution by moving closer<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,4],"tags":[13],"class_list":["post-52","post","type-post","status-publish","format-standard","hentry","category-basics","category-implementation","tag-ml","comments-off"],"_links":{"self":[{"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":41,"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":165,"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/posts\/52\/revisions\/165"}],"wp:attachment":[{"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/categories?post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/school.moongames.eu\/index.php\/wp-json\/wp\/v2\/tags?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}