<?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 Shivam Kaushik on Medium]]></title>
        <description><![CDATA[Stories by Shivam Kaushik on Medium]]></description>
        <link>https://medium.com/@shivam.kaushik73?source=rss-396d46fdd644------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GmSCSasUAzEfSPMISLI1Uw.png</url>
            <title>Stories by Shivam Kaushik on Medium</title>
            <link>https://medium.com/@shivam.kaushik73?source=rss-396d46fdd644------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 12:06:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shivam.kaushik73/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[Chapter 4 — Model Creation]]></title>
            <link>https://medium.com/@shivam.kaushik73/chapter-4-model-creation-54b217d6ecf2?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/54b217d6ecf2</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Mon, 07 Oct 2024 16:19:04 GMT</pubDate>
            <atom:updated>2024-10-07T16:19:04.383Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Chapter 4 — </strong>Model Creation</h3><h3>4.1 The Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*7N3xQKGv9k9ZpbVp" /></figure><p>In the previous chapter, we covered some basic data cleaning and exploratory data analysis (EDA), uncovering a few notable insights. For instance, we observed that the choice of genre influences the type of words used, impacts character distribution, and found that ‘E’ is the most frequent character. For a detailed understanding, I recommend revisiting <a href="https://medium.com/@shivam.kaushik73/chapter-3-data-prep-eda-9d891256bb59">the earlier chapter.</a></p><p>In this chapter, we’ll dive into how to tackle the problem at hand. We’ll explore the process of selecting an appropriate method and, most importantly, how to effectively evaluate it. Additionally, we’ll go over a checklist for building deep learning models, which can serve as a handy guide when applying any algorithm — think of it as the key ingredients to constructing a deep learning model.</p><h3>4.2 The checklist</h3><p>Let’s assume you’ve now clearly defined the problem, and have completed your data cleaning and exploratory data analysis. The next step is solving the problem, and here you’ll be faced with numerous methods to choose from. The method you select depends on your specific requirements, which we’ll discuss in more detail in the upcoming sections.</p><p>Once you’ve built your model, it’s crucial to evaluate its performance to determine how effective it is. Additionally, it’s important to assess how well the model performs in real-world scenarios. To simplify this process, I’ve created a checklist that can guide you as you approach the problem. While not exhaustive, it should prove helpful, especially in the context of deep learning. Note that some points may not apply to other approaches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/0*76-Nek_z60_uKT9h" /></figure><p>These requirements are framework-agnostic, meaning they apply regardless of whether you’re using PyTorch, TensorFlow, or another deep learning framework. The principles remain the same. First, you’ll need a dataset, typically structured using a dataset class. Next, you require a deep learning module that includes the model itself, an optimization algorithm (such as SGD), and optionally a learning rate scheduler.</p><p>An essential aspect of model development is evaluation metrics. These are used to assess whether the model is underfitting or overfitting by checking performance on a validation set. Following this, you’ll also need testing metrics. While these can be the same as evaluation metrics, they don’t have to be. Often, evaluation metrics serve as a proxy for the real metrics (test metrics) we aim to optimize. In cases where test metrics are computationally expensive to calculate, evaluation metrics act as stand-ins to approximate model performance. We will see this with an example.</p><h3>4.3 The problem statement</h3><p>In Chapter 2, we framed the problem as learning a joint probability distribution function for a string, given some non-alphanumeric characters. Our goal is for the model to predict the probability distribution of a string based on partial character information. When provided with a string containing some unmasked characters, the model will output the probability distribution conditioned on those known characters. The illustration below demonstrates how the probability distribution shifts as new information becomes available. Specifically, note how the distribution of the third character changes once ‘T’ and ‘O’ are accurately predicted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/0*jgl3lS1x2ZMn3OAE" /></figure><h4>4.3.1 How will we select a method? Intuition to select a method</h4><p>Let’s define a function f(X) that takes both masked and unmasked characters and outputs the probability distribution for each masked character. For example, if the current predicted word is partially revealed, we want f(X) to predict the probability distribution of the unknown characters. Formally, we can express this as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*KZmR8T7uLWuzvJ3H7WNf7g.png" /></figure><p>Key observations:</p><ol><li>The first, second, fourth, sixth, and seventh characters are known: ‘T’, ‘O’, ‘ ’, ‘T’, and ‘O’, respectively.</li><li>We are interested in predicting the probability distribution for the third, fifth, eighth, and ninth characters.</li><li>It’s crucial not only to know which characters are being predicted but also their positions in the sequence. The position of each character plays a vital role in this process.</li></ol><p>These factors will influence our choice of model. The next question we must ask is: what type of model can capture both the character features and their positional information?</p><p>The answer lies in time series models. Examples include RNNs, LSTMs, and, of course, transformers — our focus in this tutorial.</p><h4>4.3.2 Transformer</h4><p>The theory behind transformers is extensive, but I strongly recommend exploring it. Even in 2024, this architecture remains highly popular. What sets transformers apart is their scalability, the parallelization they enable (which was lacking in RNNs and LSTMs), their ability to capture positional or temporal information, and their capacity to handle long sequences of data. These features make transformers particularly appealing for research.</p><p>If you’re feeling confused by this or it doesn’t seem clear, I encourage you to take some time to study transformers — it will be well worth the effort.</p><p>Here’s what you need to know for now:</p><ol><li>Transformers are a cutting-edge architecture for deep learning models, widely recognized today.</li><li>Their features, as discussed, make them highly attractive to the research community, and they are versatile enough to be applied across different modalities and use cases.</li></ol><p>Here are some of the resources that i would recommend you to checkout</p><ol><li>Transformers from scratch by CodeEmporium: <a href="https://www.youtube.com/watch?v=QCJQG4DuHT0&amp;list=PLTl9hO2Oobd97qfWC40gOSU8C0iu0m2l4">https://www.youtube.com/watch?v=QCJQG4DuHT0&amp;list=PLTl9hO2Oobd97qfWC40gOSU8C0iu0m2l4</a></li><li>Detailed discussion of the paper attention is all you need at <a href="https://nlp.seas.harvard.edu/annotated-transformer/">The Annotated transformer</a></li></ol><h4>4.3.3 Transformer for our use case</h4><p>Now that we’ve chosen the transformer architecture, let’s build some intuition about how we’ll use it. First, we need to understand the input to the model. The inputs are integers that represent each character in the sequence. These integers are passed through an embedding layer, where each character, represented by a specific integer, is converted into an nnn-dimensional floating-point vector, known as an embedding.</p><p>Next, we add positional information to these nnn-dimensional embeddings. This enriched data is then passed through the transformer layers, which apply their specialized processing (often referred to as “magic”). If you’re interested in the inner workings, I encourage you to explore the details of transformer architecture.</p><p>Finally, the transformer model will predict the most likely character for each position, but we only focus on the masked positions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/0*AXs_j_8HjQA6ydxV" /></figure><p>Now let’s take an example. Let us say we have a word with some predicted word.</p><p><strong>Word</strong>: T O _ _ T O _ _</p><p><strong>Step 1</strong>: Each character is mapped to a specific integer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*yY9Diluthvz-j9BE9gh_4w.png" /></figure><p><strong>Step 2</strong>: Each mapped integer is transformed into say 512 dimensional floating point numbers.</p><p><strong>Step 3:</strong> Position information is added. For eg position 1 is added to 18</p><p><strong>Step 4</strong>: Transformer layers do their magic and at last try to predict which character is most likely for each masked position. I.e. all places where there is a ‘_’ or mapped character 2.</p><h3>4.4 Model Optimization</h3><p>This step is very important and is the crux for any ML system. How do we let models learn from the data? This exact question is answered in this section. I will try to put down some important parts that will be used in code too, so that they don’t feel very new there or when you apply practically you have some knowledge about these.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/0*owpBlMBYDhwblBWs" /></figure><h4>4.4.1 Dataset Class</h4><p>In any machine learning framework, a Dataset class is essential. It is responsible for the following key tasks:</p><ul><li><strong>Loading Data</strong>: Reading data from a CSV file.</li><li><strong>Preprocessing Data</strong>: Converting each token or character in the text data into a numeric format (integers) so that it can be used in model training.</li><li><strong>Applying Augmentation</strong>: Optionally, you can introduce random transformations, such as masking characters, depending on the training strategy. This can improve the model’s robustness by making it generalize better to unseen data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FyVkNS9gX4uZ2NeIe3oo6A.png" /></figure><h4>4.4.2 DataLoader and Collate Function</h4><p>In this section, we will explain two important concepts in PyTorch: the <strong>DataLoader</strong> and the <strong>collate function</strong>.</p><h4>What is the job of a DataLoader?</h4><p>The <strong>DataLoader</strong> in PyTorch is responsible for efficiently loading data in batches during model training. It essentially:</p><ul><li>Takes your dataset and allows you to iterate over it in batches (usually of fixed size).</li><li>It helps manage shuffling, parallel data loading (using multiple worker processes), and batching, which is critical for training models.</li></ul><p>The DataLoader provides an interface to easily fetch data for each training step. It takes a list of indices (for most cases) and returns data samples grouped together as a batch, stacked as a tensor with an extra “batch dimension.”</p><h4>Example of DataLoader Usage</h4><p>Here’s an example of how to use a DataLoader in PyTorch:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CS0OSfTwRkzphbKGnqinOQ.png" /></figure><h4>Explanation:</h4><ul><li>batch_size=4: This means each time the DataLoader is called, it will return a batch of 4 samples.</li><li>shuffle=True: This ensures that the data is randomly shuffled at the start of each epoch, which helps prevent the model from learning the order of the data.</li></ul><h3>What is the Collate Function?</h3><p>When the DataLoader collects individual samples, it needs to combine them into a single batch (i.e., stack them into a tensor). This is where the <strong>collate function</strong> comes into play. It defines how the DataLoader should combine individual samples.</p><p>By default, PyTorch’s DataLoader will stack data samples using the default_collate function, which works well for simple datasets. However, for more complex data (like varying sequence lengths in NLP), we need a custom <strong>collate function</strong> to handle padding or other transformations.</p><h4>Custom Collate Function Example</h4><p>In some cases, such as text datasets where sequences can be of varying lengths, we need to pad the sequences to ensure they have the same length. Here’s how you can create a custom collate function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dVRXt6GqZEfwE6UUV0gPUQ.png" /></figure><ol><li><strong>Padding</strong>: Each sequence in the batch is padded with zeros to ensure all sequences have the same length (the length of the longest sequence in the batch).</li><li><strong>Batch Tensor</strong>: The padded sequences are then converted into a single tensor, which the model can use for training.</li></ol><p>This combination of DataLoader and collate function is essential for managing the input pipeline in machine learning systems, especially when dealing with large and diverse datasets.</p><h3>4.4.3 Loss function</h3><p>This is the most important bit. Let’s build up intuition on how will model learn to answer the movie. Writing just a mathematical equation won’t do justice to the reader. So let’s understand how to tackle this problem.</p><p>Let’s take few examples</p><h4>Example 1</h4><p><strong>T O _ S T O R _</strong></p><p>Let’s consider what is the most likely character here at <strong>third place</strong>. I hope you answer ‘<strong>Y’</strong>. The answer is toy story. Right. But also there</p><ol><li><strong>Toy Story</strong> (the most obvious choice)</li><li><strong>Top Story</strong></li><li><strong>Toe Store</strong></li></ol><p>We can guess {y, p, e} as candidates right. But what do we want that model should predict y and probability of p, e should be minimized</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/0*ZlDDkZHCgS_y4Bt9" /></figure><h4>Example 2</h4><p><strong>T _ _ S T _ R _</strong></p><p>Let’s consider what is the most likely character here at <strong>third place</strong>. I hope you answer ‘<strong>Y’</strong>. The answer is toy story. Right. But also there</p><ol><li><strong>Toy Story</strong> (the most obvious choice)</li><li><strong>The Stars</strong></li><li><strong>Top Story</strong></li><li><strong>Toe Store</strong></li><li><strong>Tap Story</strong></li></ol><p>We can guess {y, p, e} as candidates right. But what do we want that model should predict y and probability of p, e should be minimized</p><h4>Example 3</h4><p><strong>_ _ _ S _ _ R _</strong></p><p>Let’s consider what is the most likely character here at <strong>third place </strong>now. Now we can have a lot of answers</p><ol><li>Toy Story</li><li>The Story</li><li>The Store</li><li>Toe Story</li><li>The Sorry</li><li>The Stars</li><li>Top Story</li><li>Toe Store</li><li>Tap Story</li><li>Tap Store</li><li>Top Stars</li><li>Car Store</li><li>Cat Store</li><li>Car Story</li><li>Cat Story</li></ol><p>And so on</p><p>The candidates words can be {y, e, p, t}. And again we want out model to predict {y} as most likely.</p><h3>Intuition Building</h3><p>Sure! Let’s simplify it:</p><p><strong>Goal</strong></p><p>We want to make sure that the probability of a specific class ‘<strong>y’</strong> is as high as possible for the third position in our predictions.</p><p><strong>Cross-Entropy Loss</strong></p><p>The cross-entropy loss helps us measure how well our model’s predictions match the actual class. It’s defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/0*ZlzG_t3C9hQx1Im3" /></figure><p><strong>For Our Case</strong></p><p>- <strong>True Label</strong>: This is 1 if the class <strong>y</strong> is the correct class for the third position, and 0 otherwise.</p><p>- <strong>Predicted Probability</strong>: This is the probability our model predicts for class <strong>y</strong> being at the third position.</p><p><strong>Simplified Loss Function</strong></p><p>If we want to focus on the third position, the loss function becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/0*CgnHvGyJZTcblQDO" /></figure><p>Here’s how it works:</p><p>1. <strong>Indicator</strong>: Is 1 if <strong>y</strong> is the correct class at the third position.</p><p>2. <strong>Probability</strong>: Is how confident the model is that \(y\) is at the third position.</p><p><strong>What We’re Doing</strong></p><p>To make sure <strong>y</strong> has the highest probability at the third position:</p><p>- We want the predicted probability of <strong>y</strong> being at the third position to be as high as possible.</p><p>- The cross-entropy loss will be lower if the predicted probability is higher for the correct class y.</p><p>So, by minimizing the cross-entropy loss, we are effectively making sure that the model predicts a high probability for the correct class at the third position.</p><h3>Masked Language Modeling</h3><p>We will train our model using the masked language modeling technique. But what does that mean? In this method, we randomly hide certain characters and ask the model to predict the correct word. By minimizing the cross-entropy loss at each position, the model gradually improves at predicting the missing characters. For example, let’s consider how the model might encounter various masked versions of “Toy Story” during training:</p><ul><li>Masked input: T _ Y _ T _ _ Y<br>Ground truth: TOY STORY</li><li>Masked input: T O _ _ T O _ _<br>Ground truth: TOY STORY</li><li>Masked input: _ O Y _ _ O _ Y<br>Ground truth: TOY STORY</li><li>Masked input: T O Y _ T O _ Y<br>Ground truth: TOY STORY</li></ul><p>These are just a few examples of how the model will see different masked versions of the same movie title during training. As it encounters more variations, the model will become better at predicting the correct title.</p><h3>4.5 Model evaluation</h3><p>Let’s assume we’ve developed a model — how do we assess its performance? While loss is one indicator, it’s often just a stand-in for the true evaluation metric, and the scale of the metric may differ significantly from the loss. For instance, improving the loss by 0.01 could lead to a 5–9 point boost in the actual evaluation metric. Therefore, it’s crucial to use proper metrics to accurately measure the model’s performance.</p><p>That said, calculating these actual metrics during training can sometimes be impractical, as they might slow down the process. In such cases, alternative metrics are often used.</p><p>For example, in our scenario, the goal is for the model to predict a movie name given partial information. The true metric might be how many attempts the model needs to guess the name correctly. This would involve predicting each character sequentially until the entire movie name is guessed. However, this approach is inefficient because it requires calling the model repeatedly for each character prediction, which not only takes time but also can’t be parallelized on a GPU.</p><p>Instead, we can evaluate the model’s predictions by examining the probability assigned to each character at every position. To measure prediction quality, we can check the rank of the correct character within the predicted probabilities. The lower the rank of the true character, the better the prediction. Fortunately, we have a metric designed for this evaluation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YgpbNIc2ZHteV4oz" /></figure><p>To address this, we use a ranking metric:<strong> Reciprocal Rank (MRR).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/0*OKfKszTtL9q79xoK" /></figure><p>To understand MRR, let’s first consider reciprocal rank. Take the example of predicting the third character in “Toy Story” given the input “to_ sto__.” The masked character is “y,” and let’s say the model predicts the following rankings:</p><ol><li>“p”</li><li>“r”</li><li>“y”</li></ol><p>In this case, the correct character “y” is ranked third, so the reciprocal rank is 13=0.33/frac{1}{3} = 0.3331​=0.33. This shows how reciprocal rank reflects how high up the correct prediction is in the list.</p><p><strong>Mean Reciprocal Rank (MRR)</strong> is the average of all reciprocal ranks for each masked character. In our example of “to_ sto__,” MRR would be the average of the reciprocal ranks for the third, seventh, and eighth positions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*t5-RIhcsOBdNOuze" /></figure><p>To summarize:</p><ul><li><strong>For evaluation during training</strong>, we’ll use MRR.</li><li><strong>For final testing</strong>, we’ll measure how many attempts the model took to correctly predict the full movie name.</li></ul><h3>4.6 From theory to application</h3><p>The reason for me to write this blog was that there exist many theoretical courses, but very few of them connect theory to practical. Since you (the readers) are here for this only. We shall now implement this.</p><figure><a href="https://lightning.ai/shivamkaushik73-da9i1/studios/the-full-stack-ml-course"><img alt="" src="https://cdn-images-1.medium.com/max/192/1*jpMTrZC8xqpsLjIL6y3Omg.png" /></a></figure><p><a href="https://lightning.ai/shivamkaushik73-da9i1/studios/the-full-stack-ml-course">https://lightning.ai/shivamkaushik73-da9i1/studios/the-full-stack-ml-course</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54b217d6ecf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chapter 3 — Data Prep & EDA]]></title>
            <link>https://medium.com/@shivam.kaushik73/chapter-3-data-prep-eda-9d891256bb59?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d891256bb59</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[machine-learning-course]]></category>
            <category><![CDATA[mls]]></category>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Sun, 18 Aug 2024 17:31:01 GMT</pubDate>
            <atom:updated>2024-08-18T17:31:01.163Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Chapter 3 — </strong>Data Prep &amp; EDA</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/0*2atx8RGUjTKdhoRo" /><figcaption>The app we want to make</figcaption></figure><p>In the previous chapter, we explored the process of tackling a problem statement and translating it into a technical framework. We highlighted how a clear technical formulation not only clarifies an ambiguous issue but also provides valuable direction for addressing it.</p><p>In our previous discussion, we selected the game Hangaroo and decided to model it. Essentially, we aim to develop software that learns to play Hangaroo, specifically focusing on guessing movie titles. We’ll be provided with genre-specific movie titles, with some letters masked and spaces indicated to show the beginning and end of words. Our goal is to use this information to guess the movie name.</p><p>With the problem defined, the next step is to gather the necessary data. For this, we have several useful resources:</p><ul><li><strong>Papers with code</strong>: <a href="https://paperswithcode.com/datasets">Paperswithcode datasets</a> offers a variety of benchmark datasets.</li><li><strong>Kaggle Datasets</strong>: <a href="https://www.kaggle.com/datasets">Kaggle</a> is a vibrant community where users share datasets.</li></ul><p>For our specific problem, we’ll use the **MovieLens 20M dataset** available at <a href="https://www.kaggle.com/datasets/grouplens/movielens-20m-dataset">Kaggle</a>. This dataset, which includes over 20 million ratings and 465,564 tag applications across 27,278 movies, was compiled from the activities of 138,493 users between January 9, 1995, and March 31, 2015. While it is primarily used for training recommender systems, it includes a `<strong><em>movies.csv</em></strong>` file with useful information such as movie IDs, titles, and genres.</p><p>For the upcoming section of this chapter, we will be using the Lightning Studio notebook. Please visit the provided link and run the notebook yourself. Detailed instructions and tutorials are available within the notebook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/0*Vy70NeZfQn5nHKCN" /><figcaption>Model Lifecycle</figcaption></figure><p>Studio Link</p><figure><a href="https://lightning.ai/shivamkaushik73-da9i1/studios/the-full-stack-ml-course~01j44sw41f7j12ef829jzxvhg0"><img alt="" src="https://cdn-images-1.medium.com/max/175/0*S55chbgIe10gNkMN" /></a><figcaption><a href="https://lightning.ai/shivamkaushik73-da9i1/studios/the-full-stack-ml-course~01j44sw41f7j12ef829jzxvhg0">https://lightning.ai/shivamkaushik73-da9i1/studios/the-full-stack-ml-course~01j44sw41f7j12ef829jzxvhg0</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/0*KRk98k_2MmHGwUXe" /></figure><h4>Data Prep</h4><p>Open the <strong>Chapter 03 — Data Prep &amp; EDA</strong> folder in the studio. Inside, you’ll find the `<strong><em>data_prep_n_eda.ipynb</em></strong>` file. Open this file, follow the instructions, and run the notebook.</p><p>Often, the data you receive is not pre-cleaned, so you’ll need to handle the cleaning process yourself. This involves strategizing how to use the data for your model and cleaning it accordingly, including removing redundant or missing rows.</p><p>The data preparation is covered in Section One of the notebook `<strong><em>Chapter 03 — Data Prep &amp; EDA/data_prep_n_eda.ipynb</em></strong>`. I encourage you to thoroughly review this notebook to understand the steps involved. Note that this tutorial assumes you are already familiar with Python and pandas; it focuses on developing an understanding of the data preparation process and the rationale behind each step.</p><figure><a href="https://lightning.ai/shivamkaushik73-da9i1/studios/the-full-stack-ml-course~01j44sw41f7j12ef829jzxvhg0"><img alt="" src="https://cdn-images-1.medium.com/max/175/0*xroyBR2o0Zda67r6" /></a><figcaption><a href="https://lightning.ai/shivamkaushik73-da9i1/studios/the-full-stack-ml-course~01j44sw41f7j12ef829jzxvhg0">https://lightning.ai/shivamkaushik73-da9i1/studios/the-full-stack-ml-course~01j44sw41f7j12ef829jzxvhg0</a></figcaption></figure><p>First, we focus on cleaning the movie titles, which is essential since predicting the title is our main task. Here’s a breakdown of the cleaning steps:</p><ol><li><strong>Lowercase the Title</strong>: Converting the title to lowercase helps ensure consistency and prevents discrepancies due to case sensitivity. The reasons for this are detailed in the notebook.</li><li><strong>Remove the Year</strong>: Strip the year from the title to standardize the format and avoid confusion.</li><li><strong>Remove Accent Characters</strong>: Eliminate accent characters to filter out foreign movies and ensure uniformity across titles.</li><li><strong>Filter Titles</strong>: Exclude titles formatted as `English Title (Original Title)` to avoid potential ambiguities.</li></ol><p>Next, we clean up the genres:</p><ol><li><strong>Format Genres</strong>: Genres are listed as a string separated by ‘|’. We need to process this string to handle genre information effectively.</li></ol><h4>Exploratory data analysis</h4><p>In the same notebook, you’ll find some fundamental analyses. We utilized pandas for data manipulation and Plotly for visualization, which I prefer for its interactive graphs. We posed several questions and answered them using the data. Please review the notebook through the provided link for the details.</p><p>Here’s a quick summary of what we’ve done:</p><ol><li><strong>Statistics on Title Length</strong>: We examined the number of alphanumeric characters in the movie titles.</li><li><strong>Most Common Genres:</strong> We visualized the most prevalent genres.</li><li><strong>Most Common Words in Titles</strong>: We plotted the most frequently occurring words in the titles.</li><li><strong>Top Words by Genre</strong>: We analyzed the most common words associated with each genre.</li><li><strong>Most Common Character in Genres</strong>: We explored which character appears most frequently in genre names.</li></ol><p>Through this process, we aimed to gain insights into the data. This is essentially how you perform Exploratory Data Analysis (EDA).</p><h4>Conclusion</h4><p>In this chapter, we’ve taken significant steps toward preparing our data for modeling, starting with the critical tasks of data cleaning and exploratory data analysis (EDA). We’ve seen how essential it is to thoroughly understand and refine our data before moving forward with model development. This preparation forms the foundation for creating a robust model that can accurately predict movie titles based on the game Hangaroo’s mechanics.</p><p>In the upcoming chapters, we’ll delve into the modeling process itself, applying the cleaned data to train our model and further refine its performance. This journey from raw data to a functional model highlights the importance of meticulous data preparation in any machine learning project. Stay tuned as we continue to build and fine-tune our system to take on the challenge of predicting movie titles with accuracy and efficiency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d891256bb59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chapter 2 — Defining the problem]]></title>
            <link>https://medium.com/@shivam.kaushik73/chapter-2-defining-the-problem-36cbba22b7a8?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/36cbba22b7a8</guid>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 13:27:02 GMT</pubDate>
            <atom:updated>2024-07-11T13:27:02.726Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chapter 2 — <strong>Defining the problem</strong></h3><p>In this chapter, we shall take up a problem, understand it and lastly define it properly for us to make a Machine Learning project on the same.</p><p>Alright, I know the last chapter was quite lengthy, so I had to break it into parts. I wanted to ensure a solid understanding of the steps involved. If you read my previous blog but don’t remember all the details, don’t worry. It’s not crucial to recall everything — just grasp the main ideas. A machine learning problem involves many stages, each unique in its own way.</p><p>Theory aside, the best way to learn is through projects. In this chapter and the ones that follow, we’ll tackle a machine learning problem by creating a game. The game itself will be simple, but building it will cover most of the steps we discussed earlier.</p><h3>Hangaroo</h3><p>Here we go! This brings back some memories for me. As a ’90s kid, I fondly remember those miniclip games we used to play. Those .exe files were our favorite pastime. For those who share these memories, I hope this brings back some sweet nostalgia.</p><p>We’re going to build a game called Hangaroo. You can try it out here: <a href="https://www.play-games.com/game/4167/hangaroo.html">https://www.play-games.com/game/4167/hangaroo.html</a>. I highly recommend it. Essentially, it’s a clone of Hangman.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/0*yKirG8DQbJ0T0o6j" /><figcaption>Hangaroo game screenshot. No kangaroos were harmed in this game. Copyright NetCent Communications</figcaption></figure><p>The game is simple. We have 4 crosses at the top representing the number of lives. We’re given a hint, along with other information. There are spaces indicating the start, end, and length of the words. Using this information, we need to predict the word. Sounds straightforward, right? Let’s see how it goes.</p><h3>The problem definition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*8YkDvBh4fXRw1BJm" /></figure><p>Till now, we’ve discussed the game. Since we’re creating this game for the computer to play autonomously, we need to clearly define our expectations. Properly defining the problem is crucial for any software developer because often, people come up with vague problems. It’s your job as a software developer to turn that vagueness into something technical and precise.</p><p>The above meme explains the ordeal that you, as a software developer, are likely to face. Defining the problem should align with the technical requirements of the time.</p><p>So, here’s the defined problem and the aim of this chapter and the ones to follow:</p><blockquote>We are going to develop a piece of software that will learn to answer just like humans do. We will build an environment where the computer will play Hangaroo autonomously. Specifically, since I love movies, let’s make the computer learn to predict movie names given their genre as a hint.</blockquote><p>Now, a few questions arise: How are we going to do this? How is this possible? We’ll try to answer these questions. Here’s how you define the problem. You’re given this problem, and now you have to deal with it.</p><h3>Building up the intuition</h3><p>Let’s say we have the following movie to guess:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*hbcTCPHU3QxMy_49yQ6fKw.png" /></figure><p>Can you guess the movie? It might seem challenging at first, but take a look at the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*GHX6EkFwgtDKlqKegV4U1g.png" /></figure><p>Guessing now is much easier, right? I hope you can guess it. The answer is TOY STORY. How were you able to guess it now? Initially, you relied on your prior knowledge about characters. However, as soon as you received new information, your predictions for each character’s position changed. Can you guess which mathematical concept we’re heading towards? Yes, it’s conditional probability.</p><p>Now, let’s delve a little deeper and focus on the third character. If I had to guess it, here are some characters that come to mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*ZyyG9oxFz1ZXIaqE0ZfXQw.png" /></figure><p>To find the probability distribution of characters in the third position across 100 three-letter words (let’s assume this is our knowledge), we need to count the occurrences of each character in the third position and then compute their probabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*oyyIkxcwCuxXdbCQUknedA.png" /><figcaption>A sample vocabulary</figcaption></figure><p>The probability distribution of the third-place character would look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*r4m9dUEk7c_Tnf3LMap7sQ.png" /></figure><p>But once we correctly predict ‘T’ and ‘O’, it becomes easier to predict that the third character is ‘Y’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CA95NupTuDoJ1yJ9" /></figure><h3>Mathematical Intuition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*K2OYyWAbUswjSgF33XIyIA.png" /></figure><p>Now let’s define this concept in terms of mathematics. Let a movie name be represented as a sequence of characters X, where X is composed of x1,x2,x3,…xn​, with n being the length of the word. Here, x1 is the first letter, x2 is the second letter, and so on.</p><p>What we conveyed in the previous section is that <em>P(x3=Y)&lt;P(x3=Y∣x1=T,x2=O,x6=T,x7=O) </em>In other words, the probability of guessing the third character as ‘Y’ is less than the probability of guessing it as ‘Y’ when the first and sixth characters are ‘T’ and the second and seventh characters are ‘O’. Your mind becomes more confident in predicting the third character.</p><p>Essentially, your mind has learned a function that maps a given unknown or partially known string to the output probability of characters. This function is called a probability distribution function. As you correctly predict more characters, the probability distribution of each character changes accordingly. Your mind has effectively learned a joint probability distribution function.</p><p>This is precisely what we need to mimic. We need a model that learns this joint probability distribution function.</p><p>How we will achieve this will be discussed in further chapters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36cbba22b7a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chapter 1 — Getting started Full stack ML course (Part 3: Model Creation, Model Assessment, Model…]]></title>
            <link>https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-3-model-creation-model-assessment-model-03828b7614d8?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/03828b7614d8</guid>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 10:49:12 GMT</pubDate>
            <atom:updated>2024-03-31T10:49:12.690Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chapter 1 — Getting started Full stack ML course (Part 3: Model Creation, Model Assessment, Model Deployment.)</h3><p>In the previous two segments of Chapter 1, I aimed to establish a foundation for upcoming practical chapters, which will feature notebooks and code examples. However, before delving into practical applications, it’s crucial to familiarize readers with key concepts and provide insights and examples to develop intuition. In <a href="https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-1-the-introduction-3f75e9e21356">Part 1</a>, I briefly introduced the model lifecycle, while in <a href="https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-2-the-introduction-1205d0f0191c">Part 2</a>, I delved deeper into specific components such as data acquisition and exploratory data analysis (EDA), demonstrating how the type of data collected influences the output. Additionally, I highlighted some noteworthy Kaggle gems, which serve as exemplary EDA notebooks.</p><p>In this segment, I will focus on introducing model creation and, more importantly, model assessment. I will try to develop some intuition about deep learning model designs for various tasks. Then we will get into what are all the components required in model creation. I also will illustrate with an example where model assessment revealed a bug in our pipeline.</p><h3>3.4 Model creation</h3><p>Honestly, while this step receives significant attention from the research community, it tends to require the least amount of time in practice. Nonetheless, the effectiveness of your approach heavily relies on this stage, provided you have quality data. In practice, there are numerous tools and methods at your disposal, and deciding which ones to employ largely depends on various factors. Determining whether to utilize machine learning (such as logistic regression, tree-based methods, SVM, etc.) or deep learning (including CNN, Transformers, etc.) is another aspect to consider. Additionally, understanding the key components of model development is crucial. These are among the questions we aim to address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/0*SPHftqrxLaYv3t38" /><figcaption>Model types available for tackling a problem</figcaption></figure><p>Consider all the methods that you studied in ML101 or Intro to Machine learning, or ML Specialization from deeplearning.ai or whatever MOOC you took as tools in a Swiss Army knife. Which one to use is dependent on various factors like</p><ol><li>Amount of data</li><li>Feature set</li><li>Complexity of feature</li><li>Hardware available</li></ol><p>I won’t delve deeply into this topic here, as a better understanding will come with familiarity with the methods and hands-on practice. However, here’s a brief overview.</p><p><strong>Amount of data</strong></p><p>When dealing with limited data, it’s wise to steer clear of deep learning techniques to avoid the risk of overfitting, given their higher parameter count. Instead, you might opt for machine learning (ML) methods like logistic regression, tree-based models, or support vector machines (SVM), weighing their respective advantages and disadvantages. This caution arises from the concept known as the curse of dimensionality. Essentially, it posits that as the number of features increases, the necessary number of examples grows exponentially. In sparse, high-dimensional spaces, models are more susceptible to overfitting. For a clearer grasp, take a look at the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hINvapnKYhOG_Hwb" /><figcaption>Illustration illustrating the “Curse of Dimensionality”. On the left: An image containing one data point and two features, showcasing multiple potential lines as solutions. However, these lines may not accurately represent the solution for the validation set or production data. On the right: Similarly, the second image depicts two data points and three features, presenting multiple planes as potential solutions, which may not be appropriate for the validation set or production data. The idea is, to represent a problem properly, there shall be large number of data points available in training dataset for a method to learn about the problem. Otherwise, too few datapoints can be easily fitted and may not be correct solution.</figcaption></figure><p><strong>Feature Set</strong></p><p>If you’ve already defined features or crafted them manually and aim to discern relationships with the output variable, opting for a machine learning (ML) based system is advisable. ML algorithms are particularly well-suited for tabular data, and many Kaggle competitions centered around tabular data still rely on ML methods. Conversely, when you lack a robust feature set, employing deep learning (DL) methods is preferable as they can learn features autonomously. In essence, for structured data, ML methods are preferred, whereas DL methods may be chosen for unstructured data. However, it’s important to note that this is a very general guideline and may vary depending on the specific circumstances.</p><p><strong>Complexity of features</strong></p><p>This corresponds to the previous point, wherein deep learning methods are employed when feature engineering is highly intricate.</p><p><strong>Hardware Available</strong></p><p>Deep learning methods demand substantial computational resources, primarily because they heavily involve matrix multiplication operations. Utilizing GPUs or other forms of accelerated computing is often necessary to meet these computational demands.</p><h4>3.4.1 Understanding various deep learning model designs</h4><p>I won’t delve into specifics here, but let’s aim to develop an intuitive understanding of how models are designed for different use cases. Now, let’s explore this section more deeply.</p><p><strong>Classification Network</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Am2k-YI57zuKD_gW" /><figcaption>Illustration displaying a classification network featuring an encoder that transforms an image into floating point numbers. These numbers are then utilized by the classifier head to classify whether the image depicts a hot dog or not.</figcaption></figure><p>Classification networks represent one of the simplest design paradigms. To grasp their design, it’s essential to establish certain parameters specific to the task, a checklist we’ll adhere to for other use cases as well:</p><ol><li><strong>Input</strong>: The input comprises unstructured data, such as images, text, sound data, or time series.</li><li><strong>Output</strong>: The desired output is a category.</li><li><strong>Objective</strong>: The goal is to classify the provided input and produce a category corresponding to the example.</li><li><strong>Design Overview</strong>: Initially, we encode the given data into a hidden representation consisting of floating-point numbers. Subsequently, this representation is fed into the classification head, which typically constitutes a linear layer with optional activation functions to produce output probabilities within the range of 0 to 1.</li></ol><p><strong>Object Detection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k-4V5UKnPJYa0k1Z" /><figcaption>Image showing components of object detection network with an encoder that predicts class and a classifier head with bounding box coordinates</figcaption></figure><p>Object detection networks represent a more complex design compared to classification networks. To delve into their design, it’s crucial to establish specific parameters tailored to this task, following a checklist similar to that of classification networks:</p><ol><li><strong>Input</strong>: The input typically consists of images or videos, where the goal is to detect and locate objects within the scene.</li><li><strong>Output</strong>: The desired output includes bounding boxes specifying the location of detected objects along with their corresponding class labels.</li><li><strong>Objective</strong>: The aim is to accurately identify and localize objects within the input image or video.</li><li><strong>Design Overview</strong>: Initially, the input data undergoes feature extraction using a convolutional neural network (CNN) to capture relevant spatial information. Subsequently, these features are passed to a region proposal network (RPN) or similar mechanism to generate candidate object bounding boxes. These proposals are refined and classified by a classification head and regression head, respectively, to produce the final predictions, consisting of bounding boxes and class labels for detected objects.</li></ol><p><strong>Segmentation Task</strong></p><p>For segmentation tasks, the network architecture is tailored to the specific requirements of segmenting objects within an image. Here’s an outline akin to the previous ones:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f44z7SmwFLU1BJ0a" /><figcaption>Image showing components of segmentation network which first downsample the image while increasing the number of channels, and a decoder which upsample the intermediate result to original resolution in one channel.</figcaption></figure><ol><li><strong>Input</strong>: The input comprises images where each pixel needs to be assigned a class label or a category indicating the object or region it belongs to.</li><li><strong>Output</strong>: The desired output is a segmentation mask or a pixel-wise classification map that delineates the boundaries of objects or regions within the input image.</li><li><strong>Objective</strong>: The goal is to accurately delineate and classify each pixel in the input image, thus partitioning the image into meaningful segments corresponding to different objects or regions.</li><li><strong>Design Overview</strong>: For segmentation tasks, the network architecture typically involves an encoder-decoder framework tailored to the specific requirements of segmenting objects within an image. Initially, the input image is processed through an encoder, which extracts hierarchical features through a series of convolutional layers. These features are then decoded or upsampled by the decoder to generate a dense pixel-wise prediction map. The final output is a segmentation mask where each pixel is assigned a class label representing the object or region it belongs to.</li></ol><p><strong>Translation Task</strong></p><p>For translation tasks, the network architecture is designed to translate text from one language to another. Here’s a brief overview:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TqFhaqvaVr4px9JJ" /><figcaption>Image showing a dialogue from the series “Narcos” being translated to english. There are two components. An encoder which encodes the spanish sentence, which is then fed to decoder which iteratively translates the sentence to english.</figcaption></figure><p><strong>Input</strong>: The input consists of text in one language that needs to be translated into another language.</p><p><strong>Output</strong>: The desired output is the translated text in the target language.</p><p><strong>Objective</strong>: The goal is to accurately translate each word or sequence of words from the source language to the target language.</p><p><strong>Design Overview</strong>: Translation tasks often utilize an encoder-decoder architecture specifically tailored for text translation. Initially, the input text is processed through an encoder, which converts the text into a numerical representation capturing its semantic meaning. This encoder typically consists of recurrent neural network (RNN) layers or transformer layers. The encoded representation is then fed into a decoder, which generates the translated text in the target language. The decoder utilizes attention mechanisms to focus on relevant parts of the input during the translation process. Overall, the encoder-decoder framework enables effective translation by converting text from one language to another while preserving its meaning and context.</p><h4>3.4.2 Ingredients of a Model training routine</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/0*9E2SsOMoE_0ZvSey" /><figcaption>Visual representation displaying various elements within a model training framework. If you are 90s kid with some memories of cartoon network. Then you would recognise this image. I hope this triggers nostalgia in you.</figcaption></figure><p>There are several components essential for model training, and I’ll outline some of them here. These modules typically form the foundation when training a deep learning model, and I consistently refer to this checklist when building a model, especially within a PyTorch Lightning module, which I highly recommend for anyone embarking on model training. Now, let’s dive into the checklist:</p><ol><li><strong>Data / Dataloader</strong>: The data loader is a class that utilizes a dataset class, responsible for tasks such as reading, augmenting, and returning the data, and then collating them into batches, either randomly or according to user-defined logic.</li><li><strong>Model</strong>: This is the primary model class defining the model architecture and the forward pass. Essentially, it encapsulates the logic for processing input from the data loader and executing the forward pass.</li><li><strong>Loss function</strong>: This component is pivotal, dictating how incorrect predictions are penalized and guiding the learning process.</li><li><strong>Metric</strong>: Metrics provide crucial quantitative insights into the model’s performance. Initially, one might wonder why both loss and metrics are necessary. While the loss function is designed to be differentiable for optimization purposes, metrics offer a non-differentiable evaluation of model performance, closely aligned with the task at hand.</li><li><strong>Optimizer</strong>: The optimizer algorithm manages gradients during the backward pass. Typically, a standard optimizer is employed across various tasks, influencing the speed of convergence by minimizing oscillations and facilitating faster convergence on the same loss surface. Here is the link that gives a perspective into this. <a href="https://miro.medium.com/v2/resize:fit:720/format:webp/1*47skUygd3tWf3yB9A10QHg.gif">https://miro.medium.com/v2/resize:fit:720/format:webp/1*47skUygd3tWf3yB9A10QHg.gif</a></li><li><strong>Scheduler</strong>: This component governs the management of the learning rate throughout the training process, determining whether to maintain it constant or adjust it according to a predefined schedule.</li></ol><h3>3.5 Model assessment</h3><p>Alright, let’s discuss what to do after training your model. You’ve achieved convergence and obtained satisfactory or even improved results on the validation data compared to previous experiments. But can you confidently deploy your model based solely on these metrics? In this section, I’ll share my experiences and lessons learned from training numerous models and making mistakes along the way. It’s all part of the learning process.</p><p>So, what steps should you take after your model is trained? Here are some checks to ensure you understand what the model has learned:</p><h4>1. Check Your Metrics Implementation</h4><p>It’s essential to double-check your metrics before training your model. Make sure your metrics are working correctly by testing them with the actual data and comparing the results with the expected outcome. This step is crucial because sometimes open-source implementations can change unintentionally, causing differences in how metrics perform. By verifying your metric implementation, you’ll feel more confident and better understand how loss affects the metric. Ideally, you want to see a negative correlation, as this indicates optimal metric performance. Meaning, as the loss reduces, metric shall increase. If its not the case then it may mean two things</p><ol><li>Either loss is optimal for learning the examples</li><li>Or wrong metric is used, and hence even if the loss is reduced, metric does not represent our objective. (for eg. loss for classification model may be going down, and let us say you have defined some metric ‘ugx-metric’ which is not improving. This means ugx is not inline with loss, and what model may be learning is not represented by the metric)</li></ol><h4>2. Evaluate Metric Selection</h4><p>Again, this should have been done beforehand, but it’s essential to reinforce. Consider the example of a classification task for a rare disease like cancer, where class imbalance is prevalent. For instance, if only 1% of a dataset of 1000 people are cancer-positive, and the model correctly identifies just 2 individuals while marking 989 as true negatives, accuracy may yield a high percentage (99.1%). However, this does not reflect the true performance, as only 2 cases were accurately identified. In contrast, using a metric like f-measure would yield a lower value (around 0.3), indicating the actual performance more accurately. It’s crucial to ensure that your metrics align with the business requirements.</p><p>Consider the following examples, each with different metric requirements:</p><ul><li><strong>Spam Email Detection:</strong> In email filtering systems, correctly identifying legitimate emails (negative class) is vital to prevent false positives, prioritizing precision to avoid marking important emails as spam, even at the expense of potentially missing some spam emails (lower recall).</li><li><strong>Search and Rescue Operations</strong>: In search and rescue missions, maximizing recall is essential to ensure no survivors are overlooked, even if it means including some false alarms (lower precision) that may require further verification.</li></ul><h4>3. Don’t trust the metrics alone</h4><p>Let’s delve into the crux of this section. Once you’ve finalized your metrics and gained confidence in their reliability, it’s crucial to exercise caution when interpreting metric values. What does that mean? Well, at times, metrics can be misleading. Now, you might wonder if this contradicts my earlier point. Yes, it does, but hear me out for a moment. After completing the training phase, follow these steps:</p><ol><li>Verify that your training and validation metrics are closely aligned, indicating minimal overfitting. It’s natural for validation metrics to slightly lag behind training metrics, but there shouldn’t be a significant difference.</li><li>Evaluate your metrics on the test set. Is the value substantially lower than the validation metrics? If so, examine the test data. Does it closely resemble the validation data, or are there noticeable differences? This comparison will provide valuable insights.</li><li>Also, scrutinize if both validation and test metrics are exceptionally high, approaching an ideal scenario. While not always indicative of a problem, it’s worth investigating further. Plot your predictions to assess the model’s performance visually. You might uncover discrepancies where the metrics don’t align with the actual predictions.</li><li>If everything seems fine, conduct additional testing on a subset of the validation data. Infer on each example, creating a pandas dataframe pairing each sample with its corresponding metric. Utilize ipywidgets for interactive visualization to observe how the model performs. Personally I use weights and biases . Categorize examples based on performance metrics (good, moderate, and poor) to identify areas for improvement. Plot examples where the model struggles to provide accurate predictions, allowing for in-depth analysis of its performance. Example, look at this wandb report, it shows how you can do analysis on a classification model. Please go through this link, it will give you a new perspective about the model assessment <a href="https://wandb.ai/stacey/mendeleev/reports/Tables-Tutorial-Visualize-Data-for-Image-Classification--VmlldzozNjE3NjA?galleryTag=computer-vision">https://wandb.ai/stacey/mendeleev/reports/Tables-Tutorial-Visualize-Data-for-Image-Classification--VmlldzozNjE3NjA?galleryTag=computer-vision</a> . I use wandb reporting when I need to showcase my results to a larger team of data science people.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/0*iSi_b_by-ErrLKd9" /><figcaption>Visual depiction illustrating a typical fetal ultrasound alongside an abnormality characterized by a lemon-shaped skull.</figcaption></figure><p>Allow me to share an instance where the above checklist proved invaluable. This methodology was born out of a specific incident. I was tasked with classifying lemon-shaped skulls, an anomaly that occurs in a few infants and can be detected during a second-trimester scan. Upon training the model, I was pleasantly surprised to achieve impressive results, boasting a validation dataset F1 score of 99%. However, a pivotal moment ensued before our presentation to upper management. We decided to test our model on textbook examples of lemon-shaped anomalies downloaded from the internet. To our dismay, the model not only failed to classify these examples correctly but also misidentified negative samples, i.e., normal skulls as lemon-shaped anomalies. To address this issue, we employed a technique called GradCam, which generates a heatmap highlighting the pixels influencing the model’s prediction. To our astonishment, the model was not focusing on the lemon-shaped anomalies but rather on a faded annotation in the top right corner that read “lemon shape detected.” This annotation had been overlooked during training, potentially leading to a humiliating outcome during our presentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jJXmGcHz0mVJWbN4" /><figcaption>a) Image displaying select samples from the dataset featuring lemon-shaped skulls. (b) Illustration showcasing the Grad-CAM visualization of these dataset samples. The highlighted red region indicates the focal point of the neural network’s attention for the output. Surprisingly, it is not emphasizing the characteristic skull pinching associated with lemon-shaped skulls, but rather focusing on the bottom-right area. ( c ) Zoomed-in view of the bottom-right section of the image, revealing a textual annotation present in those specific samples.</figcaption></figure><h3>3.6 Model deployment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*AaE42h3vrc_5OeWA" /><figcaption>Image showing two ways to deploy your service as an API.</figcaption></figure><p>Model deployment is the crucial step in the full stack model development process, where the trained machine learning model is made accessible for inference by integrating it into a production environment. One of the simplest ways to deploy a model is by using frameworks like Flask, which allow you to create web APIs to serve predictions. Another option gaining popularity is TorchServe, a PyTorch model serving library, which simplifies the deployment process by providing features like multi-model serving, model versioning, and metrics monitoring. TorchServe offers advantages such as scalability, ease of deployment, and compatibility with various deep learning models. However, regardless of the deployment method chosen, it’s essential to consider factors like latency (P99), which represents the worst-case response time experienced by users, and concurrency, which refers to the number of simultaneous requests the API can handle efficiently. Ensuring optimal performance in terms of latency and concurrency is crucial for providing a seamless user experience. We will explore a bit on this in later chapters.</p><h4>3.7 Model Monitoring</h4><p>Monitoring your machine learning models is crucial for keeping them reliable in real-world situations. One big challenge is spotting data shift, which happens when the kind of data coming in changes over time, making the model perform worse.</p><p>In real life, we check how well the model’s predictions match reality and how it behaves over time. If there are big differences or unexpected changes in how well it’s doing, we know something might be wrong. Regular monitoring helps catch these problems early and lets us adjust the model to keep it accurate.Monitoring tools keep an eye on metrics like accuracy, precision, and others to see how well the model is doing. They also look at things like how fast the model responds.</p><p>Deciding when to update the model depends on a few things, like how much the data has changed, how it’s affecting the model’s performance, and if we have the resources to update it. If the model isn’t performing well or the data has shifted a lot, it’s probably time for an update. Keeping an eye on the model and updating it when needed makes sure it stays reliable for real-world use.</p><h3>4. When Not to use ML</h3><p>Guidelines for determining when to avoid using Machine Learning:</p><ol><li>Opt for traditional software development if it can solve the problem at a lower cost.</li><li>Avoid Machine Learning if obtaining accurate data is overly complex or unfeasible.</li><li>Steer clear if the task demands a substantial amount of manually labeled data.</li><li>Reconsider if the potential cost of errors made by the system is prohibitively high.</li><li>Avoid models that lack the need for frequent improvement or incremental learning over time.</li><li>Reconsider if the interpretability of every decision made by the model is essential.</li></ol><h3>5. Conclusion</h3><p>In conclusion, the journey through the typical machine learning lifecycle, from problem identification to model deployment and monitoring, is a dynamic and iterative process. Each stage presents its unique challenges and opportunities for learning and improvement. Problem identification sets the stage for the entire process, guiding the direction of data acquisition, exploratory data analysis, and ultimately model creation. Model assessment ensures the quality and reliability of the developed model, paving the way for successful deployment into production environments. However, deployment is not the end of the road; ongoing monitoring and evaluation are essential to ensure that the model continues to perform effectively over time. By embracing the iterative nature of the ML lifecycle and incorporating feedback from monitoring, practitioners can continually refine and enhance their models, driving greater value and impact in real-world applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=03828b7614d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chapter 1 — Getting started Full stack ML course (Part 2: The introduction)]]></title>
            <link>https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-2-the-introduction-1205d0f0191c?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/1205d0f0191c</guid>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Thu, 07 Mar 2024 10:43:44 GMT</pubDate>
            <atom:updated>2024-03-31T10:53:24.615Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chapter 1 — Getting started Full stack ML course (Part 2: Unveiling the Foundations: Problem Definition, Data Acquisition, and EDA)</h3><p>In the previous blog, I discussed the course introduction, focusing on fundamental aspects. We explored the reasons for using ML solutions and began discussing the ML development lifecycle. In this blog, we’ll delve deeper into the ML development lifecycle, addressing key topics crucial for any ML project. Specifically, we’ll cover ML model problem definition, the significance of defining a problem statement, followed by the data acquisition step, and conclude with “Exploratory Data Analysis.”</p><h3>3. The ML Dev lifecycle</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J1tgVblIn25ruZh8" /><figcaption>An image showing model lifecycle</figcaption></figure><p>The typical ML lifecycle encompasses several key stages:</p><p>1. Problem identification</p><p>2. Data acquisition</p><p>3. Exploratory Data Analysis</p><p>4. Model creation</p><p>5. Model assessment</p><p>6. Model deployment</p><p>7. Monitoring</p><p>While these steps are essential, they don’t cover every aspect of the process. It’s worth noting that a significant portion of time is usually dedicated to the first three steps, with the least amount of time spent on model development. Additionally, it’s important to remember that these steps represent just one iteration of the development cycle.</p><p>In the following section, I’ll delve into each of these steps in more detail, providing a comprehensive overview of what they entail. Stay tuned for more insights in the upcoming discussion.</p><h4>3.1 Problem definition</h4><p>Alright, this segment holds significant importance. Through my experience, I’ve come to realise that this aspect is often neglected. In the past, I would repeatedly review research papers, placing excessive emphasis on methodologies rather than the paper’s overarching objectives. The crux of the matter lies in problem definition. Grasping the problem definition aids in minimizing the time required to comprehend a new problem you undertake, especially considering that you won’t be addressing the same issue throughout your career.</p><p>In the upcoming section, I’ll endeavor to outline the process of defining a problem. But what does that entail exactly? Simply put, defining a problem involves articulating the objective of a problem in a technical manner. What is the objective the method is aiming to accomplish? This must be articulated in technical terms. You can opt for plain English or, better yet, employ mathematical notation, as the latter enables a more precise and succinct definition of the problem.</p><h4>Example 1: A classification problem</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CW33g3eVBkUgOAIB" /></figure><p>Imagine we have to identify if the image is hot dog or not hot dog. Then defining problem technically would look like</p><blockquote>“The problem involves developing a binary classification model to accurately label images as ‘hot dog’ or ‘not hot dog’. The objective is to maximize the likelihood of correctly assigning labels to input images.”</blockquote><p>Mathematically it would mean. Let x be an input image. The goal is to determine the label <em>y</em> such that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/0*tAl-Z7bO_rUJGeCs" /></figure><p>We aim to learn a function f(x) that maps input images to their correct labels, where f(x) is optimized to maximize the probability of the correct label:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/139/0*CmNF--ODchWbdGiA" /></figure><h4>Example 2: A foreground detection</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*J5RqMJwlI6ERP0cAgaJ3Ew.png" /></figure><p>Consider a task where we need to segment images to identify different objects within the scene. Defining the problem technically would appear as follows:</p><p>The problem entails developing a segmentation model to partition images into distinct regions corresponding to different objects or classes. The objective is to accurately delineate object boundaries within the image.</p><p>Mathematically it would mean: Let <em>x</em> represent an input image.</p><p>The objective is to assign each pixel in the image to a specific class y , such that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/0*eXsXOuPu9h7U6ohK" /></figure><p>We aim to learn a function f(x) that maps input images and their pixel (x) to foreground or background, where f(x) is optimized to maximize the accuracy of pixel-wise class assignments:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/128/0*YYKLgzluXRMOHpw-" /></figure><h4>Example 3: A next word prediction task</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*lOfp-9sBWPayHiBX" /></figure><p>Suppose we have a task where we want to predict the next word in a sentence based on the context provided. Defining the problem technically would appear as follows:</p><p>The problem involves developing a language model capable of predicting the most likely next word given a sequence of input words. The objective is to accurately anticipate the word that follows the input context.</p><p>Mathematically it would mean:</p><p>Let w₁, w₂, …., wₙ represent a sequence of n words in a given text.</p><p>The goal is to predict the next word wₙ₊₁ given the preceding n words.</p><p>Mathematically, the prediction can be formulated as:</p><p>wₙ₊₁ = ₐᵣ𝓰ₘₐₓw P(w | w₁, w₂, …., wₙ)</p><p>where P(w | w₁, w₂, …., wₙ) represents the probability of the next word w given the preceding sequence of words w₁, w₂, …., wₙ .</p><p>The idea for defining the problem is to have a crystal clear understanding of the problem at hand. Unless you are able to define the problem correctly, you won’t be able to apply correct methods to the problem.</p><h4>3.2 Data acquisition</h4><p>Data acquisition is a crucial step in the machine learning pipeline, where the quality and relevance of the acquired data greatly influence the performance and accuracy of the resulting models. When acquiring data, it’s essential to consider various factors to ensure the integrity and representativeness of the dataset. One significant concern is the presence of biases in the data, which can lead to skewed or inaccurate model predictions. Biases can arise from various sources, including sampling methods, data collection processes, and societal or cultural influences. To mitigate biases, it’s important to employ diverse and representative datasets, actively identify and address any inherent biases, and ensure transparency and accountability in the data collection process. Additionally, adopting good practices such as data anonymization, ensuring data privacy and security, and obtaining necessary permissions or consents from data subjects are essential for ethical data acquisition. Moreover, incorporating domain knowledge and expertise during the data acquisition phase can help guide the selection of relevant features and ensure the dataset’s suitability for the intended machine learning task. By adhering to these practices, practitioners can acquire high-quality data that forms the foundation for robust and reliable machine learning models.</p><p>Okay so here is my experience with this point. I would like to show you what happens when you do a data collection and not care about its quality. Here is the thing. You must have seen this phrase</p><blockquote><em>“Garbage in, Garbage out”</em></blockquote><p>Well that is what actually happens. See neural networks are just function approximators, they learn from the data they are fed in. So you shouldn’t be surprised if they give predictions that are not inline with your intuition. Now is the time for example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*vPVzS7YdjcZyKrCf5CjwZg.png" /></figure><p>While developing a foreground detection model, commonly referred to as “Salient Object Detection,” I conducted training and made inferences on the provided image. The resulting prediction, depicted by the red mask, appeared satisfactory at first glance. However, intuition suggested that the branch should have been identified as part of the foreground. This scenario underscores the significance of data in model training. Upon reviewing the dataset, I encountered images where the branch was not categorized as part of the foreground. Given this observation, the prediction made earlier aligns with the dataset’s characteristics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*kprW2VQJr6vR4-bz3I1jEA.png" /><figcaption>Image samples from the dataset</figcaption></figure><h4>3.3 Exploratory Data Analysis</h4><p>Exploratory Data Analysis (EDA) is like peering through a window into the soul of your dataset. It’s the crucial first step in any data science journey, where you roll up your sleeves and dive deep into the data. EDA is all about getting acquainted with your data, understanding its quirks, patterns, and potential pitfalls before jumping into modeling. It’s like exploring a new city — you wander around, take note of landmarks, peek into hidden alleys, and get a feel for the vibe. Without EDA, you’re basically flying blind, risking misinterpretation or overlooking important insights. To tackle EDA like a pro, you should</p><ol><li>Jot down a few inquiries you’re curious about uncovering. These can span a wide range of topics.</li><li>Formulate hypotheses regarding the data and put them to the test during the exploratory data analysis (EDA) phase.</li><li>Begin by graphically representing your data, identifying any anomalies, examining distributions, and unraveling connections among variables.</li></ol><p>Think of it as laying the groundwork before constructing a building — you need a solid foundation to build something meaningful. Okay, I know this is the time where I have to give you some examples. I promise these would be really interesting. Okay, I can say this for me atleast. Before I start, I should provide you with this link <a href="https://www.kaggle.com/code/headsortails/hidden-gems-a-collection-of-underrated-notebooks">https://www.kaggle.com/code/headsortails/hidden-gems-a-collection-of-underrated-notebooks</a> , this is called kaggle hidden gems. Kaggle is a platform for data science enthusiast, and learners. You should check this out. It has links to many interesting notebooks. Back to some examples of EDA.</p><p><strong>3.3.1 Example 1: Analysis of Chai Time Data Science Podcast </strong><a href="https://www.kaggle.com/code/thedatabeast/making-perfect-chai-and-other-tales/notebook"><strong>Notebook Link</strong></a></p><p>In this insightful notebook, the author dives deep into the YouTube analytics of the <a href="https://www.youtube.com/@ChaiTimeDataScience">Chai Time Data Science (CTDS) podcast</a>, shedding light on what makes its episodes successful and how to expand its reach. I highly recommend you to check out his channel. The author explores why YouTube is a key player in CTDS’s strategy and uncovers valuable insights to enhance its performance.</p><p><strong>Top 5 Questions Explored:</strong></p><ol><li>What factors influence viewer engagement with video thumbnails?</li><li>How does the thumbnail format impact click-through rates?</li><li>What’s the effect of releasing mini-CTDS episodes on the same day?</li><li>Are custom thumbnails with CTDS branding more effective?</li><li>What drives viewers to watch a video beyond the initial click?</li></ol><p><strong>Hypotheses Examined</strong>:</p><ol><li>Thumbnail design, including topic and duration, influences viewer behavior.</li><li>Spacing out mini-CTDS releases could boost overall engagement.</li><li>Custom thumbnails with CTDS branding may attract more viewers.</li><li>Viewer interest correlates with the percentage of the video watched.</li><li>Relevance and content quality determine viewer retention, especially evident in mini-CTDS episodes.</li></ol><p><strong>Conclusion</strong>:</p><p>The analysis provides valuable insights into optimizing CTDS’s YouTube presence. By understanding viewer behavior and preferences, the podcast can tailor its content and marketing strategies to attract a wider audience. With these insights, CTDS can continue to foster a vibrant community of data science enthusiasts and thought leaders. Let’s harness the power of data to amplify the impact of CTDS on YouTube!</p><p><strong>3.3.2 Analysis of Kaggle survey. </strong><a href="https://www.kaggle.com/code/jennifercrockett/a-heatmap-roadmap-to-your-dream-job/notebook"><strong>Notebook link</strong></a></p><p>This notebook is incredibly intriguing as it delves into several key questions regarding data science professionals. It explores topics such as the necessary skills for these professionals and the preferred programming languages they utilize. Among the fascinating insights provided, one can observe:</p><ul><li>The diverse range of professions within the data science field, extending beyond just data scientists. The accompanying graph offers a visual representation of these roles.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*UtrlP9Q3ypDFsmpKUdoWLA.png" /></figure><ul><li>A comparison of the skills required for business analysts versus ML engineers, highlighting significant differences between the two roles. Below figure is made by me. The author has shown cluster plot which more or less conveys the same message.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AtlEpE9v0xqgoaYC" /></figure><p>The primary purpose of exploratory data analysis (EDA) is to glean insights from the data, to find answers to your inquiries, and to uncover any latent biases that must not be disregarded.</p><h3>Conclusion</h3><p>In conclusion, this blog installment has provided a comprehensive exploration of key components in the machine learning (ML) development lifecycle. We’ve discussed the critical importance of accurately defining problem statements, ensuring high-quality data acquisition, and conducting thorough exploratory data analysis (EDA) to lay the groundwork for successful ML projects. By understanding these foundational principles and practices, practitioners can navigate the complexities of ML development with greater clarity and efficacy. As we continue our journey, let’s apply these insights to real-world scenarios and explore further stages of the ML lifecycle. Stay tuned for more practical examples and in-depth discussions to deepen your understanding of machine learning concepts.</p><p>The link for next chapter will be provided here.<br><a href="https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-3-model-creation-model-assessment-model-03828b7614d8">https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-3-model-creation-model-assessment-model-03828b7614d8</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1205d0f0191c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chapter 1 — Getting started Full stack ML course (Part 1: The introduction)]]></title>
            <link>https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-1-the-introduction-3f75e9e21356?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f75e9e21356</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ml-course]]></category>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Tue, 05 Mar 2024 04:41:15 GMT</pubDate>
            <atom:updated>2024-03-31T10:53:05.264Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chapter 1 — Getting started Full stack ML course (Part 1: The introduction)</h3><p>The overview of this Chapter is as follows. I will also provide the link once I publish the other parts.</p><h4>Index</h4><p><strong>1. Introduction<br>2. Why and when to use Machine Learning as a solution?</strong><br><a href="https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-2-the-introduction-1205d0f0191c"><strong>3. The ML Dev lifecycle</strong><br><em> 3.1 Problem definition<br>3.2 Data acquisition<br>3.3 Exploratory Data Analysis</em></a><em><br></em><a href="https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-3-model-creation-model-assessment-model-03828b7614d8"><em>3.4 Model creation<br>3.5 Model assessment<br>3.6 Model deployment<br>3.7 Model Monitoring</em></a><br><strong>4. When Not to use ML</strong><br><strong>5. Conclusion</strong></p><figure><img alt="Neural Network" src="https://cdn-images-1.medium.com/max/1024/1*SN436JPY83C1UBA_dqIQXA.png" /></figure><p>After extensive writing, editing, and refining, I completed the entire blog for this section. However, upon receiving feedback from friends and colleagues, I realised that the content was too lengthy for today’s shortened attention spans, influenced by platforms like TikTok. Consequently, I’ve decided to release this chapter in multiple parts without omitting any crucial information, as I believe each part holds significance. These chapters reflect my personal experiences, which I’m excited to share here.</p><blockquote>Disclaimer: The content presented in this blog represents my own interpretation of the field. It’s possible that I may have overlooked certain points, either unintentionally or deliberately. If you disagree with any aspects or wish to contribute additional insights, please feel free to share them in the comments section. 😀</blockquote><p>In this segment, we will delve into the introduction and explore the reasons behind the necessity of machine learning. Additionally, we’ll introduce the ML model lifecycle in the final section.</p><h3>1. Introduction</h3><p>I believe you have read the previous blog post and want to know more about this course. After a couple of week’s break I am back. So as you might have guessed from the title. This part of the blog covers the basics. This part of series deals with developing an overview of what goes into a ML system. Primarily you will learn about</p><ol><li>Why ML is used to solve a problem</li><li>Some Examples of ML Application</li><li>What will be needed when you start a ML project</li><li>When not to use ML</li><li>The lifecycle of a ML dev cycle</li></ol><p>I have covered some topics not exhaustive, which I think will set you up for future ML projects. If you are interested in learning about what to expect from an ML project, you may proceed ahead.</p><h3>2. Why and when to use Machine Learning as a solution?</h3><p>To be frank, there’s no one-size-fits-all rule here. It’s all about using logic to guide our decisions. So, when do we bust out the big guns of machine learning (ML)? Well, let’s start with why ML exists in the first place. In simple terms:</p><p>“A machine learning solution is like your superhero cape” when:</p><ol><li>the rules you’ve set up are just scratching the surface</li><li>defining those rules feels like trying to find a needle in a haystack, and</li><li>things get pretty tangled up, and the connections aren’t just straight lines.”</li></ol><p>Now, let’s break it down:</p><ul><li><strong>Insufficient Heuristic Rules: </strong>When our old-school rules can’t quite keep up with the crazy twists and turns of real-world data, ML swoops in to save the day. Think fraud detection systems. Sometimes, the rules we’ve set up miss the sneaky new tricks fraudsters come up with. ML, though, can stay on its toes, learning from the latest data to catch those slippery scammers.</li><li><strong>Complex Rule Definition</strong>: Picture this: you’re trying to come up with rules for something super complicated, like understanding human language. Trust me, it’s a tough gig. But with ML, we don’t have to pull our hair out trying to spell it all out. ML can learn from the data itself, especially handy in fields like natural language processing (NLP).</li><li><strong>Nonlinear Feature Relationships</strong>: In the real world, things rarely follow a straight path. Take medical diagnosis, for example. Symptoms and diseases? They’ve got a complicated relationship status. ML models, especially the fancy ones like neural networks, are like detectives sniffing out those hidden connections. They’re great at spotting the twists and turns that would leave our rule-based systems scratching their heads.</li></ul><p>Alright, enough with the technical talk. Let’s dive into a real-life example.</p><p>Your task is to classify a review as positive sentiment vs a negative sentiment. What will be your rules to classify. One way to think this by first using a dictionary of positive words, negative words and neutral words. Let’s give them a weight +1, 0, -1 for positive neutral and negative respectively.</p><p>Looks good lets test.</p><p><strong>Review 1</strong></p><blockquote><em>“1917 is an absolute masterpiece! The cinematography is breathtaking, immersing viewers into the harrowing landscape of World War I. The storytelling is compelling, following two soldiers on a mission that keeps you on the edge of your seat throughout the film. The performances are outstanding, especially from the lead actors who deliver powerful performances. I highly recommend watching 1917, as it’s not just a movie, but an experience that will stay with you long after the credits roll.”</em></blockquote><ul><li><strong>Positive words</strong>: masterpiece, breathtaking, compelling, outstanding, powerful, highly recommend, experience</li><li><strong>Neutral words</strong>: absolute, viewers, stay</li><li><strong>Negative words</strong>: None</li><li><strong>Total score</strong>: 7×1+3×0+0×(−1)=7</li></ul><p><strong>Review 2</strong></p><blockquote><em>“As much as I wanted to love 1917, I found myself disappointed by its lack of depth and character development. The film relies heavily on its technical achievements, such as the one-shot technique, but neglects to flesh out its characters or provide meaningful context for the events unfolding on screen. While the action sequences are well-executed, they feel disconnected from the emotional core of the story. Overall, 1917 left me feeling underwhelmed and wanting more from its narrative.”</em></blockquote><ul><li><strong>Positive words</strong>: None</li><li><strong>Neutral words</strong>: much, love, disappointed, lack, context, underwhelmed, wanting, narrative</li><li><strong>Negative words</strong>: neglects, disconnected</li><li><strong>Total score</strong>: 0×1+8×0+2×(−1)=−2</li></ul><p>As you can see review 1 can be classified as positive and review 2 can be classified as negative.</p><p>Looks like our system nailed it for these two reviews. But hold up, what about this tricky one? Now apply the above rules in this review</p><p><strong>Review 3</strong></p><blockquote><em>“1914” begins with promise but falls short in its initial half, struggling with pacing and disjointed scenes. However, it redeems itself in the second half, delivering a visually stunning spectacle with powerful performances that leave a lasting impact. Despite its rocky start, “1914” ultimately proves to be a captivating cinematic journey.</em></blockquote><ul><li><strong>Positive words</strong>: +1 (stunning, powerful, captivating)</li><li><strong>Neutral words</strong>: 0 (however, with, that, a)</li><li><strong>Negative words</strong>: -1 (struggling, disjointed, rocky)</li><li><strong>Total Score</strong>: +1 (positive words) + 0 (neutral words) — 1 (negative words) = 0</li></ul><p>Huh, seems like our system missed the mark on this one. It’s actually a positive review!</p><p>So, here’s the scoop: Language, images, you name it — they’re tricky beasts. Trying to sum them up with hard-and-fast rules? It’s like trying to herd cats. That’s where ML struts in like a boss, learning the ropes on its own and making sense of all the chaos. And that, my friends, is why ML is the hero we need in this wild, wild world.</p><h3>3. The ML Dev lifecycle</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J1tgVblIn25ruZh8" /><figcaption>An image showing model lifecycle</figcaption></figure><p>The typical ML lifecycle encompasses several key stages:</p><p>1. Problem identification</p><p>2. Data acquisition</p><p>3. Exploratory Data Analysis</p><p>4. Model creation</p><p>5. Model assessment</p><p>6. Model deployment</p><p>7. Monitoring</p><p>While these steps are essential, they don’t cover every aspect of the process. It’s worth noting that a significant portion of time is usually dedicated to the first three steps, with the least amount of time spent on model development. Additionally, it’s important to remember that these steps represent just one iteration of the development cycle.</p><p>In the following section, I’ll delve into each of these steps in more detail, providing a comprehensive overview of what they entail. Stay tuned for more insights in the upcoming discussion.</p><p>In next chapter we will get into some of these components in details.<br>I will post link to next part here</p><p>Next Chapter: <a href="https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-2-the-introduction-1205d0f0191c">https://medium.com/@shivam.kaushik73/chapter-1-getting-started-full-stack-ml-course-part-2-the-introduction-1205d0f0191c</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f75e9e21356" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Full Stack ML Course]]></title>
            <link>https://medium.com/@shivam.kaushik73/the-full-stack-ml-course-e01dabfce14c?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/e01dabfce14c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ml-system]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Mon, 25 Dec 2023 11:43:11 GMT</pubDate>
            <atom:updated>2023-12-25T11:43:11.982Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G8TFZkUu9Iw6EbBjEjwmIw.png" /></figure><p>You’re here reading this article, so I’m guessing you’re eager to discover more about this course, right? Wondering who it’s designed for, what you’ll gain from it? Well, in this piece, I’m here to address precisely that. But before we dive in, let me share a brief introduction about myself. I’m Shivam Kaushik, a professional Data Scientist engaged in researching, applying, and implementing ML Systems. My journey is all about continuous learning.</p><h3>What this course is about?</h3><p>This course is a free course that will focus on building ML solution. This blog series is basically something I felt lacking when I was learning about ML systems. I wanted to take one ML problem and wanted to develop it as solution and host an API. I also wanted to learn what was followed in the industry. Sadly, I could not find any good free resource that took it from start to end. The resources I found out were either to deep into technicality and less application based or too abstract. None of them took a project based approach. So that is what I will be doing in this series.</p><p>So yes, you will</p><ol><li>take a problem, formulate it as ml problem</li><li>do some EDA (Exploratory Data Analysis) to understand data</li><li>use an appropriate model</li><li>understand model and develop an interactive app to show case your idea</li><li>serve it as an API</li><li>load test an api</li></ol><p>The technology used here may be outdated in future, but I am confident the approach will remain useful.</p><h3>Who is this course for?</h3><p>This course caters to individuals who:<br>1. Have a foundational understanding of machine learning and deep learning.<br>2. Possess a grasp of Python.<br>3. Have created models using PyTorch.<br>4. Desire to grasp industry-standard practices.<br>5. Seek guidance on transforming a problem statement into a comprehensive ML solution.<br>6. Are keen on understanding the entire pipeline of a Data Science project.<br>7. Want to undertake a complete project, showcasing it on their resume from start to finish.</p><h3>Why am I making this series?</h3><p>As I mentioned earlier, I found a crucial gap in my knowledge when tasked with model deployment. Even in my initial job experiences, the process of deploying a model wasn’t something I had the chance to learn. Creating an ML service sheds light on numerous aspects. Having a complete picture offers a deeper understanding of the entire system, equipping you better to tackle problems comprehensively.</p><h3>What technologies you will learn?</h3><p>You will learn</p><ol><li>Pytorch Lightning</li><li>Huggingface transformer model</li><li>WandB for model training and evaluation</li><li>Streamlit for making interactive app</li><li>Torchserve to serve a model</li><li>Locust for load testing</li></ol><h3>Is it free?</h3><p>Yes, it is</p><h3>Where will the code be?</h3><p>I will post code on kaggle, so you don’t have to do a setup.</p><p>I hope I have answered some of your questions. If you are interested, follow the sequential articles. I will post it as an index here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e01dabfce14c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intuitive Explanation of Differentiable Architecture Search (DARTS)]]></title>
            <link>https://medium.com/data-science/intuitive-explanation-of-differentiable-architecture-search-darts-692bdadcc69c?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/692bdadcc69c</guid>
            <category><![CDATA[inside-ai]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Mon, 31 Aug 2020 16:28:49 GMT</pubDate>
            <atom:updated>2020-08-31T17:19:15.187Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VDXGguPR6x5F9mGI" /><figcaption>Photo by <a href="https://unsplash.com/@moritz_photography?utm_source=medium&amp;utm_medium=referral">Moritz Kindler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Inside AI</h4><h4>Understanding how DARTS work!</h4><p>This is a paper that came out in the midst of 2018, addresses the problem of scalability of searching a network architecture. These papers address the problem of <strong>Neural Architecture Search</strong> or <strong>NAS</strong> in short.</p><p>As the name suggests, the idea behind this field is to explore how can we automatically search deep learning model architectures. Currently, most of the data science problems are solved by manually designing the model architecture which gives “<strong>state of the art</strong>” results on any given dataset. The problem with this approach is that, though these architectures perform really good on the standard datasets, they don’t perform as expected on the organisation specific datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VnJv5JSJQq-ixhbS" /><figcaption>Top Left: <a href="https://arxiv.org/abs/1505.04597">Unet-Architecture</a> | Top Right: Original Image published in [LeCun et al., 1998] | Bottom left: VGG16 Architecture | Bottom Right: ResNet architecture</figcaption></figure><p>This article is for those who are stepping into <strong>NAS</strong> research or reading this wonderful paper. I worked on this field as an internship project at the <strong>Indian Space Research Organisation (ISRO).</strong> In this blog, I will try to explain this paper in an intuitive manner as I experienced a lot of difficulties when I implemented it for semantic segmentation.</p><h3>Introduction to Neural Architecture Search (NAS)</h3><p>The problem of neural architecture search is posed as follows.</p><p><em>Given a set of search space operation O, we need to find the combination of these operations that maximizes or minimizes the objective function.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*oU5vLzPu-J_JzaQ_ZigARw.gif" /><figcaption>Dog Image cc-by: Von.grzanka | Image by Author | Animation showing how different operations affect output.</figcaption></figure><p>In simple words, we need to find the architecture of the model to minimize the loss.</p><h4>Naïve Solution</h4><p>A naive solution to NAS is trail and error. We will randomly select a subset of operation and evaluate its performance on a parameter like validation loss and select the model configuration with the best performance.</p><h4>Brief History of progress in NAS</h4><p>We will not get into depth, but here are some influential papers that paved the way for NAS research.</p><ul><li><a href="https://arxiv.org/abs/1611.01578">Neural Architecture Search with Reinforcement Learning</a></li><li><a href="https://arxiv.org/abs/1802.03268">Efficient Neural Architecture Search via Parameter Sharing</a></li><li><a href="https://arxiv.org/pdf/1712.00559">Progressive Neural Architecture Search</a></li><li><a href="https://arxiv.org/abs/1806.09055">DARTS: Differentiable Architecture Search</a></li></ul><p>And then recently there is <a href="https://arxiv.org/abs/2005.07564">HNAS: Hierarchical Neural Architecture Search on Mobile Devices</a>, which extended the idea for DARTS to next level.</p><p>The trend in the research has been to decrease the computation time from <strong>2000 GPU</strong> days of reinforcement learning or <strong>3150 GPU</strong> days of evolution to <strong>2–3 GPU</strong> days for DARTS.</p><h4>Approach for NAS</h4><p>The idea of searching for high performing model architecture is not trivial and involves two steps.</p><ol><li>Searching the cell architecture on a small dataset (e.g. CIFAR10 or CIFAR100)</li><li>Making model from searched cell architecture and training it on a big dataset (e.g. ImageNet)</li></ol><h4>Searching Cell Architectures</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyEkGkTgEKviV6sn3cdMlA.jpeg" /><figcaption>Image by Author | Structure of a Simple Cell and mixed operations. The cell above shown has 3 states in a stacked fashion.</figcaption></figure><p>What is a cell in a model anyways? Well, a cell can be considered a special block where layers are stacked just like any other model. These cells apply many convolution operations to get feature maps which can be passed over to other cells. A model is made by stacking these cells in a series to make a complete model. All these papers follow a pattern, where two types of cell structure are searched, namely <strong>Normal Cell </strong>and <strong>Reduction Cell</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*iv8BGoQda50OD5d9tPaB6Q.jpeg" /><figcaption>Image by Author | Normal Cell</figcaption></figure><p><strong>Normal Cell</strong>: Normal Cell can be thought of a normal block which computes the feature map of an image. Convolutions and poolings in this block have <em>a stride of 1</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*qDFmJyRh0l6GMQUoobAmYw.jpeg" /><figcaption>Image by Author | Reduction Cell</figcaption></figure><p><strong>Reduction Cell:</strong> Reduction Cell can be thought of normal block which <strong>reduced </strong>the feature map dimensions. Convolutions and poolings in this block have <em>a stride of 2</em>. The purpose of the reduction cell is to downsample the feature maps.</p><p>Since all these papers tackle the classification problem, a <strong>global average pooling layer</strong> is used at last along with optional fully connected layers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eD4rehxht-J2ubMVpYD0Fg.jpeg" /><figcaption>Image by Author | Normal and Reduction cells stacked to form the final model after the search phase.</figcaption></figure><h3><strong>Details about DARTS. How it is better?</strong></h3><p>Darts is a very influential paper in neural architecture search. Earlier methods used reinforcement learning and required a large number of computational resources. It took <strong>2000 GPU</strong> days of reinforcement learning or <strong>3150 GPU</strong> days of evolution. This computation time is not at all feasible by most of the organizations.</p><blockquote>“<em>In this work, we approach the problem from a different angle and propose a method for efficient architecture search called </em><strong><em>DARTS </em></strong><em>(Differentiable Architecture Search). Instead of searching over a discrete set of candidate architectures, we relax the search space to be continuous, so that the architecture can be optimized with respect to its validation set performance by gradient descent.</em></blockquote><blockquote><em>The data efficiency of gradient-based optimization, as opposed to inefficient black-box search, allows DARTS to achieve competitive performance with the state of the art using orders of magnitude fess computation resources.</em></blockquote><blockquote><em>We introduce a novel algorithm for differentiable network architecture search based on bilevel optimization, which is applicable to both convolutional and recurrent architectures.” — source: DARTS Paper</em></blockquote><p>DARTS reduced the search time to <strong>2–3 GPU days</strong> which is phenomenal.</p><h4>How does DARTS do this?</h4><ol><li><strong>Searching over a discrete set of candidate operations is computationally heavy.</strong></li></ol><p>The problem with searching over a discrete set of candidate operations is that model has to be trained on specific configuration before moving onto the next configuration. This obviously is time-consuming. Authors found a way of <strong>relaxing</strong> the discrete set of candidate operations.</p><blockquote>“To make the search space continuous, we relax the categorical choice of a particular operation to a softmax over all possible operations:” — DARTS paper</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/0*RDZV7HDpuuIebq7I" /><figcaption>Equation from DARTS paper</figcaption></figure><p>Well what this means is that assume we have few operations in our candidate operations namely</p><p><strong>O = {conv_3x3, max_pool_3x3, dilated_conv_5x5}.</strong></p><p>The output of the operation is called mixed operation and is defined by multiplying the output from these operations to their probabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*H79KCxw4G-D02qqy8vy3wQ.jpeg" /><figcaption>Image by Author | Image showing how Mixed Operation is computed.</figcaption></figure><blockquote><em>“Each intermediate node is computed based on all of its predecessors.” — DARTS paper</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/0*0ZXZ3uj1XMjtKQD3" /><figcaption>Equation from DARTS paper</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*zxY6YwFk_4Z_O4t_9kdElQ.jpeg" /><figcaption>Image by Author | Typical NAS Cell | Note how each node has output from all the previous nodes as its input.</figcaption></figure><p>This brings us to the structure of the cell of DARTS. This is the core structure of the model I want you to give a good focus here.</p><p>The cell contains one or more nodes. These nodes are also known as states.</p><p>nput to a cell is outputs of the last two-cell, just like ResNets. In this cell there are nodes. Let us assume we make a cell with 3 states/nodes. So the first node will have two inputs i.e outputs from the last two cells.</p><p>The second state will have inputs from <em>the first state</em>, and <em>outputs from the last two cells</em> so total <strong>3 inputs.</strong></p><p>The third state will have inputs from <em>the second state, the first state and outputs from the last two cells.</em></p><p>At the end of the search, a discrete architecture can be obtained by replacing each mixed operation o(i,j) with most likely operation i.e.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/0*IXJa8BqMBKvx0Zld" /><figcaption>Equation from DARTS paper.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/0*xa9KUjDGX1FUZ0w3" /><figcaption>Image from <a href="https://arxiv.org/abs/1806.09055">DARTS Paper</a></figcaption></figure><p>This sound complex, but let’s break it down. After searching phase is over, we can find the architecture of a cell by getting top k (generally k=2) connections from the cell. This way discrete search space is converted to continuous search space on which gradient descent algorithm will work fine.</p><p>2. <strong>Bilevel Optimization</strong></p><blockquote>“After relaxation, our goal is to jointly learn the architecture α and the weights w within all the mixed operations (e.g. weights of the convolution filters).” — DARTS Paper</blockquote><p>We have discussed how can we obtain the searched architecture. But how does this model search the optimal operation is still a question unanswered. The training part is still left.</p><p>The optimization problem can be posed as to <strong>finding alphas</strong> so that <strong>validation loss is minimized</strong> given that we have <strong>weights that are already optimized on the training set</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*_YmDa8Egc_QPJjDN" /><figcaption>Note how the optimization of alphas and layer weights are done on training and validation set. This is called <strong>bilevel optimization.</strong></figcaption></figure><h3>Approximate Architecture Gradient — The elephant in the room</h3><blockquote>“Evaluating the architecture gradient exactly can be prohibitive due to the expensive inner optimization. We, therefore, propose a simple approximation scheme as follows:” DARTS Paper</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/0*yNzAIGIxPTHYVo1h" /><figcaption>Image by Author | Equation showing gradients of alphas</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*z4ZVFno8qSw7r-P-bRzy7A.gif" /><figcaption>1st (Cat) Photo by <a href="https://unsplash.com/@l_oan?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Loan</a> on <a href="https://unsplash.com/s/photos/cat?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>, Second (Dog) Photo by <a href="https://unsplash.com/@qrupt?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Victor Grabarczyk</a> on <a href="https://unsplash.com/s/photos/dog?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>, Third (Dog) Photo by <a href="https://unsplash.com/@alvannee?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alvan Nee</a> on <a href="https://unsplash.com/s/photos/dog?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> | Image by Author | Notice how changing alphas (orange lines) change the training loss (top graph) and retraining till convergence has to be done on weight. <strong>Optimizing over alphas need optimized weights first.</strong></figcaption></figure><p>There is a computational problem in this equation. To get optimal convolution weights we need to train the network by minimizing training loss by updating convolution weights. This means every time <strong>alpha</strong> is updated minimization of training step is required. This will make network training infeasible.</p><blockquote>“The idea is to approximate w*(α) by adapting w using only a single training step, without solving the inner optimization completely by training until convergence.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/0*qY1FN6dMWN8UcXY6" /><figcaption>Equation from DARTS paper</figcaption></figure><p>In equation 5 getting optimal weight w* for each configuration of alpha leads to two loops of optimization, so authors suggested to approximate w* in such a way that there is no need to optimize w* till convergence. The idea is to use just one training step instead of whole inner optimization loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cx2M38bV_QDQt7ht" /><figcaption>Image from DARTS Paper</figcaption></figure><p><a href="https://mythrex.github.io/math_behind_darts/">Click here to understand the math behind these equations.</a></p><p>Looking at equation 7, we have a second-order partial derivative which is computationally expensive to compute. To solve this, the finite difference method is used.</p><p><em>Look, at equation 8 there is no second-order partial derivative!</em></p><p>For results, you can refer to <a href="https://arxiv.org/abs/1806.09055">paper here</a>.</p><h3>Alternative Optimization Strategies</h3><p>Authors also tried to optimize alphas and weights jointly on training+validation data, but results deteriorated. The authors explained that this could be due to overfitting of alphas on the data.</p><h3>Conclusion</h3><p>DARTS was a very influential paper that drastically reduced the time of searching a high performing architecture from thousands of GPU hours to just 2–3 GPU days and still achieving state-of-the-art results.</p><h3>Resources</h3><ul><li><a href="https://arxiv.org/abs/1505.04597">U-Net: Convolutional Networks for Biomedical Image Segmentation</a></li><li><a href="https://arxiv.org/abs/1806.09055">DARTS: Differentiable Architecture Search</a></li><li><a href="https://arxiv.org/abs/1611.01578">Neural Architecture Search with Reinforcement Learning</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=692bdadcc69c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/intuitive-explanation-of-differentiable-architecture-search-darts-692bdadcc69c">Intuitive Explanation of Differentiable Architecture Search (DARTS)</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dreaming over text!]]></title>
            <link>https://medium.com/data-science/dreaming-over-text-f6745c829cee?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6745c829cee</guid>
            <category><![CDATA[deepdream]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Fri, 21 Aug 2020 03:18:18 GMT</pubDate>
            <atom:updated>2020-08-30T17:48:06.871Z</atom:updated>
            <content:encoded><![CDATA[<h4>Extending the idea of Deep Dream to textual data!</h4><blockquote>“DeepDream is an experiment that visualizes the patterns learned by a neural network. Similar to when a child watches clouds and tries to interpret random shapes, DeepDream over-interprets and enhances the patterns it sees in an image.</blockquote><blockquote>It does so by forwarding an image through the network, then calculating the gradient of the image with respect to the activations of a particular layer. The image is then modified to increase these activations, enhancing the patterns seen by the network, and resulting in a dream-like image. This process was dubbed “Inceptionism” (a reference to <a href="https://arxiv.org/pdf/1409.4842.pdf">InceptionNet</a>, and the <a href="https://en.wikipedia.org/wiki/Inception">movie</a> Inception).”</blockquote><blockquote><a href="https://www.tensorflow.org/tutorials/generative/deepdream">https://www.tensorflow.org/tutorials/generative/dee</a>p dream</blockquote><p>Let me break it down for you. Consider a Convolutional Neural Network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1X8oCSkcGpBCxdkiQuvfEQ.png" /><figcaption><a href="http://vision.stanford.edu/cs598_spring07/papers/Lecun98.pdf">LeNet-5 Architecture</a></figcaption></figure><p>Let us assume we want to check what happens when we increase the highlighted neuron activation <em>h_{i,j}</em><strong>, </strong>and we want to reflect these changes onto input image when we increase these activations.</p><p>In other words, we are optimizing image so that neuron <em>h_{i,j</em>} fires more.</p><p>We can pose this optimization problem as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*HCqUb1AU6mI8gyGoVizv8g.png" /><figcaption>Image by Author</figcaption></figure><p>That is, we need to maximize the square norm (in simple words magnitude), of <em>h_{i,j}</em> by changing image.</p><p>Here is what happens when we do as said above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u-DGj2JQGchqpY6_psT-YQ.png" /><figcaption>(<strong>Left</strong>) Image by Von.grzanka | (<strong>Right</strong>) Image by <a href="https://www.tensorflow.org/tutorials/generative/deepdream">Tensorflow Tutorial</a></figcaption></figure><p>The reason here is that, when the CNN was trained, the neuron in intermediate layers learned to see some patterns(here dog faces). When we increased those activations, the input image started containing more and more dog faces, to maximize the activations.</p><h3>The intuition behind implementing deep dream over text.</h3><p>Like deep dream in the image, what if we take any hidden layer activation and try to increase its norm, what will happen to the text input?<br>To answer this, a text-classification model was taken and loss function was set-up to increase the magnitude of the hidden layer’s activation.<br>We would expect to see the patterns/representation learned by this hidden layer.</p><h4>Embeddings Layer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*XOiFFiafvMFijCYgucrbMw.gif" /><figcaption>Image by Author | Image showing method to calculate embedding of sentence.</figcaption></figure><p>The neural network model cannot understand words. To feed words as input, these words are converted to a n-dimensional array of numbers called <strong>embeddings. </strong>Each word is converted to specific n-dimensional array. To get embedding of sentence we simply take mean of sentences and then this array is fed as input to model. This method solves the issue of variable length of sentence and can work with vanilla <strong>Artificial</strong> <strong>Neural Network</strong>.</p><h4>Model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*U_4IERshvMyvis4ihsmv2g.png" /><figcaption>Image by Author</figcaption></figure><p>A model trained to classify <strong>IMDB reviews </strong>was used. The model achieved validation accuracy of <strong>80.10%</strong>.</p><p>The experiment was set up to capture the representation given by <strong>Fully Connected layer 2</strong> or <strong>FC2</strong> in short with <strong>512</strong> dimensions.</p><p>The cost function used was the norm of <strong>fc2 output</strong>.</p><p><strong>Note: </strong>Because “Sequence of Words” are <em>long tensors,</em> they cannot be optimized by back-propagation. Instead, embedding representation of sentence was optimized.</p><h4>Outline of Procedure</h4><p>Step 1: Convert sentence to tensors.</p><p>Step 2: Get the <strong>sentence embeddings</strong>.</p><p>Step 3: Pass through the <strong>fc2 layer</strong>, and get the <strong>fc2 output</strong>.</p><p>Step 4: Optimize the <strong>sentence embeddings</strong> to <strong>increase fc2 layer output</strong>.</p><p>Step 5: Repeat step 2 to step 4 with the current sentence embeddings for a given number of iteration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*_DBiH-C8Q9EH8dBanWSEIQ.png" /><figcaption>Image by Author</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/23885a17fd2628e5872bdbe0f25164d1/href">https://medium.com/media/23885a17fd2628e5872bdbe0f25164d1/href</a></iframe><h3>Results</h3><h4>Experiment 1</h4><p><strong>Simple sentences</strong> were used to get classification results and their corresponding sentence embedding we saved.</p><p><strong>For example:</strong> <em>“I hate this.” , “I love this show.”</em>, we used to classify. These sentences are very simple and convey a negative and positive emotion respectively.</p><p><strong>Dreaming or optimization</strong> over these embeddings was done and a graph of activation over iteration was recorded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*kmK-XTxqJKXwWfGM_rBtxQ.png" /><figcaption>Image by Author</figcaption></figure><p>There are a couple of things that can be observed here.</p><ol><li>Activation of the hidden layer’s representation increased almost linearly for both these sentences</li><li>Activations of these sentences are different, which means that model can easily differentiate between these two sentences.</li></ol><p><strong>For the sentence: <em>“I love this show.”.</em> </strong>The model correctly predicts this as <strong><em>positive</em></strong><em>.</em></p><h4>Similar words test</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o6qiscRrM2HkKWU9ie3Swg.png" /><figcaption>Image by Author | Word cloud based on similarity. Large font means more similar.</figcaption></figure><p>Initially sentence embedding as more similar to neutral words like “this, it, even same” but as we increased the magnitude of the fc2 activations, the sentence embedding became similar to positive words like “great, unique”, which makes sense, as the model predicted it a <strong>positive </strong>sentence. Visualizing embeddings over iterations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*OjYVQvHuEO8ZCgDW3YP75g.gif" /><figcaption>Image by Author | Animation showing how embedding moves away from negative words and move towards positive words.</figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F453069152%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F453069152&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F949110378_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5b5a9203c3051e64a06c8e7d5185cb1/href">https://medium.com/media/d5b5a9203c3051e64a06c8e7d5185cb1/href</a></iframe><p><a href="https://projector.tensorflow.org/?config=https://gist.githubusercontent.com/mythrex/02f9d3b8575910943b89d9964e7fde56/raw/85e1d59d26662d8166d1fd0edeb2fc7d409f674a/Deep%2520dream%2520text%2520embeddings"><strong><em>Try Embeddings here</em></strong></a><strong><em> on Tensorflow Projector</em></strong></p><p>Observe how sentence <strong>embedding starts</strong> from <strong>step_1</strong> and move to <strong>step_21.</strong> The sentence embedding started in between <strong>positive</strong> and <strong>negative words</strong> and as algorithm dreams, the embedding move towards positive words.</p><blockquote>Try these things.</blockquote><blockquote>Observe embeddings in 3d.</blockquote><blockquote>Find words similar to <strong>step_1</strong>.</blockquote><blockquote>Find words similar to <strong>step_21</strong>.</blockquote><p><strong>For the sentence: <em>“I hate this”</em></strong><em>.</em> The model correctly predicts this as <strong><em>negative</em></strong><em>.</em></p><h4>Similar words test</h4><p>First, we observe what are the words similar (cosine similarity) to the sentence embeddings before and after dreaming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*szNXti7UGpkddL-eDtasDQ.png" /><figcaption>Image by Author | Word cloud based on similarity. Large font means more similar.</figcaption></figure><p>Initially, sentence embedding as more similar to neutral words like “<em>this, it, even, same</em>” but as we increased the magnitude of the <strong>fc2 activations</strong>, the sentence embedding became similar to words like “<em>bad, nothing, worse</em>” which convey a <strong>negative </strong>meaning, which it makes sense, as the model predicted it a <strong>negative </strong>sentence.</p><h4>Visualizing embeddings over iterations.</h4><p>To visualize embeddings over iteration, <strong>TSNE</strong> algorithm was used to reduce the embedding dimension from <strong>100</strong> to <strong>2</strong>. These embeddings were plotted on a 2d map with <strong>red dots </strong>as <strong>negative </strong>words(like a bad, worse, mean, mistake) and <strong>green dots</strong> as positive words(like great, celebrated, wonderful).</p><p><strong>Grey dots</strong> are intermediate locations of sentence embedding and <strong>the black dot </strong>is the final location of sentence embedding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IxqB31P4HMsjC4hgSAlYbQ.png" /><figcaption>Image by Author | 100 dimensional embeddings on 2d space</figcaption></figure><blockquote><a href="https://projector.tensorflow.org/?config=https://gist.githubusercontent.com/mythrex/f91d5aafd9dd5147784704a8ff295655/raw/c8389eee91ae2e3a05ac113296b58ddb699b85a5/Deep%2520dream%2520text%2520embeddings%2520negative"><strong><em>Try Embeddings here</em></strong></a><strong><em> on Tensorflow Projector</em></strong></blockquote><p>The graph clearly shows that embeddings got away from positive words and got near negative words and this is in tune with the model prediction. Moreover, the final sentence embedding is now more similar to <strong>red dots(negative words) than green dots(positive words).</strong></p><p>The key observation here is that initially, the sentence embedding was in between positive and negative words, but as <strong>dreaming progresses</strong> the embeddings were pushed away from negative words.</p><h4>Conclusion</h4><p>The word embeddings after dreaming become similar to the words in `model prediction`, though if we look at similar words of initial embeddings, they were more or less same for the two sentences even when they were conveying very different meanings, final sentence embedding showed some interesting patterns.</p><p>E.g.</p><p>1. <strong>negative</strong> prediction was pushed near to words like<strong> <em>mistake, dirty, bad</em></strong></p><p>2. <strong>positive</strong> prediction was pushed near to words like <strong><em>unique, great, celebrated</em></strong></p><h4>Experiment 2</h4><p>We will use difficult sentences now. Sentences which convey one emotion in the first half but change the sentiment in the second half.</p><p>Sentences like</p><ul><li>The show was very long and boring but the direction was amazing.</li><li>I hated the show because of nudity but the acting was classy.</li></ul><p>These sentences are difficult for a human to judge what kind of emotion they convey.</p><p>Again we will optimize the sentence embeddings, to maximize activations in <strong><em>fc2 layer.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*QlYubRZQLH8G-ucA3rFVBg.png" /><figcaption>Image by Author | Norm of fc2 layer activations as a function of iterations</figcaption></figure><p>Unlike the first case. Activations of the two sentences don’t diverge much, i.e. activations for these sentence are more or less similar, this means there is no classifying power of the model for these sentences.<br>Let’s look at the nearby words of these sentences before and after dreaming.</p><p><strong>For sentence: </strong><em>“The show was very long and boring but the direction was really amazing.”, </em>the model predicted <strong>positive</strong></p><p><strong>Similar Word test</strong></p><p>We will find words similar to initial vs final sentence embedding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VpF1vXcKFlBAG4pTI7UrdQ.png" /><figcaption>Image by Author</figcaption></figure><p>Hmm, even though the sentence was classified as positive, the words similar to final sentence embedding don’t reflect any positive sentiment.</p><p><strong>For sentence: </strong><em>“I hated the show because of nudity but the acting was really classy.”, </em>the model predicted <strong>negative</strong></p><p><strong>Similar Word test</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ah91NAcjeEZDlAY74Ow-Kw.png" /><figcaption>Image by Author</figcaption></figure><p>The sentence was classified as <strong>negative, </strong>the embeddings after dreaming reflect negative sentiment.</p><h4>Conclusion</h4><p>Because the model had no clear understanding of these sentences, the sentence embedding of these two sentences after dreaming are almost similar<em>(look at similar words after dreaming). This is because model does not have a rich representation of these sentences in its hidden layers.</em></p><p>We started by looking at how deep dream on images work, then we proposed how we can implement deep dream over text. Finally, we have shown how to correctly interpret the results. This method can be used to understand what kind of hidden representation the language model has learnt.</p><p>Experiments like these help us understand these black boxes better.</p><p>You can try a <a href="https://colab.research.google.com/github/mythrex/deep_dream_textual_data/blob/master/demo.ipynb#scrollTo=DiFimXLc-FK_">demo in this notebook</a>.</p><p>All the related code is available at <a href="https://github.com/mythrex/deep_dream_textual_data">my Github Repo</a>.</p><h3>References</h3><ol><li><a href="http://vision.stanford.edu/cs598_spring07/papers/Lecun98.pdf">Gradient-Based Learning Applied to Document<br>Recognition</a></li><li><a href="https://ai.googleblog.com/2015/06/inceptionism-going-deeper-into-neural.html">https://ai.googleblog.com/2015/06/inceptionism-going-deeper-into-neural.html</a></li><li><a href="https://www.tensorflow.org/tutorials/generative/deepdream">https://www.tensorflow.org/tutorials/generative/deepdream</a></li><li><a href="https://youtu.be/YHAIrwRVvWg?list=PLyqSpQzTE6M9gCgajvQbc68Hk_JKGBAYT">https://youtu.be/YHAIrwRVvWg?list=PLyqSpQzTE6M9gCgajvQbc68Hk_JKGBAYT</a></li><li><a href="https://pytorch.org/tutorials/beginner/text_sentiment_ngrams_tutorial.html">https://pytorch.org/tutorials/beginner/text_sentiment_ngrams_tutorial.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6745c829cee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/dreaming-over-text-f6745c829cee">Dreaming over text!</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Internship experience at Space Application Center(SAC), ISRO]]></title>
            <link>https://medium.com/@shivam.kaushik73/internship-experience-at-space-application-center-sac-isro-86a5576fb62?source=rss-396d46fdd644------2</link>
            <guid isPermaLink="false">https://medium.com/p/86a5576fb62</guid>
            <dc:creator><![CDATA[Shivam Kaushik]]></dc:creator>
            <pubDate>Wed, 21 Aug 2019 05:26:01 GMT</pubDate>
            <atom:updated>2019-08-22T15:49:47.244Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*5Wth7Doe2NvhOIpxWoLfeA.png" /></figure><h3>What is SAC</h3><blockquote>Space Applications Centre (SAC) is one of the major centres of the Indian Space Research Organisation (ISRO). SAC focuses on the design of space-borne instruments for ISRO missions and development and operationalisation of applications of space technology for societal benefits.</blockquote><h4>TREES</h4><p>ISRO has a program named <strong>TREES</strong> (<strong>T</strong>raining and <strong>R</strong>esearch in <strong>E</strong>arth <strong>E</strong>co-<strong>S</strong>ystem) for graduates, postgraduates and research students. ISRO has launched a series of polar-orbiting Remote sensing satellites IRS, Resoursat, CARTOSAT and RISAT. The data from these satellites is archived under research programme under Visualization of Earth Data and Archival System VEDAS.</p><blockquote>The objective of the <strong>TREES</strong> program is to conduct research projects on data collected from these satellites. <strong>ISRO </strong>has developed a sophisticated facility of storing and retrieval of this data. Many types of research projects in the field of <strong><em>remote sensing, deep learning </em></strong><em>and </em><strong><em>data analysis</em></strong><em> </em>are carried out.</blockquote><h3>Resource availability at ISRO</h3><p>ISRO is investing heavily in the deep learning environment. The Bopal Campus at Ahmedabad, Gujarat is a brand new campus and will be a major deep learning centre in a few years.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o84sq21TxDH6PyYms%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o84sq21TxDH6PyYms%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3o84sq21TxDH6PyYms%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="188" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b6169c33f27a59024c739c6d3c81d6f/href">https://medium.com/media/3b6169c33f27a59024c739c6d3c81d6f/href</a></iframe><p><a href="https://media.giphy.com/media/3o84sq21TxDH6PyYms/giphy.gif">f</a>The hardware at the campus is state of art. Each computer is built with deep learning in mind. Each computer is provided with a dedicated GPU. Apart from this, servers with a rack of NVidia V100 GPUs are provided for heavy training. These machines are beast in itself with <strong>1TB</strong> of <strong>RAM</strong> and several <strong>TBs</strong> of <strong>SSD</strong> space.</p><blockquote>Working on these machines will give you a sense of what real power looks like.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fyjos61Qgsy17q%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fyjos61Qgsy17q%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fyjos61Qgsy17q%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="224" frameborder="0" scrolling="no"><a href="https://medium.com/media/8625a92741ab09a963bd74fb63a0c742/href">https://medium.com/media/8625a92741ab09a963bd74fb63a0c742/href</a></iframe><p>The downside there is the <strong>Internet</strong>. ISRO is very restricted to internet usage. No computer is provided with the internet. SAC has developed its intranet for sharing resources. To access any resource from the world wide web, some computers are provided. These computers provide a one-way route to transfer the file to your computer. SAC takes internet usage very seriously. Any miss use of the internet will probably get you into trouble.</p><p>One more thing, <strong>No mobile phones </strong>or any other electronic gadgets are allowed there. So no social media at work.</p><h3>Technology Used at ISRO</h3><p>Many projects that were being carried out in our tenure were related to segmentation and classification. These projects were implementing some of the latest papers from deep learning.</p><p>Research work was carried out on LSTM, UNets and Deeplab. We worked on <strong>Hyper</strong>parameter <strong>Opt</strong>imisation (<strong>HyperOpt</strong>) and <strong>N</strong>eural <strong>A</strong>rchitecture <strong>S</strong>earch (<strong>NAS</strong>).</p><p>For HyperOpt, we compared two algorithms, <strong>H</strong>yper<strong>B</strong>and(<strong>HB</strong>) and <strong>B</strong>ayesian <strong>O</strong>ptimisation of <strong>H</strong>yper<strong>B</strong>and(<strong>BOHB</strong>) to work with an LSTM network. Results were quite impressive. An optimised network that worked best with ISRO’s dataset was found and a comparison between <strong>HB</strong> and <strong>BOHB</strong> was presented.</p><p>We also worked in the field of Neural Architecture Search (<strong>NAS)</strong>. We tried out <strong>DARTS</strong> and combined it with <strong>UNet. </strong>This network finds a suitable cell structure network for the segmentation task. The cells were laid out to form a UNet structure.</p><p>Another research was carried out, MorphNet with UNet was used to shrink the network. This network was then fed into hyperOpt pipeline to further reduce the network.</p><h3>Work Culture</h3><p>The work culture at SAC is very serious. Unlike startups that have some cool, fun environment, ISRO on the other hand is an organisation that takes work seriously. One has to report by 9.30 AM sharp. But there are many perks too!</p><ul><li>Powerful and expensive resources for your research</li><li>Mentorship and connections from some of the India’s best scientists in their field.</li><li>Struggle stories from senior scientist</li><li>Presentation of your work to your colleagues and a panel of judges.</li><li>Occasional Parties</li><li>Social Media free work life.</li><li>Live videos from Chandrayaan’s launch.</li></ul><h3>How to apply?</h3><h4>Traditional Way</h4><p>Interested candidates have to fill an application form provided at <a href="https://vedas.sac.gov.in/vedas/downloads/Form-ERTD.pdf">SAC website for TREES program.</a> The application is needed to be forwarded to HEAD of ERTD/VRG/EPSA through candidate’s Head of the Department/ Institution. The official website for TREES is <a href="https://www.sac.gov.in/Vyom/TREESProgram.jsp">https://www.sac.gov.in/Vyom/TREESProgram.jsp</a></p><h4>Alternative Way</h4><p>ISRO/DoS has been participating in the <strong>S</strong>mart <strong>I</strong>ndia <strong>H</strong>ackathon (<strong>SIH</strong>), Software Edition, a 36 hour non-stop digital programming competition, being organised by MHRD since 2017. ISRO submits many problem statements. The problem statements that you should be focusing on should be related to deep learning. These are the problem statements we took. Teams with a feasible and robust solution are offered internship under <strong>TREES</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86a5576fb62" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>