<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ganesh Kumar</title>
    <description>The latest articles on DEV Community by Ganesh Kumar (@ganesh-kumar).</description>
    <link>https://dev.to/ganesh-kumar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1403545%2F61f1e35c-72dd-4187-a25d-85ee2db0141c.jpeg</url>
      <title>DEV Community: Ganesh Kumar</title>
      <link>https://dev.to/ganesh-kumar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ganesh-kumar"/>
    <language>en</language>
    <item>
      <title>Understanding Idea behind Full Backpropogation</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Wed, 17 Jun 2026 12:59:48 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/understanding-idea-behind-full-backpropogation-3fpg</link>
      <guid>https://dev.to/ganesh-kumar/understanding-idea-behind-full-backpropogation-3fpg</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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 learned how to calculate the gradient of the last bias in a neural network.&lt;/p&gt;

&lt;p&gt;Now we will explore how gradients flow through the entire network and how to calculate the weights of previous layers.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to calculate weights
&lt;/h2&gt;

&lt;p&gt;Now we will calculate weights of the previous layer&lt;br&gt;
&lt;a href="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%2Fiofmkjdlpbvn0qcg2pxz.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Fiofmkjdlpbvn0qcg2pxz.png" alt=" " width="800" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The challenge is that the loss function does not directly depend on these earlier weights.&lt;/p&gt;

&lt;p&gt;For example, consider a weight (w1 and w2 are already calculated ) in a hidden layer.&lt;/p&gt;

&lt;p&gt;Changing (w3 and w4):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Changes the hidden neuron output.&lt;/li&gt;
&lt;li&gt;Changes the output neuron input.&lt;/li&gt;
&lt;li&gt;Changes the final prediction.&lt;/li&gt;
&lt;li&gt;Changes the loss.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So there is an indirect relationship between the weight and the loss.&lt;/p&gt;

&lt;p&gt;This is exactly why we need the chain rule.&lt;/p&gt;

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

&lt;p&gt;Similar to previous calculation we should also calculate for all weights and biases using chain rule and gradient descent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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" alt="git-lrc" width="360" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why Do Neural Networks Need the Chain Rule? How do we apply it?</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Sat, 13 Jun 2026 03:26:39 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/why-do-neural-networks-need-the-chain-rule-how-do-we-apply-it-o4a</link>
      <guid>https://dev.to/ganesh-kumar/why-do-neural-networks-need-the-chain-rule-how-do-we-apply-it-o4a</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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 introduced backpropagation and learned that neural networks improve by reducing prediction errors.&lt;/p&gt;

&lt;p&gt;We also saw that backpropagation relies on two fundamental ideas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Chain Rule&lt;/li&gt;
&lt;li&gt;Gradient Descent&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But we haven't yet answered an important question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How does we calculate wieghts and biases to decrease the error?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To answer that, let's look at a very small neural network.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Simple Neural Network
&lt;/h2&gt;

&lt;p&gt;Imagine a neural network with:&lt;br&gt;
Similar to the previous example.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One input neuron&lt;/li&gt;
&lt;li&gt;Two hidden neurons&lt;/li&gt;
&lt;li&gt;One output neuron&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="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%2Foglgvjmvsnaazyrs0ufr.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Foglgvjmvsnaazyrs0ufr.png" alt=" " width="800" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Calculating Last Bias In the last layer
&lt;/h2&gt;

&lt;p&gt;Let's asssume we have wieght and bias of all hidden layer and we only want to find last bias b3&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2F45skgcm1gm49uvadmhff.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2F45skgcm1gm49uvadmhff.png" alt=" " width="800" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now from gradient descent, we can update the last bias b3 using the partial derivative of loss with respect to b3&lt;/p&gt;

&lt;p&gt;The Error rate is done with Residuals.&lt;br&gt;
Residual = Observed - Predicted&lt;/p&gt;

&lt;p&gt;SSR = Sum of (Observed - Predicted)^2&lt;/p&gt;

&lt;p&gt;So, We take 3 samples for training&lt;/p&gt;

&lt;p&gt;Starting, Ending and middle values.&lt;/p&gt;

&lt;p&gt;Finaly By calculating SSR.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use of Chain Rule
&lt;/h2&gt;

&lt;p&gt;We actually calculated b3 only using gradient descent.&lt;/p&gt;

&lt;p&gt;Now Using chain Value generated from the weight and bias of previous layers&lt;/p&gt;

&lt;p&gt;Predicted = Top Layer + Bottom Layer + Bias (b3)&lt;/p&gt;

&lt;p&gt;Using Chain Rule we can write Dirivative of SSR with  &lt;/p&gt;

&lt;p&gt;dssr/db3 = dssr/dpredicted * dpredicted/db3&lt;/p&gt;

&lt;p&gt;dssr/dpredicted = (Observed - Predicted)^2 &lt;/p&gt;

&lt;p&gt;As predicted, it is not constant and we are dirving it.&lt;/p&gt;

&lt;p&gt;dssr/dpredicted = 2*(Observed - Predicted)*(d(Observed - Predicted))/dpredicted)&lt;/p&gt;

&lt;p&gt;dssr/dpredicted = 2*(Observed - Predicted)&lt;em&gt;(-1)&lt;br&gt;
dssr/dpredicted = -2&lt;/em&gt;(Observed - Predicted)&lt;/p&gt;

&lt;p&gt;For dpredicted/db3&lt;/p&gt;

&lt;p&gt;dpredicted = Top Layer + Bottom Layer + Bias (b3)&lt;br&gt;
Both Top Layer and Bottom Layer is constant for this calculation&lt;br&gt;
dpredicted/db3 = 1&lt;/p&gt;

