<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged (predicted</title>
<link>https://coderlegion.com/tag/%28predicted</link>
<description>Powered by Question2Answer</description>
<item>
<title>Understanding Backpropagation: Chain Rule, SSR Gradients, and Weight Updates in Neural Networks</title>
<link>https://coderlegion.com/21632/understanding-backpropagation-chain-rule-ssr-gradients-weight-updates-neural-networks</link>
<description>
&lt;p&gt;Hello, I'm Ganesh. I'm building &lt;em&gt;git-lrc&lt;/em&gt;, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star git-lrc on GitHub&lt;/a&gt; to help more developers discover the project. Do give it a try and share your feedback for improving the product.&lt;/p&gt;

&lt;p&gt;In the previous article, We derived fromula for pridicting b3 now we will understand how to dereive wieghts w3 and w4.&lt;/p&gt;

&lt;h2&gt;
  
  
  How wights are connected to previous output layer?
&lt;/h2&gt;

&lt;p&gt;In previous direvation we considered b3 as variable and w3 and w4 as constants. &lt;/p&gt;

&lt;p&gt;That means we need have w3 and w4 as a variable to find it's value.&lt;/p&gt;

&lt;p&gt;Wieghts w3 and w4 are multiplied to activation function of both top and bottom neurons.&lt;/p&gt;

&lt;p&gt;So, Actication function of top neuron is 1&lt;/p&gt;

&lt;p&gt;As it is soft plus function&lt;/p&gt;

&lt;p&gt;x1 = input x w1 + b1&lt;/p&gt;

&lt;p&gt;y1=f(x1)= log(1+e^x)&lt;/p&gt;

&lt;p&gt;Similarly for bottom neuron&lt;/p&gt;

&lt;p&gt;x2 = input x w2 + b2&lt;/p&gt;

&lt;p&gt;y2=f(x2)= log(1+e^x)&lt;/p&gt;

&lt;p&gt;So, Finaly we get &lt;/p&gt;

&lt;p&gt;Predicted = y1 * w3 + y2 * w4 + b3&lt;/p&gt;

&lt;p&gt;So, finaly we get &lt;/p&gt;

&lt;p&gt;SSR = &amp;Sigma; (observed &amp;minus; predicted)&amp;sup2;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Each Values are Calculated?
&lt;/h2&gt;

&lt;p&gt;Now By applying to previous formula by applying direvation w.r.t w3, w4 and b3.&lt;/p&gt;

&lt;p&gt;dSSR/dw3 = dSSR/d(predicted) * d(predicted)/dw3&lt;/p&gt;

&lt;p&gt;dSSR/dw4 = dSSR/d(predicted) * d(predicted)/dw4&lt;/p&gt;

&lt;p&gt;dSSR/db3 = dSSR/d(predicted) * d(predicted)/db3&lt;/p&gt;

&lt;p&gt;We can see dSSR/d(predicted) is common in all three direvation.&lt;/p&gt;

&lt;p&gt;dSSR/d(predicted) = 2 * (Predicted - Observed) * -1&lt;/p&gt;

&lt;p&gt;Now, for d(predicted)/dw3 &lt;/p&gt;

&lt;p&gt;d(predicted)/dw3 = d(y1 * w3 + y2 * w4 + b3)/dw3 = y1&lt;/p&gt;

&lt;p&gt;As remaining all are constant w.r.t w3. &lt;/p&gt;

&lt;p&gt;similarly for d(predicted)/dw4&lt;/p&gt;

&lt;p&gt;d(predicted)/dw4 = d(y1 * w3 + y2 * w4 + b3)/dw4 = y2&lt;/p&gt;

&lt;p&gt;As remaining all are constant w.r.t w4. &lt;/p&gt;

&lt;p&gt;Now, for d(predicted)/db3&lt;/p&gt;

&lt;p&gt;d(predicted)/db3 = d(y1 * w3 + y2 * w4 + b3)/db3 = 1&lt;/p&gt;

&lt;p&gt;As remaining all are constant w.r.t b3. &lt;/p&gt;

&lt;p&gt;Now Finaly we get &lt;/p&gt;

&lt;p&gt;dSSR/dw3 = dSSR/d(predicted) * d(predicted)/dw3 = 2 * (Predicted - Observed) * -1 * y1 = -2 * (Predicted - Observed) * y1&lt;/p&gt;

&lt;p&gt;dSSR/dw4 = dSSR/d(predicted) * d(predicted)/dw4 = 2 * (Predicted - Observed) * -1 * y2 = -2 * (Predicted - Observed) * y2&lt;/p&gt;

&lt;p&gt;dSSR/db3 = dSSR/d(predicted) * d(predicted)/db3 = 2 * (Predicted - Observed) * -1 * 1 = -2 * (Predicted - Observed)&lt;/p&gt;

&lt;h2&gt;
  
  
  Improving Prediction with self Learning
&lt;/h2&gt;

&lt;p&gt;Now we calculate dSSR/dw3, dSSR/dw4, and dSSR/db3.&lt;/p&gt;

&lt;p&gt;Then we try to make the value near to 0 hence making the error minimum.&lt;/p&gt;

&lt;p&gt;Step size = derivation * Learning rate&lt;/p&gt;

&lt;p&gt;New w3 = old w3 - Step size w3&lt;/p&gt;

&lt;p&gt;Do the same thing for w4 and b3&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We got an idea how weights are calculated for a single neuron. Now we can extend this idea to multi layers.&lt;/p&gt;

&lt;p&gt;In next article we will see how to calculate weights for multi layers.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnuphqwcp6bha9ol6pdo3.png&quot; alt=&quot;git-lrc&quot; width=&quot;360&quot; height=&quot;540&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback or contributors are welcome! It&amp;rsquo;s online, source-available, and ready for anyone to use.&lt;/p&gt;

&lt;p&gt;&amp;#11088; &lt;a href=&quot;https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/21632/understanding-backpropagation-chain-rule-ssr-gradients-weight-updates-neural-networks</guid>
<pubDate>Wed, 01 Jul 2026 11:40:15 +0000</pubDate>
</item>
</channel>
</rss>