<?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 Muhammad Shazil Khan on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Shazil Khan on Medium]]></description>
        <link>https://medium.com/@shazilkhannew?source=rss-2369a40acd23------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ll8BseYWTpicVhJ6A3I0hw.jpeg</url>
            <title>Stories by Muhammad Shazil Khan on Medium</title>
            <link>https://medium.com/@shazilkhannew?source=rss-2369a40acd23------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 22:04:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shazilkhannew/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[Vanishing Gradient Problem in Backpropagation]]></title>
            <link>https://medium.com/@shazilkhannew/vanishing-gradient-problem-in-backpropagation-cd9bc2303e04?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd9bc2303e04</guid>
            <category><![CDATA[backpropagation]]></category>
            <category><![CDATA[vanishing-gradient]]></category>
            <category><![CDATA[gradient]]></category>
            <category><![CDATA[deep-neural-networks]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 14:00:37 GMT</pubDate>
            <atom:updated>2026-09-20T14:00:37.914Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5oQMUXnKYxFIH-XNZloHDA.png" /><figcaption>Vanishing Gradient Problem</figcaption></figure><h3>What is the Vanishing Gradient Problem?</h3><p>In deep learning, when we train an artificial neural network, we update the weights so that the loss is reduced. The weights are updated in the backpropagation step, where we take the partial derivatives of the loss and update each weight according to this equation:</p><p>W_new = W_old − η × (∂L / ∂W)</p><p>Here, η is the learning rate.</p><p>The partial derivative is a multiplication of many derivatives (the chain rule). If you multiply very small values together, the result is also very small. When you subtract that small value from the old weight, the change is tiny, which means the new weight is essentially unchanged and the neural network is not training. Your loss will stay the same.</p><p>For a deep network, the gradient is essentially a product of many derivatives:</p><p>If these derivatives are small numbers, multiplying many of them together makes the gradient extremely small.</p><p>0.5 × 0.5 × 0.5 × 0.5 = 0.0625</p><p>After 20 layers:</p><p>0.5²⁰ ≈ 0.000001</p><p>So the gradient almost becomes zero.</p><h3>How to Identify the Vanishing Gradient Problem?</h3><p>Focus on the loss. If the loss stays constant and is not changing, it is a sign of a vanishing gradient problem.</p><p>Another way is to plot a graph between any weight and the epoch. If the weight value does not change over the epochs, and the line is constant, that is also a sign of a vanishing gradient problem.</p><p>When the loss is not reducing, there is a vanishing gradient problem. In backpropagation, when you try to change the weight, it either doesn’t change or the change is so small that it is effectively equal to no change.</p><h3>How to Handle the Vanishing Gradient Problem?</h3><p><strong>1. Reduce the number of layers.</strong> With fewer layers, you multiply fewer derivatives, so the resulting value is larger and there is enough change in the weights.</p><p>However, you can only do this if you have linear patterns to capture, because increasing the number of layers is what lets a network capture complex patterns. If you have complex patterns to capture, you cannot reduce the layers of your neural network.</p><p>2. <strong>Use the ReLU activation function.</strong></p><p>ReLU stands for <strong>Rectified Linear Unit</strong>:</p><p><strong>ReLU(x) = max(0, x)</strong></p><p>So:</p><ul><li>If x &gt; 0, ReLU gives x</li><li>If x ≤ 0, ReLU gives 0</li></ul><p>Its derivative is:</p><p>ReLU′(x) = 1 if x &gt; 0</p><p>ReLU′(x) = 0 if x &lt; 0</p><p><strong>When the input is positive:</strong></p><p>ReLU′(x) = 1</p><p>So the gradient is multiplied by 1, meaning it is not reduced<strong> </strong>by the activation function.</p><p>For example:</p><p>0.9 × 1 × 1 × 1 × 1 = 0.9</p><p>The gradient can pass backward through those ReLU activations without being repeatedly shrunk.</p><h3>How is the Derivative of ReLU Calculated?</h3><p><strong>Case 1: x &lt; 0</strong></p><p>For negative values:</p><p><strong>ReLU(x) = 0</strong></p><p>The derivative of a constant is 0:</p><p><strong>d/dx (0) = 0</strong></p><p>Therefore:</p><p><strong>ReLU′(x) = 0</strong></p><p><strong>Case 2: x &gt; 0</strong></p><p>For positive values:</p><p><strong>ReLU(x) = x</strong></p><p>The derivative of x with respect to x is:</p><p><strong>d/dx (x) = 1</strong></p><p>Therefore:</p><p><strong>ReLU′(x) = 1</strong></p><p>So we get:</p><p>ReLU′(x) = 0 if x &lt; 0</p><p>ReLU′(x) = 1 if x &gt; 0</p><h3>Conclusion</h3><p>The vanishing gradient problem is one of the main reasons deep neural networks fail to train. During backpropagation, the gradient is a product of many derivatives, and when those derivatives are small, the product shrinks toward zero. The weights then barely change, and the loss stops improving.</p><p>You can spot it when the loss stays flat across epochs or when a weight’s value stays constant over time. Reducing the number of layers helps, but only when your data has simple patterns, since complex patterns need deeper networks.</p><p>A more practical fix is the ReLU activation function. Its derivative is 1 for positive inputs, so the gradient passes backward through those layers without being shrunk at every step. This is why ReLU became the default choice in modern deep networks.</p><p>ReLU is not the only solution, though, and it has limitations of its own. There are other techniques for handling the vanishing gradient problem, which we will cover in the next articles.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd9bc2303e04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Memoization in Backpropagation]]></title>
            <link>https://medium.com/@shazilkhannew/memoization-in-backpropagation-25f7b4230f87?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/25f7b4230f87</guid>
            <category><![CDATA[memoization]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[backpropagation]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Sat, 19 Sep 2026 00:52:12 GMT</pubDate>
            <atom:updated>2026-09-19T00:52:12.789Z</atom:updated>
            <content:encoded><![CDATA[<p>How caching a single derivative can save a neural network from repeating the same work over and over</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c4YA5ohElbdHZ2eclo8_1A.png" /></figure><p>Consider the neural network above. It has one input layer, two hidden layers, and one output layer.</p><h3>Why backpropagation gets expensive</h3><p>When we train a neural network, we use backpropagation to update the weights in a way that reduces the loss. As we move backward through the network and calculate derivatives, the amount of computation grows with every additional layer.</p><p>If you look closely, you will notice something wasteful: many of these derivatives are computed again and again, even though each one only needs to be computed once. We can compute a value once, store it, and reuse it whenever the same derivative is needed again. This reduces the time complexity of the derivative calculations at the cost of a little extra storage.</p><h3>What is memoization?</h3><p>This technique is called <strong>memoization</strong>. It comes from computer science, and we apply it here to make computation faster. Formally:</p><blockquote><em>Memoization is an optimization technique used to store the results of expensive computations, and to return the cached result whenever the same input occurs again.</em></blockquote><h3>Updating a weight in layer 3</h3><p>To see this clearly, let’s say we are updating the weight w₁₁ of layer 3 and calculating its derivative. Since the loss L depends on the prediction ŷ, and ŷ depends directly on this weight, the chain rule gives:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*F-nL_LSh4K2j-iksW3RNGQ.png" /></figure><h3>Updating a weight in layer 2</h3><p>Now let’s say we are updating the weight w₁₁ of layer 2. The chain gets one link longer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*CBBtnPLrkT7VAPK89ATSVw.png" /></figure><p>Both equations come straight from the <strong>chain rule of differentiation</strong>. Here is the intuition behind the second one:</p><ul><li>The loss L depends on the prediction ŷ.</li><li>The prediction ŷ (which equals o₃₁) depends on the output o₂₁ of the neuron in layer 2.</li><li>The output o₂₁ depends on the weight w₁₁⁽²⁾.</li></ul><p>Multiplying the derivative of each link together gives us the derivative we want.</p><h3>Where memoization comes in</h3><p>Notice this term: ∂L / ∂ŷ</p><p>We already computed it when updating w₁₁ of layer 3, and it appears again in the derivative for w₁₁ of layer 2. Instead of recalculating it, we can store the value the first time and reuse it. That is memoization, and it directly reduces the time complexity of backpropagation.</p><h3>Why this matters</h3><p>The benefit grows as networks get deeper. To update the weights in the earliest layers of a complex network, backpropagation needs a long chain of derivative calculations, and many of those factors are shared with the layers that came after them. By caching each shared term once and reusing it, we avoid recomputing the same values at every layer. That is a big part of what makes training deep neural networks practical.</p><h3>Conclusion</h3><p>Backpropagation is essentially the chain rule applied layer by layer, and the chain rule produces many repeated terms. Memoization turns that repetition into an advantage: compute a derivative once, store it, and reuse it wherever it appears again. The next time you see backpropagation working through a deep network, remember that a simple idea from computer science is quietly doing a lot of the heavy lifting</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25f7b4230f87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Containerization: Why It Matters and How It Works]]></title>
            <link>https://aws.plainenglish.io/docker-containerization-why-it-matters-and-how-it-works-b6cfa581df22?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6cfa581df22</guid>
            <category><![CDATA[how-containers-work]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[how-docker-works]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Wed, 01 Oct 2025 04:55:45 GMT</pubDate>
            <atom:updated>2025-10-01T04:55:45.176Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the biggest challenges in software development is dealing with <strong>application dependencies</strong>. Every system may have different versions of libraries, runtimes, or configurations, which often leads to errors during setup. What works on one machine may fail on another.</p><p>For example, imagine a programming team working on the same project. If you want to share the application with a teammate, you’d normally have to explain how to install and configure all the required dependencies exactly the same way you did. This process is time-consuming and error-prone.</p><p>When we want to run multiple applications on a single machine, one option is to use <strong>Virtual Machine (VM) architecture</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/0*j0xodPVhiZ97VnDF.png" /></figure><h3>What is Virtual Machine Architecture?</h3><p>You start with your <strong>physical machine (hardware)</strong>. On top of this hardware, you install an <strong>Operating System (OS)</strong>. Then, you install a <strong>Virtual Machine Manager (VMM)</strong>, also called a hypervisor.</p><p>The VMM allows you to create and manage multiple <strong>Virtual Machines</strong>. Each VM behaves like a complete physical machine, so you can install a separate <strong>Guest Operating System</strong> inside it. On top of that guest OS, you install and run your applications.</p><h3>Drawbacks of Virtual Machines</h3><p>While powerful, this setup is heavy on computation and storage because multiple operating systems are running at once: the <strong>host OS</strong> and one or more <strong>guest OSes</strong>. For example, if you want to run two applications in separate environments, you’ll need two VMs meaning three operating systems in total.</p><p>This not only consumes more resources but also makes configuration and setup more complex.</p><h3>How Communication Works in VMs</h3><p>Operating systems need to communicate with hardware through system calls. In the VM setup, a call from your application has to pass through multiple layers:</p><ul><li><strong>App → Guest OS → Virtual Machine → Host OS → Hardware</strong></li></ul><p>Each layer translates the call for the next, which adds overhead.</p><p>You can think of it like translating a language step by step:</p><ul><li>Your app speaks Persian.</li><li>The guest OS translates Persian → French.</li><li>The VM translates French → English.</li><li>The host OS translates English → German (the hardware’s “language”).</li></ul><p>This works, but it’s slow and inefficient.</p><h3>Enter Container Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*v7zL5Wy6iRRcH4Jq.png" /></figure><p>What if you could translate <strong>directly from Persian to German</strong>, without going through multiple layers? That’s essentially what <strong>Container Architecture</strong> does.</p><p>In this model, you have:</p><ul><li><strong>Hardware → Host OS → Container Manager → Applications</strong></li></ul><p>Instead of creating a full guest OS for each app, you only need a lightweight <strong>container manager</strong> (such as Docker). Your applications run in isolated containers, which share the host OS kernel.</p><h3>Benefits of Containers</h3><ul><li><strong>Lightweight</strong>: No need to run multiple full operating systems.</li><li><strong>Efficient</strong>: Apps communicate directly through the container manager to the host OS.</li><li><strong>Portable</strong>: As long as a system has a container manager, you can run your app container anywhere — on your laptop, a remote server, or a cloud VM.</li></ul><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/0*P7WU-T13Tk2Pxem0.png" /></figure><ul><li><strong>Cross-platform flexibility</strong>: For example, with Docker, you can run Linux apps on Windows, Windows apps on Linux, and so on.</li></ul><p>In short:</p><ul><li><strong>Virtual Machines</strong> = Heavyweight, with multiple OS layers and high resource usage.</li><li><strong>Containers</strong> = Lightweight, portable, and efficient, since they eliminate the need for a guest OS.</li></ul><h3>Containers and How They Work</h3><p>Containers can be created in two ways:</p><ol><li><strong>On a physical server</strong> — You install a containerization platform (like Docker) directly on the host operating system and then run containers on top of it.</li><li><strong>On a virtual machine</strong> — You first create a VM (for example, on AWS, Azure, or Google Cloud), install a containerization platform inside it, and then run containers there.</li></ol><p>The important point is that <strong>containerization platforms don’t care</strong> whether they are running on a physical machine or on top of a VM. This flexibility is why most companies prefer running containers on cloud-based VMs rather than maintaining their own physical data centers.</p><h3>Containers vs Virtual Machines</h3><ul><li><strong>Virtual Machines (VMs):</strong> Each VM has a <strong>complete operating system</strong>, making them <strong>heavyweight</strong> and resource-intensive.</li><li><strong>Containers:</strong> Containers are <strong>lightweight</strong> because they share the host operating system kernel. They don’t include a full OS; instead, they rely on a <strong>minimal operating system image</strong>, often called a <strong>base image</strong>.</li></ul><h3>What a Container Includes</h3><p>A container is essentially a <strong>package (or bundle)</strong> that contains:</p><ul><li>The <strong>application code</strong></li><li>Required <strong>libraries</strong></li><li>Necessary <strong>system dependencies</strong> (e.g., Python runtime, Node.js, etc.)</li></ul><p>Because containers do not carry a full operating system, they:</p><ul><li>Are <strong>lightweight</strong></li><li><strong>Start quickly</strong></li><li>Are <strong>easy to ship, deploy, and move</strong> across environments</li></ul><h3>Docker as a Containerization Platform</h3><p>Docker is the most popular containerization platform. The process of creating a container usually looks like this:</p><ol><li>Write a <strong>Dockerfile</strong> — which defines the app, its dependencies, and base image.</li><li>Submit the Dockerfile to the <strong>Docker Engine</strong>.</li><li>The Docker Engine builds an <strong>image</strong> from the Dockerfile.</li><li>Using commands, you can run a <strong>container</strong> from that image.</li></ol><p><strong>In summary:</strong></p><ul><li>Containers are lightweight because they share the host OS.</li><li>They package everything the application needs (code, libraries, dependencies).</li><li>Docker makes building and running containers simple and portable.</li><li>Unlike VMs, containers don’t include a full OS, making them faster, smaller, and easier to ship.</li></ul><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6cfa581df22" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/docker-containerization-why-it-matters-and-how-it-works-b6cfa581df22">Docker Containerization: Why It Matters and How It Works</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Containerization: Why It Matters and How It Works]]></title>
            <link>https://medium.com/@shazilkhannew/why-we-use-docker-containerization-4435b05af054?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/4435b05af054</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 12:08:43 GMT</pubDate>
            <atom:updated>2025-09-14T13:41:53.470Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the biggest challenges in software development is dealing with <strong>application dependencies</strong>. Every system may have different versions of libraries, runtimes, or configurations, which often leads to errors during setup. What works on one machine may fail on another.</p><p>For example, imagine a programming team working on the same project. If you want to share the application with a teammate, you’d normally have to explain how to install and configure all the required dependencies exactly the same way you did. This process is time-consuming and error-prone.</p><p>When we want to run multiple applications on a single machine, one option is to use <strong>Virtual Machine (VM) architecture</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*zyKhPOTAObuBifkHgvIRfA.png" /></figure><h3>What is Virtual Machine Architecture?</h3><p>You start with your <strong>physical machine (hardware)</strong>. On top of this hardware, you install an <strong>Operating System (OS)</strong>. Then, you install a <strong>Virtual Machine Manager (VMM)</strong>, also called a hypervisor.</p><p>The VMM allows you to create and manage multiple <strong>Virtual Machines</strong>. Each VM behaves like a complete physical machine, so you can install a separate <strong>Guest Operating System</strong> inside it. On top of that guest OS, you install and run your applications.</p><h3>Drawbacks of Virtual Machines</h3><p>While powerful, this setup is heavy on computation and storage because multiple operating systems are running at once: the <strong>host OS</strong> and one or more <strong>guest OSes</strong>. For example, if you want to run two applications in separate environments, you’ll need two VMs meaning three operating systems in total.</p><p>This not only consumes more resources but also makes configuration and setup more complex.</p><h3>How Communication Works in VMs</h3><p>Operating systems need to communicate with hardware through system calls. In the VM setup, a call from your application has to pass through multiple layers:</p><ul><li><strong>App → Guest OS → Virtual Machine → Host OS → Hardware</strong></li></ul><p>Each layer translates the call for the next, which adds overhead.</p><p>You can think of it like translating a language step by step:</p><ul><li>Your app speaks Persian.</li><li>The guest OS translates Persian → French.</li><li>The VM translates French → English.</li><li>The host OS translates English → German (the hardware’s “language”).</li></ul><p>This works, but it’s slow and inefficient.</p><h3>Enter Container Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*p4G-q5suY-L6zFwWYv2eGA.png" /></figure><p>What if you could translate <strong>directly from Persian to German</strong>, without going through multiple layers? That’s essentially what <strong>Container Architecture</strong> does.</p><p>In this model, you have:</p><ul><li><strong>Hardware → Host OS → Container Manager → Applications</strong></li></ul><p>Instead of creating a full guest OS for each app, you only need a lightweight <strong>container manager</strong> (such as Docker). Your applications run in isolated containers, which share the host OS kernel.</p><h3>Benefits of Containers</h3><ul><li><strong>Lightweight</strong>: No need to run multiple full operating systems.</li><li><strong>Efficient</strong>: Apps communicate directly through the container manager to the host OS.</li><li><strong>Portable</strong>: As long as a system has a container manager, you can run your app container anywhere — on your laptop, a remote server, or a cloud VM.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*OGRi-mEsI3sYPLoLqF0BtQ.png" /></figure><ul><li><strong>Cross-platform flexibility</strong>: For example, with Docker, you can run Linux apps on Windows, Windows apps on Linux, and so on.</li></ul><p>In short:</p><ul><li><strong>Virtual Machines</strong> = Heavyweight, with multiple OS layers and high resource usage.</li><li><strong>Containers</strong> = Lightweight, portable, and efficient, since they eliminate the need for a guest OS.</li></ul><h3>Containers and How They Work</h3><p>Containers can be created in two ways:</p><ol><li><strong>On a physical server</strong> — You install a containerization platform (like Docker) directly on the host operating system and then run containers on top of it.</li><li><strong>On a virtual machine</strong> — You first create a VM (for example, on AWS, Azure, or Google Cloud), install a containerization platform inside it, and then run containers there.</li></ol><p>The important point is that <strong>containerization platforms don’t care</strong> whether they are running on a physical machine or on top of a VM. This flexibility is why most companies prefer running containers on cloud-based VMs rather than maintaining their own physical data centers.</p><h3>Containers vs Virtual Machines</h3><ul><li><strong>Virtual Machines (VMs):</strong> Each VM has a <strong>complete operating system</strong>, making them <strong>heavyweight</strong> and resource-intensive.</li><li><strong>Containers:</strong> Containers are <strong>lightweight</strong> because they share the host operating system kernel. They don’t include a full OS; instead, they rely on a <strong>minimal operating system image</strong>, often called a <strong>base image</strong>.</li></ul><h3>What a Container Includes</h3><p>A container is essentially a <strong>package (or bundle)</strong> that contains:</p><ul><li>The <strong>application code</strong></li><li>Required <strong>libraries</strong></li><li>Necessary <strong>system dependencies</strong> (e.g., Python runtime, Node.js, etc.)</li></ul><p>Because containers do not carry a full operating system, they:</p><ul><li>Are <strong>lightweight</strong></li><li><strong>Start quickly</strong></li><li>Are <strong>easy to ship, deploy, and move</strong> across environments</li></ul><h3>Docker as a Containerization Platform</h3><p>Docker is the most popular containerization platform. The process of creating a container usually looks like this:</p><ol><li>Write a <strong>Dockerfile</strong> — which defines the app, its dependencies, and base image.</li><li>Submit the Dockerfile to the <strong>Docker Engine</strong>.</li><li>The Docker Engine builds an <strong>image</strong> from the Dockerfile.</li><li>Using commands, you can run a <strong>container</strong> from that image.</li></ol><p><strong>In summary:</strong></p><ul><li>Containers are lightweight because they share the host OS.</li><li>They package everything the application needs (code, libraries, dependencies).</li><li>Docker makes building and running containers simple and portable.</li><li>Unlike VMs, containers don’t include a full OS, making them faster, smaller, and easier to ship.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4435b05af054" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Idea Behind Gradient Descent In Machine Learning]]></title>
            <link>https://medium.com/@shazilkhannew/the-idea-behind-gradient-descent-in-machine-learning-4c3e1f04edb8?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c3e1f04edb8</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[gradient-descent]]></category>
            <category><![CDATA[hill-climbing]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Sat, 30 Aug 2025 21:52:22 GMT</pubDate>
            <atom:updated>2025-09-14T21:08:48.041Z</atom:updated>
            <content:encoded><![CDATA[<p>Gradient Descent is one of the most well-known algorithms in Machine Learning, but instead of just memorizing its formula, it’s important to understand the intuition behind it.</p><p>Let’s break it down with a simple example:</p><p>Suppose we have a dataset with two columns let’s call them <strong>x</strong> and <strong>y</strong>. Here, <strong>x</strong> serves as the independent variable, while <strong>y</strong> is the dependent variable.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/0*YMrYXE6--iFn61wP.png" /></figure><p>This is real-world data, and our goal is to gather insights and identify trends so that we can predict <strong>y</strong> based on <strong>x</strong> (which is not present in the dataset) with the minimum possible error.</p><p>To capture the trend that is, how the data is behaving we need to find the <strong>line of best fit</strong>, which serves as our prediction model.</p><p>But what exactly is the line of best fit? It is the line that best represents the overall pattern of the dataset, minimizing the difference between the actual data points and the predicted values.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/0*erKVZdIVebbz5vu-.png" /></figure><p>Let’s say I randomly guess that the red line is the best fit because it seems to align with the dataset quite well. However, my friend suggests that the green line might be a better choice since it appears to cover most of the data points.</p><p>So, the question is: <strong>Which line should we choose?</strong></p><p>A linear line is defined as:</p><p><strong>y = mx + b</strong></p><p>where <strong>m</strong> is the slope and <strong>b</strong> is the y-intercept.</p><p>The answer is that we should choose the line for which the <strong>total error</strong> is minimized in other words, the line that results in the smallest difference between the predicted values and the actual data points.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/0*SQ7nZ9k3zbE517dW.png" /></figure><p>The blue vertical line in the figure represents the difference between the actual value (ground truth) and the predicted value from the model. When we take the absolute sum of all these differences, we get the <strong>absolute error</strong>.</p><p><strong>Note</strong>: There are some problems with the absolute error function, so we take Mean Squarred Error as our Error/Loss function and its graphical shape is bowl or covex</p><p>Our goal is to make this error as small as possible, because the line with the smallest error best captures the trend in the real-world data.</p><p>Similarly, we can do the same process for the green line and for all other possible lines that could fit the data.</p><p>If we carefully look at the linear equation <strong>y = mx + b</strong>, the key factor we need to determine is the slope (<strong>m</strong>), since the intercept (<strong>b</strong>) only shifts the line up or down without changing its angle.</p><p>This leads us to an important question: <strong>Which value of “m” should we choose so that the error is minimized?</strong></p><p>To explore this, let’s consider another plot that shows the relationship between the <strong>error</strong> and the <strong>slope value (m)</strong>.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*cy6YwkDjPZgMbzyu.png" /></figure><p>Now, consider this as the <strong>error function</strong> also known as the <strong>loss function</strong> or <strong>cost function</strong>. Our goal is to perform <strong>optimization</strong>, which essentially asks: <em>Given a function, can we find its minimum value?</em></p><p>In this case, we want to find the point where the error is minimized.</p><p><strong>Important to note:</strong> we are not directly interested in the minimum error itself; rather, we want to determine the value of <strong>m</strong> (the slope) that produces this minimum error.</p><p>The question then becomes: <strong>How do we actually find this optimal value of “m”?</strong></p><p>We begin with an initial random guess for <strong>m</strong> and then compute the corresponding error, as shown in the figure below.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*5rgitSl-itDHv-uh.png" /></figure><p>Let’s quickly revisit some calculus. The <strong>derivative</strong> tells us the direction in which we should move. In fact, the derivative represents the <strong>slope</strong> of the function at a given point.</p><ul><li>If the derivative is <strong>negative</strong>, it means that as <strong>x</strong> increases, <strong>y</strong> decreases.</li><li>If the derivative is <strong>positive</strong>, it means that as <strong>x</strong> increases, <strong>y</strong> also increases.</li></ul><p>So, starting with a random guess for <strong>m</strong>, we compute the derivative at that point. This gives us two possible cases:</p><ul><li>If the slope is <strong>negative (−ve)</strong> ⇒ we should <strong>increase the value of m</strong>.</li><li>If the slope is <strong>positive (+ve)</strong> ⇒ we should <strong>decrease the value of m</strong>.</li></ul><p>as ultimately we want to move towards the minimum value of y ( error )</p><p>lets write it mathematically</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WPOucADnAXYgaGcn.png" /></figure><p>you can see here that both the formulas are same so we donot need to handle the cases separately</p><p>There is one more problem, if the deriivative at a point is too small or too large then you end up adding a very large value or very small that will eventually overshoot the range of x.</p><p>For example, if <strong>x = 5</strong> and the derivative is <strong>1000</strong>, the update will push <strong>x</strong> far outside the desired range.</p><p>To fix this, we scale the derivative by multiplying it with a very small constant. This reduces its magnitude, making the update step manageable and keeping <strong>x</strong> within a reasonable range.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UpZUh4-Gukg5gX9u.png" /></figure><p>This constant <strong>α</strong> is known as a <strong>hyperparameter</strong>, meaning it is set manually by humans rather than learned by the model. It is commonly referred to as the <strong>learning rate</strong>.</p><p>However, choosing the right value of <strong>α</strong> can be tricky. If <strong>α</strong> is set too small, then when the derivative itself is already small, the resulting update becomes extremely tiny. This means <strong>x</strong> will move in very small steps, making little to no progress. On the other hand, if <strong>α</strong> is too large, it can cause the updates to overshoot the optimal value.</p><p>Therefore, the value of <strong>α</strong> must be chosen carefully based on the situation to ensure efficient learning.</p><p>If <strong>x</strong> is changing with very large step sizes, or if the gap between consecutive values of <strong>x</strong> keeps increasing, it means the updates are <strong>diverging</strong>. This indicates that the learning rate is too high, and you need to decrease it.</p><p>On the other hand, if <strong>x</strong> is changing by only very small step sizes, it means the learning rate is too low, and you need to increase it.</p><p>This article suggests the idea behind gradient descent on which the modern machine learning works.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c3e1f04edb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Large Language Models Works (LLMs): High-level Guide]]></title>
            <link>https://medium.com/@shazilkhannew/how-large-language-models-works-llms-high-level-guide-ebea5036c737?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebea5036c737</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Thu, 02 Jan 2025 14:05:52 GMT</pubDate>
            <atom:updated>2025-01-09T10:01:55.217Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Large Language Models Work (LLMs): High-level Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*rmsdkvXmYiSOHCeYt9EF4w.jpeg" /></figure><p>You’re probably using AI bots like ChatGPT, Gemini, and others for your daily tasks — even finding recipes for your favorite foods. But have you ever wondered about the technology behind these generative models? let me introduce you about Large Language Models.</p><p>Large Language Models (LLMs) have become an integral part of modern technology, powering everything from chatbots to translation tools. This guide explains how these models work in clear, simple terms.</p><p>If you’re new to AI but have heard fancy terms like machine learning, deep learning, and neural networks, don’t worry. I’ll help you understand how LLMs work and guide you into the world of AI.</p><p>This is not a deep dive into technical details, but rather a simple overview with essential information to help you understand LLMs.</p><h3>The World of Artificial intelligence.</h3><p>AI is “the ability of computers to simulate human-like thinking and decision-making”, AI is the simulation of human intelligence in machines, enabling them to think, learn, and make decisions.</p><h3>Machine Learning</h3><p>“<strong><em>Machine Learning from the data.</em></strong>“</p><p>The essence of machine learning is that machines are trained on large amounts of data to recognize patterns. Once a machine learns these patterns, it can apply them to new, unseen data to test how well it performs on random samples.</p><h3>Deep Learning</h3><p>Deep learning is a subset of machine learning. The idea behind deep learning is to simulate the human brain’s neural networks and its powers using artificial networks of neurons.</p><h3>Large Language Models</h3><p>Now comes the LLMs the magic behind text generation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*Ue3O40ZQ7gVRu8ji7D3aUQ.png" /></figure><p>Now you know the big picture and where the LLM lies.</p><h3>Encoder-Decoder Architecture</h3><p>First, let’s understand the encoder-decoder architecture.</p><p>The <strong>encoder-decoder architecture</strong> is a neural network framework widely used in sequence-to-sequence (seq2seq) tasks such as machine translation, text summarization, and image captioning.</p><p>but what is seq2seq tasks or sequence to sequence learning. It refers to transforming one sequence of data into another sequence of data. It is commonly used in machine learning for tasks where the input and output are sequences, which can vary in length.</p><p>There are two main components in this architecture. The goal is to create an output sequence from an input sequence — one example can be, taking a sequence of text and translating it into French or German.</p><h3>Encoder:</h3><p>The encoder’s task is to process the input sequence, which consists of data or words that are fed into it.</p><p><strong>Input:</strong> The Input sequence X = { x1, x2, … xi }, where xi represent each element ( eg: word embeddings )</p><p>Word embeddings is <strong>a technique used in natural language processing (NLP) to represent words as numbers so that computers can work with them.</strong></p><p><strong>Operation:</strong></p><p>Inside the encoder, there are various neural network mechanisms at work, including Recurrent Neural Networks (RNN), Long Short-Term Memory (LSTM), Gated Recurrent Units (GRU), and Convolutional Neural Networks (CNN). We’ll skip the technical details of how these deep learning networks operate.</p><ul><li>Each input token is processed in sequence. ( like one word is processed at a time from the sentence )</li><li>Hidden states capture contextual information.</li><li>The final hidden state or sequence of hidden states represents the input sequence.</li></ul><p><strong>Output:</strong> A fixed-size vector representation of the input sequence called context vector and is send to the decoder. This context vector encapsulates the input sequence’s meaning or information.</p><h3>Decoder</h3><p>The decoder generates the output sequence Y = { y1,y2, … yn } based on the context vector produced by the encoder</p><p><strong>Input:</strong> The context vector from the encoder and (optionally) the previous output token.</p><p><strong>Operation:</strong> Like the encoder, the decoder is often an RNN, LSTM, or GRU. At each time step:</p><ul><li>It takes the previous hidden state, the previous output, and the context vector to predict the next token.</li><li>A softmax layer converts the output into probabilities over the vocabulary.</li></ul><p><strong>Output:</strong> The predicted sequence Y.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yMLVoOIGA1NHSZKIWbYsBQ.png" /><figcaption>encoder-decoder workings</figcaption></figure><p>What are the problems and challenges with sequence-to-sequence learning in encoder-decoder architecture?</p><p>The main challenge is that the context vector must compress all input information into a fixed length vector. If the sequence is too long, say 200 words, the encoder begins missing some words. or a context vector is not able to remember long input sequences, as it tends to forget the earlier parts of the sequence.</p><p>To actually tackle this challenge there is another mechanism introduced namely “Attention Mechanism”</p><p>Now lets understand what is Attention mechanism.</p><h3>Attention Mechanism:</h3><p>This mechanism is same as the enocder decoder architecture, the encoder works as same but the difference is in the decoder block.</p><p>Instead of using a single context vector, multiple context vectors are used, with each one referring to different parts of the input text.</p><p>This allows the model to focus on the most relevant parts of the input sequence while generating each output element, solving the problem of information loss when encoding long sequences into a single context vector.</p><p>we will not go into the mathemical details of this mechanism but will grab the high level overview to clearly understand.</p><p>The attention mechanism works by assigning different weights to different parts of the input data, indicating their relative importance to the current step of the output sequence generation.</p><h3>Working of decoder in Attention Mechanism:</h3><p>at each time t, the decoder generates one output y, To do this the decoder generates a attention vector at time t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUL2yfnrebNS21ny6OMjFw.png" /><figcaption>working of decoder in attention mechanism</figcaption></figure><p>above is the simple illustration that shows you how the attention weight is created at each time t and based on that the importance to that particular word is given and selection is done based on the importance.</p><p>While the attention mechanism offers many advantages, it also comes with challenges.</p><p>One of the main challenges is computational complexity, since a separate attention vector and then context vector must be calculated at each time step of the decoder and that causes the issues like computational complexity.</p><p>As the length of the input sequence increases, the attention mechanism requires more memory and computation.</p><p>Another challenge researchers discovered was that this architecture processes words sequentially (one by one). They wanted to transform this sequential processing of data into parallel processing.</p><p>and thats where the Transformers comes into picture.</p><h3>Transformers.</h3><p>There is a popular research paper “<strong>Attention is All you need</strong>” which introduced the transformer architecture.</p><p>The new transformer architecture solved many limitations of previous sequence models like RNNs and LSTMs. Don’t worry about these technical terms — the goal here isn’t to understand complex deep learning models, but rather to gain a high-level understanding of how these systems work and solve problems.</p><p>The core idea of the Transformer is to replace recurrent operations with <strong>self-attention</strong> mechanisms, allowing the model to process the entire sequence of data in parallel rather than sequentially.</p><p>The Transformer computes relationships between all tokens in a sequence <strong>at once</strong>. This makes training more efficient and also allows the model to be parallelized effectively on modern hardware like GPUs.</p><h3>Main Concepts of Transformer Architecture:</h3><h3>Positional Encoding:</h3><p>Since the Transformer doesn’t process tokens (words) sequentially, it needs a way to understand their order. To address this, the model adds positional encodings to the input tokens, allowing it to track each token’s position in the sequence.</p><p>This is done by taking all the words in the input sequence and appending a number (its position) to each word.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*HZeZR9RC6-DrL22z39uS9w.png" /><figcaption>positional encodings</figcaption></figure><h3>Multi-head Attention:</h3><p>The Transformer uses multiple attention heads, allowing the model to focus on different aspects of the sequence at the same time. Each head learns distinct types of relationships between tokens, making the model more effective overall.</p><p>Attention works like a spotlight — it lets the model examine every word in the input sentence when deciding how to translate words in the output to correctly identify the context, sentiments and ultimate meaning for each word.</p><h3>Self Attention:</h3><p>Each word in the input sequence attends to every other word. This means every word can “look at” and weigh the importance of other words, which helps in capturing long-range dependencies like capturing the sentiment of the word based on other so that it can help in translating the text effectively.</p><p>Self-attention allows a neural network to understand each word by analyzing its relationship with all other words in the context.</p><p>Transformers have been a groundbreaking innovation, solving many challenges in sequence modeling and natural language processing. However, they come with their own set of challenges, particularly when it comes to training them from scratch. These challenges include:</p><ol><li><strong>Hardware</strong>: Training transformers requires high-performance GPUs or TPUs, which may not be accessible to everyone.</li><li><strong>Time</strong>: The training process can be extremely time-consuming, often taking days or even weeks depending on the size of the model and dataset.</li><li><strong>Data</strong>: Transformers require large amounts of data to achieve good results. Unfortunately, not everyone has access to extensive datasets, and working with small amounts of data often leads to subpar performance.</li></ol><p>These limitations make training transformers from scratch a significant challenge, especially for individuals or small teams with limited resources.</p><p>This is where <strong>transfer learning</strong> becomes a game-changer.</p><p>Now we need to understand what is Transfer Learning.</p><h3>Transfer Learning:</h3><p>let me get a bit technical this time for the definition but donot worry you will surely grab each and every concept.</p><p>“<strong><em>Transfer learning (TL) is a technique in which knowledge learned from a task is re-used in order to boost performance on a related task.</em></strong>“</p><p>not too technical right?…</p><p><strong>Example</strong>:</p><p>For image classification ( <em>like identifying from which set of classes the given image belongs</em> ), knowledge gained while learning to recognize cars could be applied when trying to recognize trucks.</p><p>like we are transfering the knowledge to new task.</p><p>The first step is</p><p><strong>Pre-training:</strong></p><p>you train your model on a big universal dataset using extensive computational resources so that we donot have to start from the scratch. The dataset has a lot of samples. and the goal is to learn all the general features.</p><p>The second step is</p><p><strong>Fine-Tuning:</strong></p><p>in fine-tuning, you take the same pre-trained model and train the model on your smaller, task-specific datasets. Now the model is fine-tuned according to your needs and give better predictions. we can achieve excellent results without needing vast amounts of data, time, or high-end hardware. This approach has democratized access to state-of-the-art machine learning and has become an essential tool for many in the field.</p><p>Technically speaking you change the weights in fine-tuning, retaing or keeping the weight of the early stages, and changing the weights of the later stages according to your tasks or needs.</p><p>for more in depth understanding you can refer to the research paper titled “<strong><em>Universal Language Model Fine-tuning for Text Classification</em></strong>”.</p><p>Traditionally, the model are trained on supevised data like labelled data where if you are performing tasks like text translation, if you are translating from english to french then the traning data should be labelled having the english sentences and having their french translation in front of them but in transfer learning language modelling is used as a pre training technique.</p><h3>Language Modelling as a Pre-training technique:</h3><p>Language modelling is a Natural Language Processing Task where you teach NLP or Deep Learning model to predict the next word based on sentiments and nature of sentence.</p><p>this is now the latest and many models are using this as a base training technique.</p><p>lets see how this language modelling training technique benefits</p><ol><li><strong>Rich Feature Learning:</strong></li></ol><p>In language modelling task of predicting next word, the model learns a lot of things, like grammatical rules, semantics of the sentence, the nature and structure of sentence, like for example:</p><p>The food was very clean, yet the serving was …..</p><p>here the model have already learned that the yet in a sentence shows some negative expression so it is going to suggest or predict some negative fill.</p><p>so this is the advantage of language modelling and can be used for the lot of tasks like text classification, question/answering system, text summarization, parts of speech tagging.</p><p><strong>2. Huge Availability of Data:</strong></p><p>you actually have a lot of data becuase you do not need any kind of labelling, so any pdf, or any data on the internet that has some meaning can be used as a training data and this also serves as one of the benefit and this can be called as Unsupervised training.</p><p>Up till now we have learned the transfomer architecture ( <em>do you remember the self attention, positional encodings etc etc…</em> ) and transfer learning as training technique and these two approaches are revolutionary.</p><p>what if we trained the transformer architecture based models with Transfer Learning technique ..? **we can actually acheive a lot.</p><p>Now comes the actual part — yes</p><p>the big term “<strong>LLM”</strong></p><h3>Large Language Models ( LLMs )</h3><p>now in 2018 to 20, two transformer based language models were released one is Bert ( Google ) and the other one is GPT from ( openAi ).</p><p>They were trained on huge datasets and are based on transformer architecture.</p><p>The two models are really good in Transfer learning that you can fine tune the models to let them perform the tasks you want.</p><p>Now everyone got the power of</p><p>getting the transformer based models → fine tune them on theirs limited data set → get the tasks done you want.</p><p>large language model are called large because they are trained on million and billion of parameter but wait it is too technical out here</p><p>what is meant by <strong>parameters</strong> here? paramters can be considered as the factors on based on which the text generation depends.</p><p>these models were trained on too large datasets that people start calling it large — and huge number of parameters is also a factor that make it “large” Langauge Models…</p><p>what make a Langauge Model a Large Language Model, lets undertand the qualities.</p><h3>Qualities of LLM:</h3><ol><li>billions of parameters</li><li>hardware ( cluster of GPUs, supercomputers )</li><li>Too much training time</li><li>cost → harware cost, infrastructure, electricity, human expertise</li><li>too much energy consumption</li></ol><p>I hope you found this helpful! If you did, please like and share it with others to spread the knowledge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebea5036c737" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How A Generative Ai project lifecyle looks like]]></title>
            <link>https://medium.com/@shazilkhannew/how-a-generative-ai-project-lifecyle-looks-like-2317b3cf6449?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/2317b3cf6449</guid>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[ai-model]]></category>
            <category><![CDATA[gpt]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Sun, 24 Mar 2024 11:00:38 GMT</pubDate>
            <atom:updated>2024-03-24T11:00:38.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vxMd8i-NOAPBr4tAF4T9AA.png" /><figcaption>understand how a generative ai project lifecycle looks like</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2317b3cf6449" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimization through useMemo hook in React]]></title>
            <link>https://medium.com/@shazilkhannew/optimization-through-usememo-hook-in-react-6ed863410404?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ed863410404</guid>
            <category><![CDATA[memoization]]></category>
            <category><![CDATA[usememo]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 19:34:27 GMT</pubDate>
            <atom:updated>2024-03-20T19:46:31.493Z</atom:updated>
            <content:encoded><![CDATA[<p>understanding memoization techniques is an important concept in computer science.</p><p><em>memoization is like doing the work once, storing it and only do when needed.</em> It is defined as a technique to optimize performance in computer science to speed up the execution of programs by storing the results of expensive function calls in cache, <em>a temporary data storage from where the information can be retrieved faster when required</em> and retrieving the cached result when the same inputs/data occur again.</p><p>you have the data→ you need to calculate some expensive calculation with that data → each time if the data is same why you need to calculate each time the same calculation with the same data. So thats why you store it and use it from there!</p><p>Now lets talk about how to use <strong>useMemo()</strong> in react</p><p>What <strong>useMemo()</strong> does ?</p><p>The useMemo() hook in React is a built-in hook that allows you to memoize expensive functions so that you can avoid calling them on every render. You simply pass in a function and an array of dependencies. useMemo() will only recompute the memoized value when one of the dependencies has changed. This optimization helps to avoid expensive calculations on every render.</p><p>useMemo() will take the function to memoize it and dependency array that will tell when to re-compute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3dLcWwRyqTAGkOjMyEurIQ.png" /><figcaption>illustration to clear the concept</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lfmes9nHKMkdjVqwba-u3Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ed863410404" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Express.js as a Middleware]]></title>
            <link>https://medium.com/@shazilkhannew/express-js-as-a-middleware-c3af25bc50f2?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3af25bc50f2</guid>
            <category><![CDATA[express]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Mon, 22 Jan 2024 10:01:45 GMT</pubDate>
            <atom:updated>2024-01-22T10:01:45.129Z</atom:updated>
            <content:encoded><![CDATA[<p>A web framework like <strong>Express.js</strong> operates through functions considered to be middleware because they sit between HTTP interaction on the web and the Node.js platform.</p><p>What is a Middleware?</p><p><em>Middleware</em> is a general term applied to code that assists in listening for, analyzing, filtering, and handling HTTP communication before data interacts with application logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fkPvWTZHurxpugdt6v5jjg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3af25bc50f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyzing Request Data]]></title>
            <link>https://medium.com/@shazilkhannew/analyzing-request-data-2b02a12d848f?source=rss-2369a40acd23------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b02a12d848f</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[get]]></category>
            <category><![CDATA[post]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Muhammad Shazil Khan]]></dc:creator>
            <pubDate>Sat, 02 Dec 2023 12:36:37 GMT</pubDate>
            <atom:updated>2023-12-06T12:46:35.232Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Analyzing request Data" src="https://cdn-images-1.medium.com/max/1024/1*V0QJlB4fYYYA8AGZudujEQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b02a12d848f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>