&lt;p&gt;Finaly dssr/db3 = -2*(Observed - Predicted) * 1&lt;/p&gt;

&lt;h2&gt;
  
  
  Slop Calculation and Learning
&lt;/h2&gt;

&lt;p&gt;Now we have 3 values of predicted for 3 samples&lt;/p&gt;

&lt;p&gt;dssr/db3 = Σ(-2*(Observed-Predicted))&lt;/p&gt;

&lt;p&gt;dssr/db3 = -2 * [(Observed1 - Predicted1) * 1 + (Observed2 - Predicted2) * 1 + (Observed3 - Predicted3) * 1]&lt;/p&gt;

&lt;p&gt;dssr/db3 = -2 * [(Residual1) + (Residual2) + (Residual3)]&lt;/p&gt;

&lt;p&gt;dssr/db3 = -2 * (ResidualSum)&lt;/p&gt;

&lt;p&gt;For our training data I got slope = -15.7&lt;/p&gt;

&lt;p&gt;step size = slope x learning rate&lt;/p&gt;

&lt;p&gt;step size = -15.7 x 0.1 = -1.57&lt;/p&gt;

&lt;p&gt;new b3 = old b3 + step size&lt;/p&gt;

&lt;p&gt;new b3 = 0 + (-1.57) = -1.57&lt;/p&gt;

&lt;p&gt;Then again, recalculating SSR with new b3 we got slop.&lt;/p&gt;

&lt;p&gt;slop = -6.26&lt;/p&gt;

&lt;p&gt;step size = -6.26 x 0.1 = -0.626&lt;/p&gt;

&lt;p&gt;new b3 = -1.57 + (-0.626) = -2.196&lt;/p&gt;

&lt;p&gt;Similarly after calculatinng multiple times utile we get step size close to 0.&lt;/p&gt;

&lt;p&gt;Final Result&lt;br&gt;
We found the optimal &lt;br&gt;
b3 = 2.21&lt;/p&gt;

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

&lt;p&gt;We could able to apply these chain rule, gradient descent and backpropagation in a very small neural network.&lt;/p&gt;

&lt;p&gt;In next article we will discuss how to calculate wieghts and biases in same neural network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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" alt="git-lrc" width="360" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Running OpenAPI Validation in GitHub Actions and Showing Findings in Pull Requests</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Wed, 10 Jun 2026 20:39:09 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/running-openapi-validation-in-github-actions-and-showing-findings-in-pull-requests-4n8i</link>
      <guid>https://dev.to/ganesh-kumar/running-openapi-validation-in-github-actions-and-showing-findings-in-pull-requests-4n8i</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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 a previous article, I explained what SARIF is and why many security and quality tools use it as a common reporting format.&lt;/p&gt;

&lt;p&gt;In this article, we'll focus on a practical example: validating an OpenAPI specification in GitHub Actions and displaying findings directly inside GitHub Pull Requests.&lt;/p&gt;

&lt;p&gt;By the end, you'll have a workflow that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lints your OpenAPI specification&lt;/li&gt;
&lt;li&gt;Generates a SARIF report&lt;/li&gt;
&lt;li&gt;Uploads results to GitHub Code Scanning&lt;/li&gt;
&lt;li&gt;Shows annotations directly in Pull Requests&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sample OpenAPI Specification
&lt;/h2&gt;

&lt;p&gt;Let's start with a simple OpenAPI file that contains a deliberate issue.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;openapi&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;3.0.3&lt;/span&gt;

&lt;span class="na"&gt;info&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;User API&lt;/span&gt;
  &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1.0.0&lt;/span&gt;

