<?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 Shikhar Goswami on Medium]]></title>
        <description><![CDATA[Stories by Shikhar Goswami on Medium]]></description>
        <link>https://medium.com/@shikhargoswami?source=rss-19cb74600fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VUXRMxw4D26RQgd2GFI1-Q@2x.jpeg</url>
            <title>Stories by Shikhar Goswami on Medium</title>
            <link>https://medium.com/@shikhargoswami?source=rss-19cb74600fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:23:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shikhargoswami/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[Why direction of steepest descent is always opposite to the gradient of loss function?]]></title>
            <link>https://medium.com/analytics-vidhya/why-direction-of-steepest-descent-is-always-opposite-to-the-gradient-of-loss-function-dddc995a816e?source=rss-19cb74600fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/dddc995a816e</guid>
            <category><![CDATA[gradient-descent]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Shikhar Goswami]]></dc:creator>
            <pubDate>Tue, 23 Jun 2020 12:30:22 GMT</pubDate>
            <atom:updated>2020-06-23T12:30:22.142Z</atom:updated>
            <content:encoded><![CDATA[<p>We have all heard about the gradient descent algorithm and how its used in updating parameters in a way to always minimize the loss function at each iteration. And, the steepest descent is when the loss function is minimized the most. But do you know why the steepest descent is always opposite to the gradient of loss function? Or why we call the algorithm ‘gradient descent’? Let’s find out!</p><p><strong>w(t) = w(t-1) -α(∇L)</strong></p><p>In this update equation, -<strong>∇L</strong> is that ‘opposite’ direction. But why?</p><h4>It’s all in the taylor series!</h4><p>Let’s consider a small change in <strong>w</strong>. The updated weight will become, <strong>w(new)=w+ ηΔw</strong>. (Remenber w is a vector, so <strong>Δw</strong> is the change in direction and <strong>η</strong> is the magnitude of change).</p><p>Now, let <strong>Δw = u</strong> and <strong>transpose(u) = v</strong>. The new loss function w.r.t <strong>w(new) </strong>will be <strong>L( w + ηu)</strong>.</p><p>Given it is a small change in <strong>w</strong>, we can write the new loss function by taylor expansion as follows:</p><p><strong>L(w + ηu) = L(w) + (η). v∇L(w) + (η²/2!). v∇²L(w)u + ….</strong></p><p>Now, η is very small. So, we can ignore terms containing η², η³ and later terms. So, our new equation becomes,</p><p><strong>L(w + ηu)-L(w) = (η). v∇L(w)</strong></p><p>As we know, our goal is to minimize loss function<strong> L</strong> at each step. Therefore,</p><p><strong>L(w + ηu)-L(w) &lt; 0</strong> i.e new loss is less than the old loss. From above equation we can say, <strong>v.∇L(w)&lt;0</strong></p><p><strong>v.∇L(w) </strong>is the dot product. Let <strong>β</strong> be the angle between <strong>v</strong> and <strong>∇L(w)</strong></p><p>cos(<strong>β) = (v.∇L(w))/|v||∇L(w)|. </strong>Let <strong>|v||∇L(w)|=k </strong>for simplicity.</p><p>Therefore, cos(<strong>β) = (v.∇L(w))/k, </strong>where<strong> -1≤</strong>cos(<strong>β)≤1.</strong></p><p>Now, we want <strong>v.∇L(w) </strong>as low/negative as possible( we want our new loss to be as smaller than old loss as possible). Therefore we want cos(<strong>β) </strong>to be as low as possible. The lowest value cos(<strong>β) </strong>can take is -1. In this case, <strong>β = 180 degrees.</strong></p><p>Therefore, in order to minimize the loss function the most, the algorithm always steers in the direction opposite to the gradient of loss function, <strong>∇L</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/0*LFAZnvPvs5aS_Vwh.png" /><figcaption><a href="https://ml-cheatsheet.readthedocs.io/en/latest/_images/gradient_descent_demystified.png">https://ml-cheatsheet.readthedocs.io/en/latest/_images/gradient_descent_demystified</a></figcaption></figure><p><em>Note: The concept of this article was based on videos of course </em><a href="https://www.cse.iitm.ac.in/~miteshk/CS7015.html"><em>CS7015: Deep Learning</em></a><em> taught at NPTEL Online.</em></p><h4>Resources:</h4><ol><li><a href="https://en.wikipedia.org/wiki/Taylor_series#:~:text=In%20mathematics%2C%20the%20Taylor%20series,are%20equal%20near%20this%20point.">Taylor Series</a></li><li><a href="https://en.wikipedia.org/wiki/Gradient">Gradien</a>t</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dddc995a816e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/why-direction-of-steepest-descent-is-always-opposite-to-the-gradient-of-loss-function-dddc995a816e">Why direction of steepest descent is always opposite to the gradient of loss function?</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network of Perceptrons, The need for a smooth function and sigmoid neuron]]></title>
            <link>https://medium.com/analytics-vidhya/network-of-perceptrons-the-need-for-a-smooth-function-and-sigmoid-neuron-9a42fc5ac97f?source=rss-19cb74600fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a42fc5ac97f</guid>
            <category><![CDATA[math]]></category>
            <category><![CDATA[sigmoid]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Shikhar Goswami]]></dc:creator>
            <pubDate>Sat, 20 Jun 2020 06:03:04 GMT</pubDate>
            <atom:updated>2020-06-22T14:17:32.320Z</atom:updated>
            <content:encoded><![CDATA[<p>A single perceptron can only represent linearly-separable boolean functions. Before doing anything, let’s first informally define what is meant by linearly-separable and linealry-inseparable functions.</p><blockquote>A function <strong>f(y) = w.x + b</strong> is said to be linearly-separable if there exists a line (or a plane if it’s 3-D) separating a set of points <strong>(xi,yi)</strong> from another set of points <strong>(xj,yj)</strong> such that all the points <strong>(xi,yi)</strong> lie on or above the line, and points <strong>(xj,yj)</strong> lie below the line.</blockquote><p>Now here’s the problem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tq4DqG2fruB3dKaV7L2FfA.jpeg" /></figure><p>In XOR, <strong><em>w1≥-w0</em></strong> and <strong><em>w2≥-w0</em></strong> but their sum, <strong><em>w1+w2&lt;-w0</em></strong>. Also, from the graph, we see that you can’t really separate all the <strong><em>X’s</em></strong> from all the<strong><em> O’s</em></strong> by a line. Therefore what we need is a network of perceptrons.</p><h4>How a network of perceptrons solves this problem</h4><p>Let’s consider a network of input layer, 1 hidden layer, and an output layer. Let’s also take weights b/w input and hidden layer as shown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eddhNwcpAtNzVRS3KO9TkQ.jpeg" /></figure><p>Output neuron will “fire” only if one of the four conditions satisfy. Also, there’s no contradiction in any two <strong><em>g(x) </em></strong>inequalities as was earlier. In other words, there is a separate neuron for each of the combinations of inputs such that all the points are nicely separated.</p><h4>Need for smoothness</h4><p>A perceptron has a very strict decision boundary. Meaning that, if the threshold <strong><em>θ=0.5, </em></strong>any g(x) which is close to 0.5, say 0.49, will result in y=0 and g(x)=0.51 will result in y=1. But, in real life, these values are almost the same and you would expect the same y for these values. We want a somewhat smooth function for this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VH4iSYgR_9sftOrCFRwNKQ.jpeg" /></figure><p>Now, there’s no longer an if-else condition in y w.r.t decision boundary. y can take any value b/w 0 and 1.</p><p>And we are particularly interested in sigmoid because it is a continuous and differentiable function. Hence, it’s easy to find weights that minimizes the error. Also, sigmoid is a representation of probabilty of an output and tells us how likely an output y is to happen given w and x.</p><p>A network of perceptrons can ‘represent’ any boolean function. In the same way a network of sigmoid neurons can ‘approximate’ any arbitrary function in the world. That’s why deep neural networks are so powerful!</p><p>Now that we have a function to relate all the x’s and y’s . We need our network to learn the weights to approximate and bring our predictions as close to the gorunf truth. Feed-forward neural networks and gradient descent algorithm in the next post!</p><p><em>Note: The concept of this article was based on videos of course </em><a href="https://www.cse.iitm.ac.in/~miteshk/CS7015.html"><em>CS7015: Deep Learning</em></a><em> taught at NPTEL Online.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a42fc5ac97f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/network-of-perceptrons-the-need-for-a-smooth-function-and-sigmoid-neuron-9a42fc5ac97f">Network of Perceptrons, The need for a smooth function and sigmoid neuron</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[McCulloch-Pitts Neuron, Perceptron and the Perceptron Learning Algorithm]]></title>
            <link>https://medium.com/analytics-vidhya/mcculloch-pitts-neuron-perceptron-and-the-perceptron-learning-algorithm-305796f6f980?source=rss-19cb74600fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/305796f6f980</guid>
            <dc:creator><![CDATA[Shikhar Goswami]]></dc:creator>
            <pubDate>Fri, 19 Jun 2020 07:41:19 GMT</pubDate>
            <atom:updated>2020-06-26T16:39:02.674Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*GA6qOtJlcqutoNcO3wuj4A.jpeg" /></figure><p>Our brain has approximately 86 billion neurons. Neurons help us to make decisions . We are repeatedly making decisions- “Whether I should watch Netflix or study?”, “Whether I should watch Dark or Friends?, “Whether to watch an IPL match or not”. Our decision are often of the boolean form- Yes or No, 0 or 1. We also take into account various factors(often boolean as well) before arriving at a decision. So, for example, our factors for watching an IPL match would be- Whether it is a CSK match or not, if it is then I’ll watch. Whether the opponent team is Royal Challengers Banglore or not, if it’s not, I’ll watch” etc. So, this inspiration was taken to form the first mathematical representation of biological neurons- MP neuron. Let’s see how it works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/206/1*BqJy7GQmSoAwzAkMpfPAKA.png" /></figure><p>As it is shown, both the inputs and ouputs are boolean. There are two parts: <strong><em>g </em></strong>takes all the inputs and aggregates them, <strong><em>f</em></strong> makes a decision based on the aggreagation. Let’s continue with the example of IPL matches. So,</p><p><strong><em>y</em></strong> : could be { 1: I’ll watch the match, 0: I’ll not watch the match}</p><p><strong><em>x1</em></strong>: could be { Is the match happening in my city}</p><p><strong><em>x2 </em></strong>: { Is CSK playing }</p><p><strong><em>x3</em></strong> : { Is MS Dhoni playing }</p><p>It’s obvious that I can only make my decision of going or not if <strong><em>x1</em></strong> is 1, i.e match has to be in my city for me to go. I won’t be able to go to the match in another city( for all practical purposes). <strong><em>x1</em></strong> is called the inhibitory input for this reason. In general, <em>x1 is all the reasons of not going to the match .</em></p><p>Now, if you’re a die hard fan of MS Dhoni- You will go only if MS Dhoni is playing- all <strong><em>x1, x2, x3</em></strong> have to be 1. On the flip-side, if you’re just a CSK fan, only <strong><em>x1</em></strong> and<strong><em> x2 </em></strong>have to be 1- no matter <strong><em>x3</em></strong> is 0 or 1. Taking the first case, we can say that this neuron will “fire” only if <strong><em>g(x)=x1+x2+x3≥3</em></strong></p><p>Let’s take another boolean function-AND function. To represent it by the MP-neuron:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TqyHNa2npHmBgA5raoMIiw.png" /></figure><p>We can say the neuron will “fire” only if <strong><em>g(x)≥2. </em></strong>Therefore, <strong><em>g(x)=2 </em></strong>is called decision boundary and for all the points on or above the line, <strong><em>y=1. </em></strong>In general, <strong><em>g(x)≥θ</em></strong>, where <strong><em>θ</em></strong> = Thresholding parameter.</p><p>In this way, some of the boolean functions can be represented by MP-neuron. But what about non-boolean inputs? Are all the inputs equal- In our case, I may want to give more “importance” to <strong><em>x3. </em></strong>“Here comes the megatron!”- No, Perceptron</p><h4>Perceptron</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*UukTRb0rSGoGBXX6QC2tXQ.png" /></figure><p>In real life, some factors are more important than others.So, in addition to inputs in MP-neuron, the weights(importance) of the inputs are also given in Perceptron. And also, in addition to learning weights ,the threshold that we were hand-coding before will be now be learned by an algorithm known as <em>Perceptron learning algorithm</em>.</p><p>Now, the aggregation will become <strong><em>g(x) = w1x1+w2x2+w3x3≥θ or w0x0+w1x1+w2x2+w3x3≥0 </em></strong>where <strong>x0</strong>=<strong><em>1</em></strong> and <strong><em>w0</em></strong>=-<strong><em>θ. </em></strong>We can also write its as <strong><em>w.x≥0 , </em></strong>dot product. The decision boundary will be <strong><em>w.x=0. </em></strong>The task is to learn weights <strong><em>wi </em></strong>that minimizes the error on inputs <strong><em>xi.</em></strong></p><h4>Perceptron Learning Algorithm</h4><p>Let’s iniatialize weights such that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*LspM734kU5kBhEJTTnDG2Q.png" /></figure><p>Case1: <strong><em>P={p1,p2,p3}</em></strong> are all the inputs for which <strong><em>y=1.</em></strong> In other words, taking decision boundary as <strong><em>w.x=0</em></strong>, P is a set of all the points for which <strong><em>w.x≥0</em></strong>.</p><p>Case2:<strong><em> N={n1,n2,n3}</em></strong> are all the inputs for which<strong><em> y=0</em></strong>. In other words, N is a set of all the points for which <strong><em>w.x≤0</em></strong>.</p><p>Now, we want that the at the end, Case1 and Case2 must happen( and not the other way). Also, note that w.x≥0 means that <strong><em>α≤90 degrees, </em></strong>angle b/w<strong><em> w </em></strong>and<strong><em> x. </em></strong>And, w.x≤0 means <strong><em>α≥90 degrees.</em></strong></p><p>With all the declarations with us, let’s see the algorithm:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*Leev_sgIOwmFTTRPXDMubw.png" /></figure><p>We iterate over all the points in input space (P U N) and for points in P, we want <strong><em>w.x≥0</em></strong> at the end. Therefore, whenever <strong><em>w.x&lt;0, </em></strong>we add x vector to w to make it <strong><em>w.x≥0. </em></strong>We do the same for points in N.</p><p>Therefore when the algorithm has converged- when for all the points in P, <strong><em>w.x≥0 </em></strong>and for all the points in N, <strong><em>w.x&lt;0, </em></strong>we stop.</p><p>The algorithm will always converge. Proof of convergence can be found <a href="https://www.cse.iitb.ac.in/~shivaram/teaching/old/cs344+386-s2017/resources/classnote-1.pdf">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*d_3XKUenCUV7NTSO3vAm1g.jpeg" /></figure><p>This article was only upto a single perceptron. A single perceptron can only represent linearly separable functions. A network of perceptron will be required to classify linearly inseparable functions. In the next post!</p><p><em>Note: The concept of this article was based on videos of course </em><a href="https://www.cse.iitm.ac.in/~miteshk/CS7015.html"><em>CS7015: Deep Learning</em></a><em> taught at NPTEL Online.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=305796f6f980" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/mcculloch-pitts-neuron-perceptron-and-the-perceptron-learning-algorithm-305796f6f980">McCulloch-Pitts Neuron, Perceptron and the Perceptron Learning Algorithm</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Doraemon, The Age of AI, and The Art of Helping]]></title>
            <link>https://medium.com/@shikhargoswami/doraemon-the-age-of-ai-and-the-art-of-helping-3bc646eeef4a?source=rss-19cb74600fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bc646eeef4a</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[comics]]></category>
            <category><![CDATA[help]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Shikhar Goswami]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 14:47:57 GMT</pubDate>
            <atom:updated>2020-04-21T14:47:57.333Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*nUpGykdHacZDP4CrkfDiSw.jpeg" /></figure><p>22nd Century. Sewashi, great-great grandson of Nobita, watches Nobita tackling with his problems, figuring out how to fit in his friend circle, trying to overcome the burden of his laziness and procrastination which miserably affects his ability to score good marks-or rather-not to score bad marks. But unlike Nobita, Sewashi is pretty good in math and science. He knows in his heart that given Nobita’s rate of adding up his negligience &amp; frustration along with his pile of problems, his failure is sure-shot and his future is doomed(and without his one true love, Shizuka).</p><p>Sensing this, Sewashi decides to send his cat-like appearing robot named Doraemon back through the timeline(or, actually present!?) in 21st Century to circumvent for the bad future and turning it into a good future. Nobita understands his great-great grandson’s ulterior motive and accepts Doraemon as his friend while still figuring out what it actually is! Over the period, they both get along and share a deep bond of friendship. Doraemon, being both technically and emotionally intelligent, picks out from his pool of gadgets and solves all the problems Nobita faces . With Doraemon by his side providing him moral and emotional support, Nobita becomes a better person.</p><p>With all his problem-solving, good-serving, burden-lifting, obstacle-ridding empathetic expertise, Doraemon truly is a paragon of “If robots are built to solve human problems and to minimize human efforts, here’s how it should be”. But is there really a robot like Doraemon in our world? Could we really make a robot that communicates fluently with humans? Could we actually, in that robot, infuse emotions along with the information? Would the robot be able to make decisions on its own as humans do? Can machines think rationally and humanly? Can machines ‘act’ rationally and humanly? Cordially inviting you to The Age of AI.</p><h3>The Age of AI</h3><p>The major breakthrough in the history of exploration and reveleation of whether it’s machinely-possible to be able to think like a human was done by Alan Turing, the father of AI as we now call him( Actually, John McCarthy is also the father of AI but it would be inappropriate to say AI has two fathers. Idk! Choose yourself). In his self-named Turing Test, he proposed that a computer can be said to possess artificial intelligence if it can mimic human responses under specific conditions. But the only glossed-over problem in this test was, it was too specific and limited to only certain simulations. It eventually became controversial and criticised over the years, but you have to give something to Turing right?</p><p>Nevertheless, we have come a long way since that time and over the past 10 years or so, AI has become, what Andrew Ng likes to coin, “the new electricity”.</p><blockquote>Arificial Intelligence( AI for short) is the field of embedding human thinking into computers.</blockquote><p>The machines are set to make decisions on their own based on the past experiences. Just like we were babies, we had to be told “This is a cat” by pointing out at the cat, “This is how you respond to a question” by self-enacting the answer. Machines are also given the information so that they can later identify the thing that it had been trained to identify. This is why it’s ‘Artificial’.</p><p>Humans are receptivity experts. It’s a fact that our decision at the moment is not just a reponse of our brain, but all the receptions of past experiences stored in our brain eventually which manifest in that decision. Likewise, the more past information that we provide to the machine, the more ‘data’ you feed in, the more accurate it’s predictions will be. It’s for this fact that today, the deep neural nets are fed with gazillions of data to classify, identify and predict information of use to businesses. Today, every major industry is incorporating AI in it’s systems to increase it’s revenues, building consumer-centric solutions, filtering traffic, recommending products-per-taste among many other services. From detecting the presence of cancer tissues, predicting which combinations of drugs will be most effective for each patient, self-driving cars incorporating tracking, lane-changing and navigation, investing by accurately comparing between stocks and identifying which stocks to trade in, mass surveillance by facial recognition, threat detection, robots serving in hospitals to reduce staff load, AI is actively helping humans where it would be difficult for them to operate.</p><p>If anything, our Doraemon had to be an AI-driven robocat that makes his friends life easy.</p><blockquote>Emotion: An instinctive or intuitive feeling as distinguished from reasoning or knowledge.</blockquote><p>We humans are emotional beings. We feel for each other. We have empathy for each other. And we help each other in difficult times out of that empathy. Throughout history, people have helped each other to build a society which shares a sense of belongingness. Early men used to deploy at the periphery to protect their loved ones-their clan from the danger. While, women would built the life inside and provided care. Countries help other countries in the moment of calamity by providing supplies. This whole world structure stands upon the mutual assistance of people, governments, religions and nations. We have mastered the ‘Art of Helping’.</p><p>The question here is that besides all the logical, reasoning, cognitive, knowledge based information, could we also infuse robots with emotions? Could we teach robots how to feel, how to help in danger? Well, Doraemon can do all that but the problem is, such a robot doesn’t exist(atleast yet) in the real world. But again, you never know how fast an imagination turns into reality! Right?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bc646eeef4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>