<?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 Indraneel Pole on Medium]]></title>
        <description><![CDATA[Stories by Indraneel Pole on Medium]]></description>
        <link>https://medium.com/@pole.indraneel?source=rss-3c4bc5813923------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zTQWzcMW5fJ23A9ULoAWjw.jpeg</url>
            <title>Stories by Indraneel Pole on Medium</title>
            <link>https://medium.com/@pole.indraneel?source=rss-3c4bc5813923------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 21:49:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pole.indraneel/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[The Story of Backpropagation: How an Old Idea Transformed AI]]></title>
            <link>https://medium.com/@pole.indraneel/the-story-of-backpropagation-how-an-old-idea-transformed-ai-48ba235c60bc?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/48ba235c60bc</guid>
            <category><![CDATA[back-propogration]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mls]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Wed, 11 Dec 2024 13:32:56 GMT</pubDate>
            <atom:updated>2024-12-11T13:32:56.849Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QBN0np_l26i_URnH" /></figure><p>Backpropagation is a fundamental algorithm in artificial intelligence that powers modern neural networks. It’s responsible for the breakthroughs we see today in fields like natural language processing, computer vision, and speech recognition. However, its journey to prominence was far from straightforward. Here’s a look at how this critical idea almost faded into obscurity before changing the field of AI.</p><h4>The State of Neural Networks in the 1970s</h4><p>In the 1970s, neural networks were largely dismissed by the AI research community. At the time, symbolic AI — based on rule-based systems — dominated the field. Neural networks, though conceptually promising, struggled to solve real-world problems. The main issue was the lack of an efficient way to train these networks. Without a reliable method to adjust the internal parameters (weights), neural networks couldn’t scale to handle complex tasks.</p><h4>The Early Idea of Backpropagation</h4><p>The concept of backpropagation wasn’t entirely new. It was first proposed in 1969 by Arthur Bryson and Yu-Chi Ho as a method for optimizing dynamic systems. However, it remained theoretical because the computational resources needed to test and implement it effectively didn’t exist at the time. As a result, the idea was largely overlooked.</p><h4>The Breakthrough in 1986</h4><p>Fast forward to 1986, when Geoffrey Hinton, David Rumelhart, and Ronald J. Williams revisited backpropagation. In their landmark paper, <em>“Learning Representations by Back-Propagating Errors,”</em> they demonstrated how the algorithm could effectively train multi-layer neural networks to solve non-linear problems. The key innovation was proving its practicality and showing real-world applications, which reignited interest in neural networks.</p><h4>Initial Skepticism</h4><p>Despite the breakthrough, backpropagation didn’t gain immediate acceptance. The AI community was still skeptical of neural networks, partly because symbolic AI systems were outperforming them on key benchmarks. Additionally, neural networks required significant computational power, which was still limited in the 1980s and 1990s.</p><h4>The Rise of Neural Networks</h4><p>As computing power grew in the early 2000s, researchers began to see neural networks outperform symbolic AI systems in fields like image recognition and speech processing. Backpropagation became the standard method for training these networks. The ability to adjust weights across multiple layers enabled neural networks to solve increasingly complex tasks, setting the stage for the rise of deep learning.</p><h4>Backpropagation in Modern AI</h4><p>Today, backpropagation is the backbone of deep learning. It powers large models like GPT, BERT, and ResNet, which drive applications ranging from autonomous vehicles to medical diagnostics. These models are trained on massive datasets, using backpropagation to optimize their performance iteratively.</p><h4>Lessons from the Story of Backpropagation</h4><p>The story of backpropagation highlights several key lessons:</p><ol><li><strong>The Importance of Timing:</strong> Ideas in science often take decades to reach their full potential. Backpropagation was proposed in 1969 but only gained traction when computing power caught up in the 2000s.</li><li><strong>Persistence Matters:</strong> Geoffrey Hinton and his colleagues’ decision to revisit and refine an overlooked idea demonstrates the value of persistence in research.</li><li><strong>Collaboration and Iteration:</strong> Progress in AI, like in most scientific fields, is rarely the result of a single breakthrough. It often involves building on prior work and refining existing concepts.</li></ol><h4>Conclusion</h4><p>Backpropagation transformed AI by making neural networks practical. It’s a powerful reminder of how revisiting old ideas, supported by advances in technology and a collaborative research community, can lead to groundbreaking innovation. Without it, the AI revolution we see today might never have happened.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48ba235c60bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI hallucinations: a critical challenge in AI systems.]]></title>
            <link>https://medium.com/@pole.indraneel/ai-hallucinations-a-critical-challenge-in-ai-systems-e75ff17bd2fc?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/e75ff17bd2fc</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[hallucinations]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Wed, 04 Dec 2024 11:10:13 GMT</pubDate>
            <atom:updated>2024-12-04T11:10:13.984Z</atom:updated>
            <content:encoded><![CDATA[<p>I had a student sometime ago who submitted a paper with amazing references, intrigued, I decided to search one of them on internet, and realised, the reference doesn’t exist at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*O5k85Z68mq24s8qJ" /></figure><p>Turned out, he had let the GenAI write whole paper, including all the references. We see this quite a lot. ChatGPT or similar AI models sometimes give confidently wrong answers. Do you wonder why?</p><p>First, what exactly are hallucinations in AI? It’s when an AI generates outputs that are factually incorrect or nonsensical, even when they sound plausible. For example: User: “Who won the 2028 World Cup?” AI: “Germany, defeating Brazil 2–1.” (Spoiler: It hasn’t happened yet!)</p><p>Why do hallucinations occur? AI models like GPT are trained to predict the next most likely word based on context. But:</p><p>Limited training data accuracy</p><p>Lack of real-world grounding</p><p>No built-in “truth-checking” mechanism These flaws = occasional fiction over facts.</p><p>But hold on — hallucinations aren’t always bad! In creative tasks (storytelling, poetry), they fuel imagination.</p><p>e.g., “Write a sci-fi story about time-traveling cats.” Here, hallucinations = innovation. The problem? Misleading or harmful outputs in factual contexts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dHT57y7qzP2z1L7U" /></figure><p>Here’s a shocking example: In 2023, a lawyer submitted a court brief citing non-existent case laws generated by AI. The hallucinated cases sounded legit but were fictional! Outcome: Fines and embarrassment. Lesson: Always verify AI outputs in critical fields.</p><p><strong>So how to try to fix this?</strong></p><p><em>Reinforcement Learning from Human Feedback (RLHF): Improves the responses by aligning with user intent &amp; facts.</em></p><p><em>Fact-check pipelines: External APIs cross-check answers for accuracy.</em></p><p><em>Dataset improvements: Training on verified, high-quality data.</em></p><p>Is hallucination-free AI possible? Not yet. Even with cutting-edge advancements like retrieval-augmented generation (RAG), where AI references external knowledge bases, hallucinations persist. The complexity of human language makes perfect accuracy a huge challenge.</p><p><strong>What can you do to manage hallucinations?</strong></p><p><em>Use AI cautiously for critical decisions.</em></p><p><em>Cross-check AI outputs with trusted sources.</em></p><p><em>Opt for systems integrated with live databases (like Wolfram Alpha or Bing). Humans + AI = a strong fact-checking team!</em></p><p>AI hallucinations remind us that these systems are tools, not autonomous experts. The journey to safer, more accurate AI is ongoing, and awareness is key. Remember: Trust but verify.</p><p>AI hallucinations show both the power and limitations of today’s technology. While we work toward better AI, let’s stay curious, cautious, and informed. What’s your experience with AI hallucinations? Share below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e75ff17bd2fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Story of how Neural Networks came to be!]]></title>
            <link>https://medium.com/@pole.indraneel/story-of-how-neural-networks-came-to-be-dc4b7fb6df5a?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc4b7fb6df5a</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[mls]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Tue, 26 Nov 2024 12:42:37 GMT</pubDate>
            <atom:updated>2024-11-26T12:42:37.076Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wondered how neural networks, the backbone of AI, came to be? I dived into this rabbit hole, which turned out to be a fascinating journey of this transformative idea.</p><p>It all began in 1943 with Warren McCulloch, a neuroscientist, and Walter Pitts, a logician. They proposed a computational model of the human brain using simple “on” and “off” switches to mimic neurons. This was the first step toward artificial neural networks. Their model, known as the McCulloch-Pitts neuron, was a mathematical abstraction. It could perform basic logical operations like AND, OR, and NOT. But the model was static — there was no concept of “learning” yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*6l4WKpwAb62xvOKP" /></figure><p>Fast forward to 1958, when Frank Rosenblatt introduced the Perceptron, the first learning algorithm for neural networks. Inspired by biology, the Perceptron could adjust its weights based on input-output errors — a rudimentary form of learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/0*3gRF4bDsgvXKQrR9" /><figcaption>Image source: Cornell University</figcaption></figure><p>However, the Perceptron had limitations. In 1969, Marvin Minsky and Seymour Papert published Perceptrons, proving that it couldn’t solve non-linear problems like XOR. This led to the first “AI winter” — funding and interest dwindled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*nwiY9WxQJO1jDgBh" /><figcaption>Image source: NPR</figcaption></figure><p>The breakthrough came in the 1980s with the Backpropagation algorithm. Invented earlier by Paul Werbos in 1974, it gained traction thanks to Geoffrey Hinton, David Rumelhart, and Ronald Williams. This allowed multi-layer networks to learn complex patterns.</p><p>The resurgence of neural networks began here. Researchers started exploring deeper architectures and solving real-world problems. The introduction of convolutional networks (CNNs) by Yann LeCun in the 1990s revolutionized image processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*HXSGVm0chmHmZnGq" /><figcaption>Image Source: TheAiEdge dot io</figcaption></figure><p>By the 2010s, with the advent of GPUs and massive datasets, Deep Learning was born. Architectures like AlexNet (2012) showcased neural networks’ potential in computer vision, leading to the AI explosion we see today.</p><p>Today, neural networks power everything from search engines to self-driving cars. But remember, it all started with McCulloch and Pitts’ simple model. Every leap in AI stands on the shoulders of giants.</p><p>The journey of neural networks is a testament to human curiosity and persistence. As we build ever-smarter machines, we continue to draw inspiration from the human brain. What’s your favorite neural network application? Let me know!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc4b7fb6df5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Step-by-Step Guide to Creating a Password Change Workflow in Azure B2C Using Custom Policies]]></title>
            <link>https://medium.com/@pole.indraneel/a-step-by-step-guide-to-creating-a-password-change-workflow-in-azure-b2c-using-custom-policies-98469e1dfb0a?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/98469e1dfb0a</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[b2c]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 10:05:49 GMT</pubDate>
            <atom:updated>2023-08-24T10:05:49.360Z</atom:updated>
            <content:encoded><![CDATA[<p>Azure B2C (Azure Active Directory B2C) is a powerful tool for managing authentication and authorization for your applications. When it comes to setting up various workflows, such as profile editing, sign-in, and sign-up, you have two primary options: User Flows and Custom Policies. While User Flows offer simplicity, they have limitations, particularly when it comes to tasks like changing passwords. In this article, we will delve into the process of setting up a password change workflow using Custom Policies in Azure B2C.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/0*hWRw3bdTNbslMn6z.png" /><figcaption>Image Source: Microsoft</figcaption></figure><p>While there is comprehensive documentation available for this process, it may not cover all the intricacies and nuances you might encounter while configuring a password change policy. This article aims to fill those gaps, providing you with a smoother experience and reducing the time spent troubleshooting errors.</p><h4>Getting Started</h4><p>Before diving into the details, you need to set up custom policies within your Azure B2C directory. Here are the steps to get you started:</p><ol><li><strong>Identity Experience Framework:</strong> Navigate to the Identity Experience Framework section in Azure B2C and configure policy keys.</li><li><strong>App Registrations:</strong> Create the necessary app registrations to facilitate the custom policy.</li><li><strong>Policy XML Files:</strong> Utilize policy XML files and upload them to your Azure B2C environment.</li></ol><p>Now as this is explained in detail in the documentation, I am not going to write it here again. For a comprehensive walkthrough of these steps, please refer to the <a href="https://learn.microsoft.com/en-us/azure/active-directory-b2c/tutorial-create-user-flows?pivots=b2c-custom-policy">official Microsoft documentation for Azure B2C</a>.</p><p>Even when following the documentation diligently, errors can still crop up. Often, these issues are caused by small mistakes that are easy to overlook.</p><blockquote>Here’s a tip to avoid such hiccups: <a href="https://b2ciefsetupapp.azurewebsites.net/">consider using a tool developed by Jas Suri from Microsoft</a>. This tool automates the creation of policy keys, app registrations, and the upload of essential policies to your B2C directory. It’s an invaluable resource that can save you time and frustration.</blockquote><h4>Implementing the Password Change Policy</h4><p>Now, let’s proceed with implementing the password change policy. <a href="https://learn.microsoft.com/en-us/azure/active-directory-b2c/add-password-change-policy?pivots=b2c-custom-policy">Microsoft’s documentation provides a detailed guide</a> on how to accomplish this task.</p><blockquote>However, here’s another helpful tip: you can find an exact example of the password change policy in the ‘scenarios’ folder of the following repository:</blockquote><pre>git clone https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack</pre><blockquote>Within the ‘scenarios’ folder, you’ll discover an XML file specifically tailored for the password change policy. Open it, review it for any necessary adjustments, implement those changes, and then upload the policy to your B2C environment. This method can be more efficient than modifying the ‘ProfileEdit.xml’ file as recommended in the official documentation.</blockquote><h4>Conclusion</h4><p>Creating a password change workflow in Azure B2C using Custom Policies can initially seem daunting. However, by following the official documentation and incorporating the tips mentioned in this article, you can simplify the process and reduce the likelihood of encountering frustrating roadblocks. We hope this guide helps you navigate the intricacies of setting up a password change policy, saving you valuable time and resources in the process.</p><p>Don’t let minor errors deter you from efficiently implementing this essential feature. With the right guidance and tools at your disposal, you’ll be able to create a seamless password change experience for your users in no time.</p><p>Happy coding!</p><p>Author: Indraneel Pole</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98469e1dfb0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking Efficiency: My One-Month Journey with GitHub Copilot in Visual Studio Code]]></title>
            <link>https://pub.aimind.so/unlocking-efficiency-my-one-month-journey-with-github-copilot-in-visual-studio-code-91c713ea5d1d?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/91c713ea5d1d</guid>
            <category><![CDATA[mls]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Wed, 23 Aug 2023 05:56:25 GMT</pubDate>
            <atom:updated>2023-08-25T15:54:53.068Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the past month, I’ve embarked on a coding journey with a trusty companion by my side — GitHub Copilot integrated into Visual Studio Code. This AI-powered coding assistant has been nothing short of impressive, revolutionizing the way I write code. Let me share my firsthand experiences and insights on how Copilot has made a significant impact on my development workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RgYp28dxFTLMDl80XYi-Fg.png" /><figcaption>Image Source: Microsoft</figcaption></figure><h3>A Seamless Experience</h3><p>One word that comes to mind when I think of Copilot is ‘seamless.’ It seamlessly suggests methods and completes code snippets, accurately hitting the mark eight out of ten times. This incredible efficiency boost has made coding both enjoyable and productive. Gone are the days of slogging through documentation or fumbling through syntax errors; Copilot has your back.</p><p>Let’s dive into a few aspects that have made Copilot my go-to companion for the past month.</p><h3>1. Effortless Coding for Common Tasks</h3><p>GitHub Copilot shines brightest when tackling everyday programming tasks. Whether it’s writing loops, crafting conditions, or implementing recursion, Copilot consistently delivers on-point suggestions. For example, if I am accessing an array or list, Copilot starts suggesting .ForEach loop, and many a times, further implementation in the loop which is near correct 60–70% of the time.</p><h3>2. Method Name Suggestions</h3><p>One of my favorite features is Copilot’s ability to suggest method names. This is particularly handy when working on larger projects where naming conventions matter. Copilot seems to have an uncanny knack for proposing intuitive and relevant method names.</p><h3>3. TypeScript Compatibility</h3><p>In my experience, Copilot shines even brighter in TypeScript projects. TypeScript’s strong typing often requires meticulous attention to detail, and Copilot’s ability to infer types and provide relevant suggestions makes the development process smoother and more enjoyable. For context though, I have only used Copilot for TypeScript and HTML languages in VS Code, and I am comparing the typescript compatibility to HTML in this case.</p><h3>A Few Minor Hiccups</h3><p>While Copilot has been a game-changer, it’s not without its quirks. There have been instances where it goes slightly off track, and it’s important to exercise caution.</p><h3>1. Inventing the Unseen</h3><p>One occasional annoyance is Copilot’s tendency to invent code elements that don’t exist in your project. For instance, when referencing an ENUM value, Copilot might suggest enum values that sound legitimate but aren’t part of your codebase.</p><pre>// Copilot suggesting ENUM values that don&#39;t exist<br>enum Color {<br>    Red = &quot;RED&quot;,<br>    Green = &quot;GREEN&quot;,<br>    Blue = &quot;BLUE&quot;,<br>}<br><br>const selectedColor = Color.Blue;<br><br>// Copilot suggesting: Color.Magenta (which doesn&#39;t exist in the enum)</pre><p>While Copilot’s inventiveness can sometimes be useful, it’s crucial to verify its suggestions, especially in more complex scenarios.</p><h3>Overzealous Property Generation</h3><p>While referencing DTOs (Data Transfer Objects) or similar structures, Copilot occasionally suggests properties that are not present in your data model. While it aims to be helpful, you might find yourself cleaning up unnecessary code and if you just blindly implement every suggestion, you might find reference to a property or two, that doesn’t even exist, and have to handle compilation errors.</p><h3>Conclusion: An Invaluable Coding Companion</h3><p>In essence, Copilot is like having an experienced pair of coding hands always at the ready. It’s not here to replace developers but to empower them. With Copilot by your side, you can code faster, more accurately, and with a lot less hassle.</p><p>So, if you haven’t tried GitHub Copilot in Visual Studio Code yet, I wholeheartedly recommend giving it a go. It might just become your new best friend in the world of coding.</p><p>Indraneel Pole</p><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91c713ea5d1d" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/unlocking-efficiency-my-one-month-journey-with-github-copilot-in-visual-studio-code-91c713ea5d1d">Unlocking Efficiency: My One-Month Journey with GitHub Copilot in Visual Studio Code</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K-Nearest Neighbor : The Hello World of Object Classification]]></title>
            <link>https://medium.com/@pole.indraneel/k-nearest-neighbor-the-hello-world-of-object-classification-619ec7e6ef25?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/619ec7e6ef25</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[knn]]></category>
            <category><![CDATA[mls]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 05:32:20 GMT</pubDate>
            <atom:updated>2023-08-22T05:32:20.781Z</atom:updated>
            <content:encoded><![CDATA[<h3>K-Nearest Neighbor : The Hello World of Object Classification</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-acFw6TZ5RyMj21rztVRg.png" /><figcaption>Image source: IBM</figcaption></figure><p>Write your first object classification program using K-Nearest Neighbor algorithm in python.</p><p>In this article, we’ll explore the fundamentals of the K-Nearest Neighbors (KNN) algorithm and learn how to implement it from scratch using Python.</p><h3>What is K-Nearest Neighbors (KNN)?</h3><p>K-Nearest Neighbors, commonly referred to as KNN, is a simple yet powerful classification algorithm used in machine learning. It’s a non-parametric and instance-based learning algorithm, which means it doesn’t make any assumptions about the underlying data distribution. Instead, KNN classifies new data points based on their similarity to existing data points.</p><p>The core idea behind KNN is straightforward: “Show me your friends, and I’ll tell you who you are.” In other words, it classifies an unknown data point by examining the K nearest data points in the training set and assigning it to the class that most of its neighbors belong to.</p><h3>Understanding the KNN Algorithm</h3><p>Before we dive into the code, let’s break down the KNN algorithm into its essential steps:</p><ol><li><strong>Choose the number of neighbors (K):</strong> You need to specify the number of nearest neighbors (K) to consider when making a classification decision. A larger K value makes the decision boundary smoother but might introduce noise.</li><li><strong>Calculate the distance:</strong> Compute the distance between the input data point and all data points in the training dataset. Common distance metrics include Euclidean distance, Manhattan distance, and Minkowski distance.</li><li><strong>Sort the distances:</strong> After calculating distances, sort the data points based on their proximity to the input point in ascending order.</li><li><strong>Pick the K nearest neighbors:</strong> Select the top K data points with the smallest distances to the input data point.</li><li><strong>Majority vote:</strong> Determine the class of the input data point based on the majority class among its K nearest neighbors. In case of a tie, you can use different strategies like weighted voting or random selection.</li></ol><p>Now that we understand the algorithm, let’s implement it step by step in Python.</p><h3>Implementing KNN in Python</h3><h4>Step 1: Import the Required Libraries</h4><p>We’ll begin by importing the necessary libraries for our Python implementation:</p><pre>import numpy as np<br>import pandas as pd<br>from collections import Counter<br>from sklearn.model_selection import train_test_split<br>from sklearn.metrics import accuracy_score</pre><p>We use NumPy for numerical operations, Pandas for data manipulation, and the Counter class to count class occurrences. We’ll also need scikit-learn later to split our data into training and testing sets and calculate accuracy.</p><h4>Step 2: Define the KNN Function</h4><p>Next, we’ll define a function that performs the KNN classification. Here’s a basic structure of the function:</p><pre>def knn(X_train, y_train, X_test, k=3):<br>    predictions = []<br>    for test_point in X_test:<br>        # Calculate distances between test_point and all training data<br>        distances = []<br>        for train_point in X_train:<br>            distance = # Calculate distance (e.g., Euclidean or Manhattan)<br>            distances.append((train_point, distance))<br>        <br>        # Sort distances and get the first K neighbors<br>        distances.sort(key=lambda x: x[1])<br>        neighbors = distances[:k]<br>        <br>        # Extract the labels of the K neighbors<br>        neighbor_labels = [label for (_, label) in neighbors]<br>        <br>        # Perform majority voting to predict the class<br>        predicted_class = Counter(neighbor_labels).most_common(1)[0][0]<br>        predictions.append(predicted_class)<br>    <br>    return predictions</pre><h4>Step 3: Calculate Distance</h4><p>Now, we need to implement the distance calculation. For simplicity, let’s use the Euclidean distance formula:</p><pre>def euclidean_distance(x1, x2):<br>    return np.sqrt(np.sum((x1 - x2) ** 2))</pre><p>ou can also use other distance metrics like Manhattan distance or Minkowski distance depending on your problem.</p><h4>Step 4: Load the Dataset</h4><p>For this example, let’s use a classic dataset, the Iris dataset, which is available in scikit-learn. We’ll load the dataset and split it into training and testing sets:</p><pre>from sklearn.datasets import load_iris<br><br># Load the Iris dataset<br>iris = load_iris()<br>X = iris.data<br>y = iris.target<br><br># Split the dataset into training and testing sets<br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)</pre><h4>Step 5: Making Predictions</h4><p>Now that we have our data and the knn function, we can make predictions on the test data:</p><pre>k = 5  # Choose the number of neighbors<br><br># Make predictions<br>predictions = knn(X_train, y_train, X_test, k)</pre><h4>Step 6: Evaluate the Model</h4><p>To assess the performance of our KNN model, we’ll calculate the accuracy of our predictions:</p><pre>accuracy = accuracy_score(y_test, predictions)<br>print(f&quot;Accuracy: {accuracy:.2f}&quot;)</pre><p>And there you have it! You’ve successfully implemented a K-Nearest Neighbors (KNN) algorithm from scratch in Python.</p><h3>Conclusion</h3><p>In this article, we’ve explored the K-Nearest Neighbors (KNN) algorithm and walked through the process of building a simple KNN classifier from scratch in Python. We learned the essential steps of KNN, from choosing the number of neighbors to making predictions and evaluating the model.</p><p>While this is a basic implementation of KNN, there are many ways to improve it, such as optimizing for performance, handling ties differently, or exploring different distance metrics. KNN is a versatile algorithm with applications in various domains, making it an excellent starting point for your machine learning journey.</p><p>I encourage you to experiment with different datasets and parameter values to gain a deeper understanding of how KNN works and how to apply it effectively to real-world problems. Happy coding and exploring the exciting world of machine learning!</p><p>Indraneel Pole</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=619ec7e6ef25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Future of Semantic Folding: Navigating the Advantages and Disadvantages]]></title>
            <link>https://medium.com/@pole.indraneel/the-future-of-semantic-folding-navigating-the-advantages-and-disadvantages-f9794b39d8ce?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9794b39d8ce</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[semantic-folding]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mls]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Mon, 21 Aug 2023 11:17:58 GMT</pubDate>
            <atom:updated>2023-08-21T11:17:58.733Z</atom:updated>
            <content:encoded><![CDATA[<p>In my last post we talked briefly about Semantic Folding. What is it, how it works, and how is it different than LLMs. In this post, I am going to talk about advantages and disadvantages of Semantic Folding.</p><p>So, let’s talk about the exciting advantages that Semantic Folding brings to the table:</p><ol><li><strong>True Comprehension</strong>: Unlike LLMs, which often generate text without a true understanding of the underlying meaning, Semantic Folding aims to create AI systems that genuinely understand language and its intricacies. This could lead to more meaningful interactions with AI, as they grasp nuances and context better.</li><li><strong>Enhanced Problem Solving:</strong> Semantic Folding can empower AI to tackle complex problems by reasoning and drawing conclusions from information. Think about AI-powered assistants that not only follow your commands but also provide insightful solutions based on their understanding of your needs.</li><li><strong>Improved Decision-Making:</strong> In fields like medicine, finance, and law, where precise decision-making is critical, Semantic Folding could revolutionize the way AI systems analyze data and provide recommendations. It might lead to faster, more accurate diagnoses, better investment strategies, and more effective legal counsel.</li><li><strong>Personalization:</strong> With Semantic Folding, AI can offer highly personalized experiences, from tailoring educational content to individual students to curating entertainment that matches your preferences and mood.</li></ol><h4><strong>The Disadvantages of Semantic Folding</strong></h4><p>However, like any technological advancement, Semantic Folding comes with its share of challenges and disadvantages:</p><ol><li><strong>Complexity</strong>: Developing AI systems that truly comprehend language and context is immensely complex and resource-intensive. It requires substantial computational power and extensive training data.</li><li><strong>Interpretation Errors:</strong> While Semantic Folding aims to mimic human cognition, it’s not infallible. AI systems might misinterpret or make incorrect assumptions about the information they encounter, potentially leading to misinformation or biased conclusions.</li><li><strong>Ethical Concerns:</strong> As AI becomes more adept at understanding and generating content, ethical concerns surrounding privacy, security, and potential misuse become more pronounced.</li><li><strong>Integration Hurdles:</strong> Implementing Semantic Folding into existing systems and workflows can be challenging, requiring substantial changes and adaptations.</li></ol><p>The future of AI is a diverse landscape with many avenues of exploration. While LLMs like ChatGPT have made remarkable strides, they represent just one facet of AI’s potential. Semantic Folding offers the tantalizing promise of creating AI systems that truly understand and interact with us in ways that were once the stuff of science fiction.</p><p>It’s clear that the advantages of Semantic Folding, such as true comprehension, enhanced problem-solving, and personalized experiences, hold immense potential.</p><p>In our journey into the future of AI, the development of Semantic Folding promises to be a captivating frontier. It has the potential to open doors to AI systems that don’t just mimic human language but genuinely comprehend it. This could usher in a new era of intelligent, responsive machines, transforming the way we interact with technology and bringing us closer to the dream of machines that think and reason like humans.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9794b39d8ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Semantic Folding: How to make AI Smarter, Not Bulkier]]></title>
            <link>https://medium.com/@pole.indraneel/semantic-folding-how-to-make-ai-smarter-not-bulkier-f26daccae5d8?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/f26daccae5d8</guid>
            <category><![CDATA[semantic-folding]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mls]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Fri, 18 Aug 2023 09:58:55 GMT</pubDate>
            <atom:updated>2023-08-18T10:16:35.373Z</atom:updated>
            <content:encoded><![CDATA[<p>So lately, since 2021 a lot of buzz is going around LLMs and how they are the future of AI. And it is not 100% wrong either. I mean, look at ChatGPT. A great success. But is this the only way how AI can make progress? Not really. There are multiple research streams trying to solve the same problem and LLMs is just one of them. The problem what all these researchers are trying to solve is, mapping <em>how our brain thinks</em> to <em>machines</em>, and making them do the same routine that our brain does. LLMs is one such probe, Semantic folding is other. I know it sounds very techie, but we’ll try to break it down in plain English. In this blog post, we’ll delve into the world of semantic folding, its applications in AI, its distinctions from large language models (LLMs), and the exciting possibilities it offers for the future.</p><p><strong>Wrapping your head around Semantic Folding:</strong></p><p>So let’s start with the basics, what the heck is Semantic Folding. Before going to verbose into it, there is a greate video material that you might want to checkout as well, it was one of my major reference materials for this blog post. I have posted the link of this video at the bottom of this blogpost.</p><p>So, Semantic folding is a concept that has roots in the idea of compressing complex information into a lower-dimensional space while retaining its essential semantic meaning. Imagine taking a detailed map and folding it into a smaller size without losing any critical landmarks. It is like turning your hefty, detailed map into a neat, pocket-sized guide.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/0*1OalS190_z2TDAFX.jpeg" /><figcaption>The image is a screengrab from video mentioned at the end of this post.</figcaption></figure><p>So for example lets say you have a word that has different meanings in different context. In this case, lets say organ. Now Semantic Folding puts this word in different locations of a map, with each location corrosponding to the context. In this case, Organ as a liver, Organ as in Church, Organ as Piano.</p><p>So essentially, it compresses complex info into a smaller space without ditching the good stuff — the meaning and relationships that make the info valuable.</p><p>Application of semantic folding in AI is vast and transformative. It primarily finds its place in natural language understanding and text comprehension. By capturing the nuances of language and context, AI systems equipped with semantic folding can comprehend text in a more human-like manner. This means that machines can grasp subtle jokes, idiomatic expressions, and context-dependent meanings that traditional AI models might struggle with.</p><p>Semantic folding makes AI understand context and hidden meanings, like the way you’d get a joke or a slang term. So, instead of AI saying “I have no idea what you mean,” it actually gets you and responds like a friend.</p><p><strong>Differentiating from Large Language Models:</strong></p><p>LLMs excel at generating coherent text based on patterns learned from massive datasets, but they often lack the depth of understanding required to capture intricate contextual details. They are like those super chatty friends who can talk all day but might not get the nuances of what you’re saying.</p><p>Semantic folding goes deeper. It packs in not just patterns, but also the context and hidden meanings. It aims to create a condensed representation that encodes both surface-level patterns and underlying semantics. This depth enables AI systems to decipher context and meaning, leading to more accurate and context-aware responses.</p><p>What is the future of Semantic Folding in regards to LLM? Let us talk about this in next post. For now, take a <a href="https://www.youtube.com/watch?v=HLuRQKzYbb8&amp;ab_channel=cortical.io">look at this interesting video explaining the Semantic Folding.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f26daccae5d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cannot reset password in Azure B2C — Quick Solution]]></title>
            <link>https://medium.com/@pole.indraneel/cannot-reset-password-in-azure-b2c-quick-solution-8748f97d6da9?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/8748f97d6da9</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[b2c]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Wed, 28 Sep 2022 10:38:16 GMT</pubDate>
            <atom:updated>2022-09-28T10:38:16.629Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cannot reset password in Azure B2C — Quick Solution</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/115/1*bQ6_r5A-617Q0Rvy9CFNsw.png" /></figure><p>A recent problem I faced on a client project dealt with Azure b2c password management from C# .NET application. The scenario was following — We are using password reset workflow from our application, where when a user wants to reset his/her password, we send them an activation link, clicking on which we confirm that it is indeed the user who wanted to reset their password. Then we reset the password with a strong random string that passes the Azure password policy and send this to the customer. Customer is forced to change the password on next login with this temporary password. <br>We recently moved the resources to new tenant and new subscription in Azure and after that the password reset didn’t work anymore. We were getting 403 error with message “Insufficient Privileges”. What was the issue?</p><p>After hours of investigation, we found out following problem —</p><p>We are using Graph API to reset the password. The API that we are using is, PATCH with endpoint <em>“users/{objectId}”</em>, with PasswordProfile data object. So far so good. To use this API, according to Microsoft documentation, the B2C App needs <em>Directory.AccessAsUser.All. </em>This is something every StackOverflow question and even some Microsoft Forums. What both of those places miss is the clear instruction of how to do it. (Our problem was not that however, but I will explain that a little later).<br>So to set the correct permission you need to do following —</p><ol><li>Go to Azure Portal. Open your B2C tenant.</li><li>Go to App Registrations. Click on your App.</li><li>Go to API Permissions. Here under Configured Permissions. You have option to Add Permission. Click on it.</li><li>Select Microsoft Graph -&gt; Delegated Permissions -&gt; and then under Directory, select Directory.AccessAsUser.All</li><li>This permission needs Admin Access, so Grant Admin Consent for {your app name}.</li></ol><p>That’s it. You have granted the needed permission. However, it was not our problem. We had already granted this permission. and still the password reset workflow was not working because of insufficient privileges.</p><p>After further probe, we found out a small caveat in document, that is nowhere else documented. We were missing User Administrator role assignment on our Graph API application. What is this role assignment? Graph API application needs the correct role assignement so it can perform the action. this can be set in B2C under roles and administrators.</p><ol><li>Go to B2C tenant.</li><li>Click on Roles and administrators menu from left pane.</li><li>Click on User Administrator. It will open the Role in new view. You can alternatively also select Helpdesk Administrator or Password Administrator.</li><li>From top menu click on Add assignment and select your Graph App.</li></ol><p>And this was exactly our problem. When we changed the tenant and Subscription (That was another hell. If you are having a CSP subscription, best luck moving your resources), we lost this role assignment. (Because you need to delete and recreate the Graph App).</p><p>The issue is, because for a specific app or identity, you don’t have a view where you can see the role assignment and this creates major confusion. Micrsoft needs to update their UX in this regard. (Are you listening Microsoft?)</p><p>Anyway that is the solution to this confusing problem. I hope this post helps someone, being in the same hell as I was couple of days ago.</p><p>In next post, I will talk about another strange problem associated with identity creation in B2C.</p><p>Until then :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8748f97d6da9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Biggest Angular Pitfalls and how to avoid them — Part One — Circular Dependency]]></title>
            <link>https://medium.com/codex/biggest-angular-pitfalls-and-how-to-avoid-them-part-one-circular-dependency-4272417428e4?source=rss-3c4bc5813923------2</link>
            <guid isPermaLink="false">https://medium.com/p/4272417428e4</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[circular-dependencies]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Indraneel Pole]]></dc:creator>
            <pubDate>Tue, 14 Jun 2022 11:20:20 GMT</pubDate>
            <atom:updated>2022-06-21T13:45:19.200Z</atom:updated>
            <content:encoded><![CDATA[<h3>Biggest Angular Pitfalls and how to avoid them — Part One — Circular Dependency</h3><p>So another Angular pitfall post. I know there are millions of them already on Internet. And I still decide to write one more. Why is that, you might wonder? Well, for the simple reason, because even after coding in Angular Framework extensively for last five years, I still sometimes fall victim to these pitfalls. So this post is also for documenting these pitfalls for myself as well as for those who might google a problem and land here accidently :)</p><p>I am gonna do this topic in parts, because I just don’t want to write another listical. Instead, I want to dive deeper into each one of the pitfalls. So, in the first part, we are going to look at the favorite mistake of every Angular developer — <strong>Circular Dependency.</strong></p><p><strong>Circular Dependency </strong>is the most common mistake a newbie Angular developer can make. It is not even something specific to Angular Framework honestly. It is more of a Dependency Injection problem.</p><p>So, what is circular dependency? Imagine you have two services, lets call them pizza.service.ts and delivery.service.ts. In the pizza.service we are injecting delivery.service because well imagine, we need the delivery status in our pizza.service. That is fine <strong>AS LONG AS, we don’t need pizza.service itself in delivery.service. </strong>If at the same time we also inject the pizza.service in delivery.service, we have circular dependency on our hand.</p><p>How to solve this you might ask? Well, in such cases, it is best to put the dependent code (For example status variable in delivery.service) in a third service which doesn’t depend on any of the two above mentioned services. And then, just inject this third service in these two.</p><p>Sometimes however, the issue is more complex than this. For instance, if you have lazy loading enabled in your Angular application. Now, in this lazy loaded application, you have two different modules. <strong>Module A</strong> has component — pizza.component, pasta.component, and tiramisu.component. On the other hand, <strong>Module B </strong>has delivery.component, payment.component, and extras.component, and some services.. Now on surface we have divided the components cleanly between modules. But in practicality, we need some component from <strong>Module A </strong>in component of<strong> Module B, AND </strong>some service of Module B in a component of Module A. Now, in this example it is identifiable pretty easily, but in complex applications, that might not be the case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-j8NnMuQrHl5cYZH5HEzvw.png" /><figcaption>The problem</figcaption></figure><p>In such cases, the cleanest way always is to implement a <strong>shared.module </strong>that keeps common components, and then import shared.module in both the modules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tc-bEYHpvg-DVfe-4mv5Dw.png" /><figcaption>The solution</figcaption></figure><p><strong>Be careful though — </strong>This is more of an architecture problem than an Angular problem. Always ask yourself, does it make sense to put a certain component in a certain modules. What is the business usecase? What is the clearner workflow? Don’t just blindly put everything in shared.module. If you have unnecessary things stored in shared.module, it might defeat the purpose of having lazy loading at all. You can also have smaller cleaner multiple shared modules in case you have multiple things that needs to be shared between lazy modules. In that case, just reference the shared module you need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N8ThKkqPELfzntD6ftYyug.png" /><figcaption>Smaller shared modules</figcaption></figure><p>Circular dependencies can be rabbit hole. More so, when you have a huge monolith. While I understand the drawbacks of writing a monolith Frontend in today’s day and age, it is sometimes unavoidable considering the project life cycle. In such cases, it is always better to design the application from start to avoid such pitfalls in future. Circumnavigating a possible future problem, can seem expensive in short term, but in long term it is always cost effective than refactoring.</p><p>In next part, we will talk about common mistakes with Subscriptions and how to avoid them.</p><p>Until then :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4272417428e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/biggest-angular-pitfalls-and-how-to-avoid-them-part-one-circular-dependency-4272417428e4">Biggest Angular Pitfalls and how to avoid them — Part One — Circular Dependency</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>