&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;/users/{id}&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;operationId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;getUserById&lt;/span&gt;

      &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;userId&lt;/span&gt;
          &lt;span class="na"&gt;in&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;path&lt;/span&gt;
          &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
          &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;

      &lt;span class="na"&gt;responses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;200"&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;User found&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that the path is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/users/{id}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but the parameter is named:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;userId
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The parameter name should match the path placeholder (&lt;code&gt;id&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;We'll use this mistake to verify that our workflow correctly reports findings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Spectral
&lt;/h2&gt;

&lt;p&gt;For this example, we'll use Spectral, one of the most popular OpenAPI linting tools.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @stoplight/spectral-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spectral lint openapi.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see an error related to the path parameter mismatch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generating a SARIF Report
&lt;/h2&gt;

&lt;p&gt;Instead of printing results to the console, we can generate a SARIF report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spectral lint openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--format&lt;/span&gt; sarif &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--output&lt;/span&gt; results.sarif
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This produces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;results.sarif
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which GitHub can consume directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Actions Workflow
&lt;/h2&gt;

&lt;p&gt;Create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.github/workflows/openapi.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;OpenAPI Validation&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;read&lt;/span&gt;
  &lt;span class="na"&gt;security-events&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;openapi&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install Spectral&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm install -g @stoplight/spectral-cli&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Generate SARIF Report&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;spectral lint openapi.yaml \&lt;/span&gt;
            &lt;span class="s"&gt;--format sarif \&lt;/span&gt;
            &lt;span class="s"&gt;--output results.sarif&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Upload SARIF&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;github/codeql-action/upload-sarif@v3&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;sarif_file&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;results.sarif&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;The workflow performs four simple steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Checks out the repository&lt;/li&gt;
&lt;li&gt;Installs Spectral&lt;/li&gt;
&lt;li&gt;Generates a SARIF report&lt;/li&gt;
&lt;li&gt;Uploads the SARIF report to GitHub&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The upload step is handled by GitHub's official SARIF uploader:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;github/codeql-action/upload-sarif@v3&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;sarif_file&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;results.sarif&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once uploaded, GitHub automatically processes the findings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viewing Results in Pull Requests
&lt;/h2&gt;

&lt;p&gt;After opening a Pull Request, GitHub analyzes the uploaded SARIF report and associates findings with the corresponding files and lines.&lt;/p&gt;

&lt;p&gt;For our example, GitHub highlights the parameter definition and reports something similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Path parameter "id" is not defined.
Expected parameter name "id" but found "userId".
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Developers can review the issue directly from the Pull Request without searching through GitHub Action logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Prefer This Approach
&lt;/h2&gt;

&lt;p&gt;Many teams fail OpenAPI validation jobs and require developers to inspect CI logs.&lt;/p&gt;

&lt;p&gt;While this works, it doesn't scale well when repositories contain multiple specifications or many validation rules.&lt;/p&gt;

&lt;p&gt;Uploading SARIF results provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inline annotations&lt;/li&gt;
&lt;li&gt;Better visibility during code review&lt;/li&gt;
&lt;li&gt;Centralized findings in GitHub Code Scanning&lt;/li&gt;
&lt;li&gt;Consistent reporting across different tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same workflow can later be extended to include security scanners, secret scanners, IaC scanners, and custom validation tools.&lt;/p&gt;

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

&lt;p&gt;Integrating OpenAPI validation into GitHub Actions is straightforward. With Spectral generating SARIF output and GitHub handling the presentation layer, developers receive feedback exactly where they are already reviewing code: inside the Pull Request.&lt;/p&gt;

&lt;p&gt;If your organization already uses SARIF for other security or quality tools, OpenAPI validation can fit naturally into the same workflow with only a few lines of configuration.&lt;br&gt;
&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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" alt="git-lrc" width="360" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>automation</category>
      <category>githubactions</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What Is SARIF and How Does It Help Security Tools Work Together?</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Mon, 08 Jun 2026 20:28:21 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/what-is-sarif-and-how-does-it-help-security-tools-work-together-4743</link>
      <guid>https://dev.to/ganesh-kumar/what-is-sarif-and-how-does-it-help-security-tools-work-together-4743</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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;If you've ever worked with tools like Semgrep, Trivy, Checkov, Gitleaks, or CodeQL, you've probably noticed that each tool produces results in a different format. Some output JSON, some use XML, while others generate plain text reports.&lt;/p&gt;

&lt;p&gt;This creates a problem: how do you aggregate multiple tools results from multiple tools into a single platform?&lt;/p&gt;

&lt;p&gt;That's where SARIF comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SARIF?
&lt;/h2&gt;

&lt;p&gt;SARIF stands for &lt;strong&gt;Static Analysis Results Interchange Format&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It is an open standard designed to represent findings from static analysis tools, security scanners, linters, and code quality tools in a common format.&lt;/p&gt;

&lt;p&gt;Think of SARIF as a universal translator.&lt;/p&gt;

&lt;p&gt;Instead of every tool speaking its own language:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Semgrep -&amp;gt; Semgrep JSON
Trivy -&amp;gt; Trivy JSON
Checkov -&amp;gt; Checkov JSON
Gitleaks -&amp;gt; Gitleaks JSON
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SARIF allows all of them to communicate using a shared structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Semgrep
Trivy
Checkov
Gitleaks
    ↓
   SARIF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why Was SARIF Created?
&lt;/h2&gt;

&lt;p&gt;Imagine a company running 20 different scanners in its CI/CD pipeline.&lt;/p&gt;

&lt;p&gt;Each scanner reports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Different severity levels&lt;/li&gt;
&lt;li&gt;Different file formats&lt;/li&gt;
&lt;li&gt;Different metadata&lt;/li&gt;
&lt;li&gt;Different output structures&lt;/li&gt;
&lt;li&gt;Different CVE&lt;/li&gt;
&lt;li&gt;Different CVSS scores&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building integrations for every tool becomes difficult and expensive.&lt;/p&gt;

&lt;p&gt;SARIF solves this problem by providing a standardized schema for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rule IDs&lt;/li&gt;
&lt;li&gt;Messages&lt;/li&gt;
&lt;li&gt;Severity&lt;/li&gt;
&lt;li&gt;File locations&lt;/li&gt;
&lt;li&gt;Code snippets&lt;/li&gt;
&lt;li&gt;Security metadata&lt;/li&gt;
&lt;li&gt;Fix suggestions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows platforms to consume results from many tools without writing custom integrations for each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Simple Example
&lt;/h2&gt;

&lt;p&gt;Suppose a security scanner finds a vulnerability:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;File: app.py
Line: 42
Severity: High
Message: Possible SQL Injection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In SARIF, that information becomes structured JSON that any compatible platform can understand.&lt;/p&gt;

&lt;p&gt;The scanner changes, but the format remains the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  How SARIF Helps Developers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  One Format for Many Tools
&lt;/h3&gt;

&lt;p&gt;Instead of handling dozens of output formats:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Tool A -&amp;gt; Format A
Tool B -&amp;gt; Format B
Tool C -&amp;gt; Format C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can standardize on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Tool A
Tool B
Tool C
   ↓
 SARIF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Better Tool Interoperability
&lt;/h3&gt;

&lt;p&gt;A SARIF file generated by one tool can be consumed by another platform without modification.&lt;/p&gt;

&lt;p&gt;This makes integrations significantly easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  GitHub Code Scanning Support
&lt;/h3&gt;

&lt;p&gt;One of the biggest reasons SARIF became popular is GitHub Code Scanning.&lt;/p&gt;

&lt;p&gt;GitHub accepts SARIF uploads and automatically displays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security findings&lt;/li&gt;
&lt;li&gt;Code quality issues&lt;/li&gt;
&lt;li&gt;Vulnerabilities&lt;/li&gt;
&lt;li&gt;File-level annotations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;directly inside pull requests and repositories.&lt;/p&gt;

&lt;h3&gt;
  
  
  Easier Aggregation
&lt;/h3&gt;

&lt;p&gt;Organizations often run multiple scanners:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Semgrep
Trivy
Checkov
Gitleaks
Bandit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SARIF makes it possible to combine all findings into a single report.&lt;/p&gt;

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

&lt;p&gt;SARIF is a common language that allows tools to exchange findings in a standard way.&lt;/p&gt;

&lt;p&gt;As the number of security and code analysis tools continues to grow, standards like SARIF help reduce integration complexity and make tool ecosystems work together more effectively.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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" alt="git-lrc" width="360" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding Backpropagation: How Neural Networks Learn from Their Mistakes</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Sat, 06 Jun 2026 19:46:43 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/understanding-backpropagation-how-neural-networks-learn-from-their-mistakes-27i8</link>
      <guid>https://dev.to/ganesh-kumar/understanding-backpropagation-how-neural-networks-learn-from-their-mistakes-27i8</guid>
      <description>&lt;h2&gt;
  
  
  From Linear Regression to Gradient Descent
&lt;/h2&gt;

&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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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 previous parts we discussed about linear regression, gradient descent and how to calculate the optimal slope and intercept using Gradient Descent.&lt;/p&gt;

&lt;p&gt;In this article, we'll build an intuition for backpropagation, understand why it is necessary, and explore how the chain rule and gradient descent work together to enable neural network learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Backpropagation?
&lt;/h2&gt;

&lt;p&gt;Backpropagation is an algorithm used to train neural networks. &lt;/p&gt;

&lt;p&gt;It is a way to adjust the weights and biases of a neural network to reduce the error between the predicted output and the actual output. &lt;/p&gt;

&lt;p&gt;In simple terms, it is a way for the neural network to learn from its mistakes.&lt;/p&gt;

&lt;p&gt;This learning process is powered by an algorithm called &lt;strong&gt;backpropagation&lt;/strong&gt;, one of the most important concepts in machine learning. Backpropagation provides a systematic way for a neural network to determine which internal parameters contributed to an error and how those parameters should be updated to reduce future mistakes.&lt;/p&gt;

&lt;p&gt;Imagine teaching a student to solve math problems. &lt;/p&gt;

&lt;p&gt;After each attempt, you compare the student's answer with the correct one, identify where mistakes occurred, and provide feedback. Over time, the student adjusts their approach and improves. Backpropagation works in a similar way: the network makes a prediction, calculates the error, traces that error backward through the network, and updates its parameters accordingly.&lt;/p&gt;

&lt;p&gt;At its core, backpropagation combines two fundamental mathematical ideas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Chain Rule&lt;/strong&gt; from calculus, which helps determine how changes in one part of the network affect the final error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gradient Descent&lt;/strong&gt;, an optimization technique that uses those calculations to update the network's parameters in the direction that reduces error.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By repeatedly answering these questions across thousands or millions of training examples, neural networks gradually learn patterns hidden within data and become increasingly accurate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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" alt="git-lrc" width="360" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why can't we just use one storage technology for everything?</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Thu, 04 Jun 2026 19:41:14 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/why-cant-we-just-use-one-storage-technology-for-everything-57c7</link>
      <guid>https://dev.to/ganesh-kumar/why-cant-we-just-use-one-storage-technology-for-everything-57c7</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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;Modern computers use multiple storage and memory technologies because no single medium can simultaneously provide massive capacity, ultra-low latency, high bandwidth, and low cost. &lt;/p&gt;

&lt;p&gt;Every level of the memory hierarchy represents a tradeoff between these characteristics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is there a memory hierarchy?
&lt;/h2&gt;

&lt;p&gt;This is because each storage technology has its own advantages and disadvantages. We can't use one storage technology for all the purposes. &lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Fks18859at0gs6ki8iaf2.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Fks18859at0gs6ki8iaf2.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main characteristics to consider are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Capacity&lt;/li&gt;
&lt;li&gt;Latency&lt;/li&gt;
&lt;li&gt;Bandwidth&lt;/li&gt;
&lt;li&gt;Cost&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each Storage technology is optimized for a specific purpose.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
Imagine you have to travel from one place to another.&lt;br&gt;
You can go with walking, bicycle, car, train, or plane.&lt;/p&gt;

&lt;p&gt;Each mode of transport has its own advantages and disadvantages.&lt;/p&gt;

&lt;p&gt;Another better example is think of using LLM model.&lt;/p&gt;

&lt;p&gt;Depending on task complexity and size of data we can choose the model.&lt;/p&gt;

&lt;p&gt;If we mess up with choosing model we will not get the desired output wheather cost will rise, or response will be very low quality.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Ffkbezlinq0263gq2jrs2.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Ffkbezlinq0263gq2jrs2.png" alt=" " width="720" height="813"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Memory Hierarchy
&lt;/h2&gt;

&lt;p&gt;Now I have listed down the memory hierarchy From top to bottom.&lt;/p&gt;

&lt;h3&gt;
  
  
  CPU Registers
&lt;/h3&gt;

&lt;p&gt;This is the fastest storage available inside a processor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; &lt;br&gt;
Stores values currently being operated on by the CPU.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;Extremely small (typically 32 × 64-bit registers per core)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~0.3 ns (about one CPU cycle)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Highest in the system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Highest cost per bit (16 transistors per bit)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  CPU Cache (L1, L2, L3)
&lt;/h3&gt;

&lt;p&gt;A small, ultra-fast memory layer designed to keep frequently used data close to the processor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Reduces the need to access slower main memory.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;Small (tens of MB total)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~7.5 ns (L3 cache)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Extremely high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Very expensive (SRAM, 6 transistors per bit)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  DRAM (Main Memory)
&lt;/h3&gt;

&lt;p&gt;The working memory used by applications and operating systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Holds active programs and data currently being used.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;Typically 32 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~45 ns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;~48 GB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Higher than storage drives&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  GPU VRAM
&lt;/h3&gt;

&lt;p&gt;Memory optimized for throughput rather than low latency.&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; Feeds large amounts of data to thousands of GPU cores simultaneously.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;~24 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~250 ns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Extremely high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Expensive&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  NVMe SSD
&lt;/h3&gt;

&lt;p&gt;High-speed solid-state storage connected through PCIe.&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; Fast persistent storage for operating systems, applications, and files.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;~2 TB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read Latency&lt;/td&gt;
&lt;td&gt;~80 μs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Write Latency&lt;/td&gt;
&lt;td&gt;~500 μs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;~5 GB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;~7 cents per GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  SATA SSD
&lt;/h3&gt;

&lt;p&gt;An older solid-state storage technology using the SATA interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Affordable solid-state storage with lower performance than NVMe.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;Up to ~4 TB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~120 μs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Lower than NVMe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Similar to NVMe SSDs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Hard Disk Drive (HDD)
&lt;/h3&gt;

&lt;p&gt;Mechanical storage using spinning magnetic platters.&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; Lowest-cost local storage for large datasets and archives.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Capacity&lt;/td&gt;
&lt;td&gt;~8 TB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;~8.3–10 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth&lt;/td&gt;
&lt;td&gt;Very low compared to SSDs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;~1–2 cents per GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  The Fundamental Tradeoff
&lt;/h1&gt;

&lt;p&gt;As we move down the memory hierarchy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Capacity increases.&lt;/li&gt;
&lt;li&gt;Cost per GB decreases.&lt;/li&gt;
&lt;li&gt;Latency increases.&lt;/li&gt;
&lt;li&gt;Access speed decreases.&lt;/li&gt;
&lt;li&gt;Distance from the processor increases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="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%2Fjl30723a19ekijvs2jpj.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Fjl30723a19ekijvs2jpj.png" alt=" " width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By leveraging this trade-off, modern computers use a hierarchy of registers, cache, memory, SSDs, HDDs, and cloud storage instead of relying on a single storage technology.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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" alt="git-lrc" width="360" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Credits
&lt;/h2&gt;

&lt;p&gt;Here are the sources that inspired me to write an article on this topic.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=TfhL5kBiQVI&amp;amp;t=145s" rel="noopener noreferrer"&gt;Why Don’t Computers Just Use One Type of Memory?&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>architecture</category>
      <category>computerscience</category>
      <category>performance</category>
      <category>systems</category>
    </item>
    <item>
      <title>From Linear Regression to Gradient Descent</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Thu, 04 Jun 2026 06:14:59 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/from-linear-regression-to-gradient-descent-4k5p</link>
      <guid>https://dev.to/ganesh-kumar/from-linear-regression-to-gradient-descent-4k5p</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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 section, we learned that linear regression finds the best-fitting line by determining the optimal slope and intercept.&lt;/p&gt;

&lt;p&gt;In this article, we will discuss how to calculate the optimal slope and intercept using Gradient Descent.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to calculate the optimal slope and intercept using Gradient Descent
&lt;/h2&gt;

&lt;p&gt;The quality of that line is measured using the Sum of Squared Residuals (SSR), which represents the total prediction error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SSR = sum( (y_observed - y_predicted)^2 )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The best regression line is simply the line that produces the smallest SSR.&lt;/p&gt;

&lt;p&gt;When studying linear regression, it's easy to think that the slope and intercept magically appear from a formula. In reality, they are the values that minimize the prediction error. This is where Gradient Descent comes in.&lt;/p&gt;

&lt;p&gt;Instead of calculating the optimal slope and intercept directly using a closed-form equation, Gradient Descent starts with arbitrary values and gradually improves them. After each step, it measures how the SSR changes and adjusts the parameters in the direction that reduces the error.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-Step Gradient Descent Example
&lt;/h2&gt;

&lt;p&gt;Let's illustrate how Gradient Descent works using the exact same dataset of 4 points from Part 10:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Dataset
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Point 1:&lt;/strong&gt; (1, 2)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Point 2:&lt;/strong&gt; (2, 3)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Point 3:&lt;/strong&gt; (3, 5)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Point 4:&lt;/strong&gt; (4, 4)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Simplifying the Problem
&lt;/h3&gt;

&lt;p&gt;To make the math easy to trace, we will hold the &lt;strong&gt;Slope (m)&lt;/strong&gt; constant at its optimal value of &lt;strong&gt;0.8&lt;/strong&gt; and focus purely on finding the optimal &lt;strong&gt;Intercept (b)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Our prediction equation is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y_predicted = 0.8 * x + b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We start with an initial guess for the intercept: &lt;code&gt;b = 0&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Calculating the Initial SSR (at b = 0)
&lt;/h3&gt;

&lt;p&gt;Let's find the predicted values and calculate the residuals (&lt;code&gt;observed - predicted&lt;/code&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;For Point 1 (1, 2):&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;y_predicted = 0.8 * 1 + 0 = 0.8&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Residual_1 = 2 - 0.8 = 1.2&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;For Point 2 (2, 3):&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;y_predicted = 0.8 * 2 + 0 = 1.6&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Residual_2 = 3 - 1.6 = 1.4&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;For Point 3 (3, 5):&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;y_predicted = 0.8 * 3 + 0 = 2.4&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Residual_3 = 5 - 2.4 = 2.6&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;For Point 4 (4, 4):&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;y_predicted = 0.8 * 4 + 0 = 3.2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Residual_4 = 4 - 3.2 = 0.8&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Now, sum the squared residuals:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SSR = 1.2^2 + 1.4^2 + 2.6^2 + 0.8^2
    = 1.44 + 1.96 + 6.76 + 0.64
    = 10.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Derivation of the Gradient (d(SSR)/db)
&lt;/h3&gt;

&lt;p&gt;To know which direction to move the intercept &lt;code&gt;b&lt;/code&gt; and by how much, we take the derivative of SSR with respect to &lt;code&gt;b&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SSR = sum( (y_observed - (0.8 * x_observed + b))^2 )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Applying the chain rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;d(SSR)/db = sum( 2 * (y_observed - (0.8 * x_observed + b)) * (-1) )
          = -2 * sum( y_observed - y_predicted )
          = -2 * sum( Residuals )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The gradient is simply &lt;strong&gt;-2 times the sum of the residuals&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Updating the Intercept
&lt;/h3&gt;

&lt;p&gt;The update rule is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;b_new = b_old - (Learning Rate * Gradient)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's choose a &lt;strong&gt;Learning Rate (LR)&lt;/strong&gt; of &lt;strong&gt;0.1&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gradient:&lt;/strong&gt; &lt;code&gt;d(SSR)/db = -2 * (1.2 + 1.4 + 2.6 + 0.8) = -2 * 6.0 = -12.0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step Size:&lt;/strong&gt; &lt;code&gt;Gradient * LR = -12.0 * 0.1 = -1.2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New Intercept:&lt;/strong&gt; &lt;code&gt;b_new = 0 - (-1.2) = 1.2&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With &lt;code&gt;b = 1.2&lt;/code&gt;, the predictions are closer to the actual values.&lt;/li&gt;
&lt;li&gt;The new residuals are: &lt;code&gt;0.0&lt;/code&gt;, &lt;code&gt;0.2&lt;/code&gt;, &lt;code&gt;1.4&lt;/code&gt;, and &lt;code&gt;-0.4&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSR:&lt;/strong&gt; &lt;code&gt;0.0^2 + 0.2^2 + 1.4^2 + (-0.4)^2 = 2.16&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gradient:&lt;/strong&gt; &lt;code&gt;-2 * (0.0 + 0.2 + 1.4 - 0.4) = -2.4&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step Size:&lt;/strong&gt; &lt;code&gt;-2.4 * 0.1 = -0.24&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New Intercept:&lt;/strong&gt; &lt;code&gt;b_new = 1.2 - (-0.24) = 1.44&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Step 3 (Convergence):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With &lt;code&gt;b = 1.44&lt;/code&gt;, the new residuals are: &lt;code&gt;-0.24&lt;/code&gt;, &lt;code&gt;-0.04&lt;/code&gt;, &lt;code&gt;1.16&lt;/code&gt;, and &lt;code&gt;-0.64&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gradient:&lt;/strong&gt; &lt;code&gt;-2 * (-0.24 - 0.04 + 1.16 - 0.64) = -0.48&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step Size:&lt;/strong&gt; &lt;code&gt;-0.48 * 0.1 = -0.048&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New Intercept:&lt;/strong&gt; &lt;code&gt;b_new = 1.44 - (-0.048) = 1.488&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;We repeat this loop. As we approach the optimal intercept, the residuals sum up closer to 0, which shrinks the gradient and steps.&lt;/li&gt;
&lt;li&gt;After several iterations, the gradient becomes 0, and the intercept converges to the exact optimal value of &lt;strong&gt;1.5&lt;/strong&gt; (where SSR reaches its minimum value of &lt;strong&gt;1.8&lt;/strong&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

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

&lt;p&gt;We started with an arbitrary intercept of &lt;strong&gt;0&lt;/strong&gt; and adjusted it step-by-step. Each step was guided by the gradient, which told us exactly how much to change the intercept to reduce the prediction error (SSR). We repeated this process until the error reached its minimum.&lt;/p&gt;

&lt;p&gt;While this example focused on a simple linear regression with a single variable, this same principle applies to deep neural networks with millions of parameters. Gradient descent is the engine that drives learning in machine learning.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/4JW4rfheX3U"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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" alt="git-lrc" width="360" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>datascience</category>
      <category>machinelearning</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Mathematical Intuition of Linear Regression</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Tue, 02 Jun 2026 18:19:25 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/mathematical-intuition-of-linear-regression-3n5j</link>
      <guid>https://dev.to/ganesh-kumar/mathematical-intuition-of-linear-regression-3n5j</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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;h2&gt;
  
  
  Linear Regression Line
&lt;/h2&gt;

&lt;p&gt;The line is drawn between two axes, X and Y.&lt;/p&gt;

&lt;p&gt;We can draw infinite lines with different points. But only one will be best fit for the given points.&lt;/p&gt;

&lt;p&gt;For a set of 2D points (x_i,y_i), the simplest linear regression model is:&lt;/p&gt;

&lt;p&gt;y = mx + b&lt;/p&gt;

&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;(m) = slope&lt;/li&gt;
&lt;li&gt;(b) = intercept&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To compute them from your points:&lt;/p&gt;

&lt;p&gt;Slope:&lt;/p&gt;

&lt;p&gt;m = (n∑xy−(∑x)(∑y)) / (n∑x^2−(∑x)^2)&lt;/p&gt;

&lt;p&gt;Intercept:&lt;/p&gt;

&lt;p&gt;b = (∑y−m∑x) / n&lt;/p&gt;

&lt;p&gt;Then your best-fit line is:&lt;/p&gt;

&lt;p&gt;y = mx + b&lt;/p&gt;

&lt;h2&gt;
  
  
  Calculation of Slope
&lt;/h2&gt;

&lt;p&gt;For example points:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;x&lt;/th&gt;
&lt;th&gt;y&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Result:&lt;br&gt;
m = 0.8&lt;br&gt;
b = 1.5&lt;/p&gt;

&lt;p&gt;Best-fit line:&lt;br&gt;
y = 0.8x + 1.5&lt;/p&gt;

&lt;p&gt;Finally we get the result:&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Few64hqcrljd446ltg4jz.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Few64hqcrljd446ltg4jz.png" alt=" " width="361" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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%2Fabn6nl3iehrohehnxgje.png" alt="git-lrc" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Main Idea of Least Squares Method and Linear Regression</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Sun, 31 May 2026 18:41:12 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/main-idea-of-least-squares-method-and-linear-regression-3p9b</link>
      <guid>https://dev.to/ganesh-kumar/main-idea-of-least-squares-method-and-linear-regression-3p9b</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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;Linear Regression is a  method that finds the best fitting line for a set of data points.&lt;/p&gt;

&lt;p&gt;It is used to predict the value of a dependent variable based on the value of one or more independent variables.&lt;/p&gt;

&lt;p&gt;let's assume we have a set of data points $(x_1, y_1), (x_2, y_2), ..., (x_n, y_n)$.&lt;/p&gt;

&lt;p&gt;The data points can be represented as a scatter plot.&lt;/p&gt;

&lt;p&gt;The data points are scattered in a way that it may represent a line.&lt;/p&gt;

&lt;p&gt;where each point $(x_i, y_i)$ represents a data point.&lt;/p&gt;

&lt;p&gt;A line can be represented as $y = mx + b$, where $m$ is the slope and $b$ is the y-intercept.&lt;/p&gt;

&lt;p&gt;Usually, we have some random value of $m$ and $b$ and we want to find the best value of $m$ and $b$ such that the line passes through the data points.&lt;/p&gt;

&lt;p&gt;For example in this graph there are mulitple data points, and we want to find the best fitting line for these data points.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2F0r2evqxp8vh5itokena4.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2F0r2evqxp8vh5itokena4.png" alt=" " width="589" height="604"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This can be done using the least squares method.&lt;/p&gt;

&lt;h2&gt;
  
  
  Least Squares Method
&lt;/h2&gt;

&lt;p&gt;The least squares method is a method that finds the best fitting line for a set of data points.&lt;/p&gt;

&lt;p&gt;we calculate the sum of the squares of the differences between the actual values and the predicted values. &lt;/p&gt;

&lt;p&gt;$(y_i - (mx_i + b))^2$&lt;/p&gt;

&lt;p&gt;We want to minimize this value.&lt;/p&gt;

&lt;p&gt;So, we check each state of line and calculate the sum of the squares of the differences between the actual values and the predicted values. &lt;/p&gt;

&lt;p&gt;We choose the line that minimizes this value.&lt;/p&gt;

&lt;h2&gt;
  
  
  How this is done mathematically
&lt;/h2&gt;

&lt;p&gt;This whole caculation can be done mathematically. I will discuss in depth in my next article.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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%2Fabn6nl3iehrohehnxgje.png" alt="git-lrc" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Beautiful Cube Series Identity That Looks Like Coincidence</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Fri, 29 May 2026 18:37:55 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/the-beautiful-cube-series-identity-that-looks-like-coincidence-1cja</link>
      <guid>https://dev.to/ganesh-kumar/the-beautiful-cube-series-identity-that-looks-like-coincidence-1cja</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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;h2&gt;
  
  
  A Math Identity That Feels Wrong
&lt;/h2&gt;

&lt;p&gt;While playing with number series, I came across something that looked like a coincidence.&lt;br&gt;
Let's start with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;√(1³ + 2³)
= √(1 + 8)
= √9
= 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing special yet.&lt;/p&gt;

&lt;p&gt;But notice:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3 = 1 + 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Interesting.&lt;/p&gt;

&lt;p&gt;Let's add another cube.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;√(1³ + 2³ + 3³)
= √(1 + 8 + 27)
= √36
= 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;6 = 1 + 2 + 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now it starts looking suspicious.&lt;/p&gt;

&lt;p&gt;Let's continue.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;√(1³ + 2³ + 3³ + 4³)
= √100
= 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10 = 1 + 2 + 3 + 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One more:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;√(1³ + 2³ + 3³ + 4³ + 5³)
= √225
= 15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which is exactly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;15 = 1 + 2 + 3 + 4 + 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point most people assume it only works for small numbers.&lt;/p&gt;

&lt;p&gt;Surprisingly, it works for every positive integer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Identity
&lt;/h2&gt;

&lt;p&gt;The pattern can be written as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;√(1³ + 2³ + 3³ + ... + n³)
= 1 + 2 + 3 + ... + n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or equivalently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1³ + 2³ + 3³ + ... + n³
=
(1 + 2 + 3 + ... + n)²
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means the sum of the first n cubes is exactly equal to the square of the sum of the first n natural numbers.&lt;/p&gt;

&lt;p&gt;Many people see this formula for the first time and immediately think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There is no way that should be true.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yet it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing With n = 10
&lt;/h2&gt;

&lt;p&gt;Let's verify it.&lt;/p&gt;

&lt;p&gt;Left side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1³ + 2³ + 3³ + ... + 10³
= 3025
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Right side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(1 + 2 + 3 + ... + 10)²

= 55²

= 3025
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Perfect match.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Mathematicians Love It
&lt;/h2&gt;

&lt;p&gt;Most formulas involving powers become increasingly complicated.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1² + 2² + ... + n²
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;requires a special formula.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1⁴ + 2⁴ + ... + n⁴
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;requires an even more complicated formula.&lt;/p&gt;

&lt;p&gt;But cubes are special.&lt;/p&gt;

&lt;p&gt;They collapse into a perfect square:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1³ + 2³ + ... + n³
=
(1 + 2 + ... + n)²
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is one of the most elegant identities in elementary mathematics.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Closed Form
&lt;/h2&gt;

&lt;p&gt;Since:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 + 2 + 3 + ... + n
=
n(n + 1)/2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can rewrite the cube identity as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1³ + 2³ + 3³ + ... + n³
=
[n(n + 1)/2]²
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is commonly known as the &lt;strong&gt;Sum of Cubes Formula&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It is also associated with &lt;strong&gt;Nicomachus's Theorem&lt;/strong&gt;, a result known for nearly two thousand years.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Mathematics is full of formulas, but only a few make you stop and check your calculator twice.&lt;/p&gt;

&lt;p&gt;The cube series identity is one of them:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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%2Fabn6nl3iehrohehnxgje.png" alt="git-lrc" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>learning</category>
      <category>opensource</category>
      <category>science</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Slope Intercept Form with Gradient Descent</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Sun, 24 May 2026 18:46:14 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/slope-intercept-form-with-gradient-descent-2mdh</link>
      <guid>https://dev.to/ganesh-kumar/slope-intercept-form-with-gradient-descent-2mdh</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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;h2&gt;
  
  
  Slope-Intercept Form equation
&lt;/h2&gt;

&lt;p&gt;A residual is the difference between the actual y value and the predicted y value.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Fc08uhsnswashf8anx9o0.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Fc08uhsnswashf8anx9o0.png" alt=" " width="646" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Residule = (Actual Y - Predicted Y)&lt;/p&gt;

&lt;p&gt;Finally, the residual is squared, and the sum of all the residuals is calculated, which is called the Mean Squared Error (MSE).&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2F7yuqgxud1bbfssmcsppb.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2F7yuqgxud1bbfssmcsppb.png" alt=" " width="766" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Residual)^2 is nothing but the vertical distance between the predicted line and the actual data points, squared.&lt;/p&gt;

&lt;p&gt;The lesser the value, the greater the accuracy.&lt;/p&gt;

&lt;p&gt;Using this Mean Squared Error (MSE), we can adjust the slope and y-intercept to minimize the error.&lt;/p&gt;

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

&lt;p&gt;Will discuss Gradient Descent in the next part.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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%2Fabn6nl3iehrohehnxgje.png" alt="git-lrc" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;br&gt;
Slope Intercept Form with Gradient Descent&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>Slope-Intercept Form equation</title>
      <dc:creator>Ganesh Kumar</dc:creator>
      <pubDate>Fri, 22 May 2026 13:00:13 +0000</pubDate>
      <link>https://dev.to/ganesh-kumar/slope-intercept-form-equation-2ng</link>
      <guid>https://dev.to/ganesh-kumar/slope-intercept-form-equation-2ng</guid>
      <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="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&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;&lt;a href="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%2F1apx67p1kpxxkwezouy9.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2F1apx67p1kpxxkwezouy9.png" alt=" " width="800" height="558"&gt;&lt;/a&gt;&lt;br&gt;
In above image we got Y = Intercept + (Slope x X)&lt;/p&gt;

&lt;p&gt;Also writen as&lt;br&gt;
y = mx + b&lt;/p&gt;

&lt;p&gt;where&lt;br&gt;
y = Intercept + (Slop x X)&lt;br&gt;
y = output / dependent variable&lt;br&gt;
x = input / independent variable&lt;br&gt;
m = slope (rate of change)&lt;br&gt;
b = y-intercept (starting value)&lt;/p&gt;

&lt;p&gt;Why is this formula used?&lt;/p&gt;

&lt;p&gt;This formula is used to represent a linear relationship, meaning something changes at a constant rate.&lt;/p&gt;

&lt;p&gt;It helps answer.&lt;/p&gt;

&lt;p&gt;Where does the line start?&lt;br&gt;
How fast does it increase or decrease?&lt;/p&gt;

&lt;p&gt;Basically making it more like how the graph is drawn in math.&lt;/p&gt;

&lt;p&gt;Using this equation, we can get the y value for a given x value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It is used in Neural Networks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The above linear equation is the Core building block of a neuron but with many inputs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/HexmosTech/git-lrc" rel="noopener noreferrer"&gt;&lt;img src="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%2Fabn6nl3iehrohehnxgje.png" alt="git-lrc" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;⭐ &lt;a href="https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
