<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ariel Novelli on Medium]]></title>
        <description><![CDATA[Stories by Ariel Novelli on Medium]]></description>
        <link>https://medium.com/@arielnovelli?source=rss-8da77f436dd8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NYY6BffznyiTq6Gs</url>
            <title>Stories by Ariel Novelli on Medium</title>
            <link>https://medium.com/@arielnovelli?source=rss-8da77f436dd8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:38:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arielnovelli/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Demystifying Neural Networks]]></title>
            <link>https://arielnovelli.medium.com/demystifying-neural-networks-9d3483f3d09d?source=rss-8da77f436dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d3483f3d09d</guid>
            <category><![CDATA[gradient-descent]]></category>
            <category><![CDATA[backpropagation]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Ariel Novelli]]></dc:creator>
            <pubDate>Tue, 03 Nov 2020 13:42:45 GMT</pubDate>
            <atom:updated>2020-11-03T13:42:45.820Z</atom:updated>
            <content:encoded><![CDATA[<p>All you need is a piece of paper and a pencil</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*f85ydLNE48S8LH6S0O_WVQ.png" /></figure><blockquote>“If you want to change the world, pick up a pen and write.” — Martin Luther</blockquote><p>I will explain what neural networks do with a real simple example.</p><p>I will use this basic neural network architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*Rnzn7q6fGsxjWtHReKChgA.png" /></figure><p>I will initialize weights, biases, training inputs and output with these following values:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*CJBRIDMw205uroYrKZgaQg.png" /></figure><blockquote>What this is all about is adjusting the values of the weights w1, w2, w3, w4, w5 and w6 to obtain the output we want o = 1 for the given inputs x1 = .10 and x2 = .20.</blockquote><p>Hidden Neurons <strong><em>h1</em></strong> and <strong><em>h2, </em></strong>and Output Neuron <strong><em>o </em></strong>are divided into two different functions: Net (linear regression function) and Act (activation function). I will be using the logistic function as the activation function for all neurons.</p><p>These are the formulas for both functions:</p><p><em>Net = w * x + b –linear regression function<br>Act = Sigmoid (Net) –logistic function 1 / (1 + exp (-x))</em></p><p><strong>Fase I: Fordward or Computing Output</strong></p><p>Let’s compute our first output using initialization values:</p><p><em>Neth1 = w1 * x1 + w2 * x2 + b1 –linear regression function<br>Acth1 = Sigmoid(Neth1) –logistic function</em></p><p><em>Neth2 = w3 * x1 + w4 * x2 + b1<br>Acth2 = Sigmoid(Neth2)</em></p><p><em>Neto = w5 * Acth1 + w6 * Acth2 + b2<br>Acto = Sigmoid(Neto2)<br>Sigmoid is the logistic function to squash the output –&gt; 1 / (1 + exp (-x))</em></p><p><em>Neth1 = .30 * .10 + .40 * .20 + .15<br>Acth1 = Sigmoid(.26)<br>Acth1 = .5646363</em></p><p><em>Neth2 = .50 * .10 + .60 * .20 + .15<br>Acth2 = Sigmoid(.32)<br>Acth2 = .5793242</em></p><p><em>Neto = .70 * .5646363 + .80 * .5793242 + .25<br>Acto = Sigmoid(1.1087048)<br></em><strong><em>Acto = .7518875 (vs 1.00 target)</em></strong></p><p><strong>Fase II: Computing the Cost</strong></p><p>I will be using the popular squared error function for calculating the Total Cost.</p><p><em>Etotal = .5 * (target — output)**2<br>Etotal = .5 * (1 — .7518875)**2<br></em><strong><em>Etotal = .0307798</em></strong></p><p><strong>Fase III: Backpropagation for Output Layer</strong></p><p>We use partial derivatives of Total Error with respect to each weight in order to know how much a change in each weight affects the Total Error.</p><p><em>∂Etotal/∂w5 = ∂Etotal/∂Acto * ∂Acto/∂Neto * ∂Neto/∂w5 –chain rule</em></p><p><em>∂Etotal/∂Acto = .5 * 2 * (target — output) * -1<br>∂Etotal/∂Acto = .5 * 2 * (1 — .7518875) * -1<br>∂Etotal/∂Acto = — .24811243085</em></p><p><em>∂Acto/∂Neto = output * (1 — output)<br>∂Acto/∂Neto = .7518875 * (1 — .7518875)<br>∂Acto/∂Neto = .1865526</em></p><p><em>∂Neto/∂w5 = Acth1<br>∂Neto/∂w5 = .5646363<br>∂Etotal/∂w5 = -.2481124 * .1865526 * .5646363<br></em><strong><em>∂Etotal/∂w5 = -.0261347</em></strong></p><p>In order to decrease the error we need to subtract this value from the current weight multiplied by some learning rate which I will set to 0.5.</p><p><em>w5+ = w5 — α * ∂Etotal/∂w5<br>w5+ = .70 — .5 * -.0261347<br></em><strong><em>w5+ = .7130673</em></strong></p><p>Repeating this process we get the new weight w6:</p><p><strong><em>w6+ = .8134073</em></strong></p><p><strong>Fase IV: Backpropagation for Hidden Layer</strong></p><p><em>∂Etotal/∂w1 = ∂Etotal/∂Acth1 * ∂Acth1/∂Neth1 * ∂Neth1/∂w1 –chain rule</em></p><p><em>∂Etotal/∂Acth1 = ∂Etotal/∂Neto * ∂Neto/∂Acth1<br>∂Etotal/∂Neto = ∂Etotal/∂Acto * ∂Acto/∂Neto<br>∂Etotal/∂Neto = — .2481124 * .1865526<br>∂Etotal/∂Neto = — .0462869<br>∂Etotal/∂Acth1 = — .0462869 * ∂Neto/∂Acth1<br>∂Etotal/∂Acth1 = — .0462869 * w5<br>∂Etotal/∂Acth1 = — .0462869 * .70<br>∂Etotal/∂Acth1 = — .0324002</em></p><p><em>∂Acth1/∂Neth1 = Acth1 * (1- Acth1)<br>∂Acth1/∂Neth1 = .5646363 * (1- .5646363)<br>∂Acth1/∂Neth1 = .2458221</em></p><p><em>∂Neth1/∂w1 = x1<br>∂Neth1/∂w1 = .10</em></p><p><em>∂Etotal/∂w1 = — .0324002 * .2458221 * .10<br></em><strong><em>∂Etotal/∂w1 = — .0007964</em></strong></p><p><em>w1+ = w1 — α * ∂Etotal/∂w1<br>w1+ = .30 — .5 * — .0007964<br></em><strong><em>w1+ = .3003982</em></strong></p><p><em>Repeating this process we get the new weights w2, w3 and w4:</em></p><p><strong><em>w2+ = .4007964<br>w3+ = .5004512<br>w4+ = .6009024</em></strong></p><p>Now it&#39;s time to go back to Fase I and compute our new output and new total error using the new weights:</p><p><strong><em>Acto = .7547169 (vs 1.00 target)<br>Etotal = .0300818</em></strong></p><p>You might think this is not a big change, but by repeating this 5.000 times you will get the following results:</p><p><strong><em>Acto = .9830802 (vs 1.00 target)<br>Etotal = .0001431</em></strong></p><p><strong>Neural networks are no longer a mystery!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d3483f3d09d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>