<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rijal Ghodi</title>
    <description>The latest articles on DEV Community by Rijal Ghodi (@rijalghodi).</description>
    <link>https://dev.to/rijalghodi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F994383%2F6afceca2-4db5-4b08-bb81-884623921903.png</url>
      <title>DEV Community: Rijal Ghodi</title>
      <link>https://dev.to/rijalghodi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rijalghodi"/>
    <language>en</language>
    <item>
      <title>Epoch, Batch, and Iteration in Machine Learning</title>
      <dc:creator>Rijal Ghodi</dc:creator>
      <pubDate>Fri, 22 Nov 2024 10:26:44 +0000</pubDate>
      <link>https://dev.to/rijalghodi/epoch-batch-and-iteration-in-machine-learning-19g8</link>
      <guid>https://dev.to/rijalghodi/epoch-batch-and-iteration-in-machine-learning-19g8</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;In the journey of learning Artificial Neural Networks (ANNs), I often encounter confusion surrounding the terms: Epoch, Batch, and Iteration. Sometimes I mix them up when using them. Let’s tackle these concepts together!&lt;/p&gt;

&lt;h2&gt;
  
  
  Definition
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Epoch&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: An epoch refers to one complete pass of the model through all the available training data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: If you have a pack of 52 playing cards, an epoch is when you have completely learned all the cards.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: A batch is a subset of the training data used in one iteration of updating model parameters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Continuing with the playing card analogy, if you divide the cards into 4 stacks and learn the cards stack by stack, you will have 4 batches, each containing 13 cards.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Iteration&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: An iteration refers to one step of processing where the model processes one batch of data and update the model parameters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Continuing with the playing card analogy, you would need to complete 4 iterations to fully finish the epoch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Relationship
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In each epoch, you go through several batches, and in each batch, you perform multiple iterations.&lt;/li&gt;
&lt;li&gt;For example, if you have 100 examples and use a batch size of 20, you’d have 5 iterations per epoch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lets see the usage of these terms in typical ANN training:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let's say you have 1000 training data points representing house area versus price. You want to build an Artificial Neural Network (ANN) to predict price from a given unseen house area. To achieve this, you need to determine the parameters (typically weight and bias) that establish the relationship between house area and price.&lt;/li&gt;
&lt;li&gt;Because handling 1000 training data points at once is resource-intensive, you divide them into &lt;strong&gt;20 batches&lt;/strong&gt;. Each batch consists of 50 training data points (1000 / 20 = 50), so the batch size is 50.&lt;/li&gt;
&lt;li&gt;First, initialize the model with random parameters.&lt;/li&gt;
&lt;li&gt;Next, use the first batch to calculate the loss and update the model parameters accordingly.&lt;/li&gt;
&lt;li&gt;Then, with the updated parameters from the previous batch, proceed to calculate the loss and update the model parameters using the second batch.&lt;/li&gt;
&lt;li&gt;Continue this process iteratively until you process the final batch.&lt;/li&gt;
&lt;li&gt;Congratulations! After completing 20 iterations to finish one epoch, you obtain the optimized model parameters that effectively represent the relationship between house area and price.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;Having a clear understanding of these concepts will help you correctly use these terms in the context of training your Artificial Neural Network. Epochs, batches, and iterations work together to form an efficient and effective training process for your model. I hope this explanation helps clear up any confusion you had about these terms!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>First Principle of Machine Learning</title>
      <dc:creator>Rijal Ghodi</dc:creator>
      <pubDate>Fri, 22 Nov 2024 10:11:12 +0000</pubDate>
      <link>https://dev.to/rijalghodi/first-principle-of-machine-learning-42km</link>
      <guid>https://dev.to/rijalghodi/first-principle-of-machine-learning-42km</guid>
      <description>&lt;p&gt;Machine learning is very popular today. Despite the fancy terms and complex jargon often associated with it, machine learning is simply a tool — much like a sword and axe. It is a tool that help human to &lt;strong&gt;recognize patterns&lt;/strong&gt; in the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Goal of Machine Learning
&lt;/h2&gt;

&lt;p&gt;The goal of machine learning is &lt;strong&gt;to discover pattern in data.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specifically, the goal is to create a mathematical function (or pattern) that can accurately map one set of data to another.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example, imagine we have a list of house sizes and their corresponding prices. We have the data, but we don't know the exact function that links the size of a house to its price. This is where machine learning can help.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F644bc54f-b736-4fe6-a8c1-a13e508fcb0b_562x432.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F644bc54f-b736-4fe6-a8c1-a13e508fcb0b_562x432.webp" alt="Scatter plot of house size vs price. Our goal is to find a function that link both." width="562" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scatter plot of house size vs price. Our goal is to find a function that link both.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Model
&lt;/h2&gt;

&lt;p&gt;To begin, we need to create a “model.” A model is a mathematical function that we’ll adjust to fit our dataset as closely as possible. This model can be simple, like a straight line (linear function), or more complex, like a curve (quadratic function) or other structures.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Parameters
&lt;/h2&gt;

&lt;p&gt;No matter which model we pick, it will always have parameters. Parameters are numbers that determine how the function behaves and looks.&lt;/p&gt;

&lt;p&gt;For example, let’s look at a simple linear function: $y=wx+b$&lt;/p&gt;

&lt;p&gt;This function has two parameters: $w$ (the slope) and $b$ (the y-intercept). These two numbers control the shape and position of the line. Think of these parameters like tuning knobs on a radio, each one adjusting the radio behaviour.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Training
&lt;/h2&gt;

&lt;p&gt;Our goal in machine learning can be restated as: &lt;strong&gt;to find the best set of parameters that will make the model fit the dataset&lt;/strong&gt;. This process of searching the best parameters is called “training” the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loss Function
&lt;/h2&gt;

&lt;p&gt;Training starts with initialization. We assign random values to the parameters, which of course results in a “wrong” function. This means the function predict the wrong output for the given input. Don’t worry; we’ll use these mistake to gradually improve the model over time.&lt;/p&gt;

&lt;p&gt;To learn from a mistake, we need to measure the mistake! We need to figure out how far off the model’s predictions are from the actual output. In machine learning, this mistake is called “loss”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252Fb72676de-b6d9-4e39-a473-4386f16de5ae_576x432.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252Fb72676de-b6d9-4e39-a473-4386f16de5ae_576x432.webp" alt="First attempt of training. we initialize the parameters with random values, which results in a model that is initially wrong (as shown by the orange line). The model’s predictions differ from the actual values, known as the loss. Our goal is to minimize this loss." width="576" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First attempt of training. we initialize the parameters with random values, which results in a model that is initially wrong (as shown by the orange line). The model’s predictions differ from the actual values, known as the loss. Our goal is to minimize this loss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gradient Descent
&lt;/h2&gt;

&lt;p&gt;By nature, the lower a loss, the better a model. We need to make a model with lowest loss. So, our goal of machine learning can be restated as this: &lt;strong&gt;to find a model’s parameters that minimize the loss.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To minimize the loss, imagine you’re adjusting two knobs on a radio to find your favorite station. Initially, you might turn both knobs randomly. You notice that one knob is quicker at finding the station, while the other is slower. As you experiment, you start fine-tuning each dial based on how effective it is.&lt;/p&gt;

&lt;p&gt;Just like tuning a radio to find a favorite station, adjusting the model’s parameters involves checking how changes affect the loss. This adjustment process is guided by something called the gradient, which indicates how quickly the loss changes as we adjust the parameters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimizer
&lt;/h2&gt;

&lt;p&gt;Intuitively, if the gradient is higher, we need to make bigger adjustments to the parameters. If the gradient is lower, we should make smaller, more gradual changes. There are various optimizers to help with this tuning, but the basic idea remains the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repeat
&lt;/h2&gt;

&lt;p&gt;Repeat this process: define new parameters-&amp;gt; produce a wrong model -&amp;gt; calculate the loss -&amp;gt; determine the gradient -&amp;gt; adjust the parameters accordingly -&amp;gt; define new parameters-&amp;gt; … Keep repeating these steps until finding the optimal parameters that minimize the loss.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F076c4e54-c2f5-4d4b-84ee-372aa2e718c6_562x432.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F076c4e54-c2f5-4d4b-84ee-372aa2e718c6_562x432.webp" alt="After several times of adjusting the parameters, the model’s predictions finally align with the actual data (notice how the orange line fits the blue dots)." width="562" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After several times of adjusting the parameters, the model’s predictions finally align with the actual data (notice how the orange line fits the blue dots).&lt;/p&gt;

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

&lt;p&gt;Congratulations! You’ve grasped the concept of machine learning without needing to dive into math and code. In summary, machine learning aims to create the best function to map an input dataset to an output dataset. The process is straightforward: we start with a model that’s initially wrong, learn from its mistakes, and use that knowledge to improve the model over time. To me, this approach offers a valuable philosophical lesson about learning and growth.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>article</category>
      <category>ai</category>
    </item>
    <item>
      <title>Test</title>
      <dc:creator>Rijal Ghodi</dc:creator>
      <pubDate>Sun, 09 Jun 2024 05:43:31 +0000</pubDate>
      <link>https://dev.to/rijalghodi/test-5ggc</link>
      <guid>https://dev.to/rijalghodi/test-5ggc</guid>
      <description>&lt;p&gt;$x+y = 5$&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
\int_{a}^{b} f(x) \, dx&lt;br&gt;
$$&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Create Component Library Like Material UI or Mantine UI?</title>
      <dc:creator>Rijal Ghodi</dc:creator>
      <pubDate>Wed, 12 Jul 2023 02:08:40 +0000</pubDate>
      <link>https://dev.to/rijalghodi/how-to-create-component-library-like-material-ui-or-mantine-ui-3o6i</link>
      <guid>https://dev.to/rijalghodi/how-to-create-component-library-like-material-ui-or-mantine-ui-3o6i</guid>
      <description>&lt;p&gt;Creating a robust and reusable component library is a fundamental aspect of modern web development. If you've ever wondered how to develop component libraries like Material UI or Mantine UI from scratch, you're in the right place. In this article, we will delve into the essential steps for creating your own component library. So, let's embark on this journey!&lt;/p&gt;

&lt;p&gt;&lt;a id="1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  📜 Table of Content
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📜 Table of Content&lt;/li&gt;
&lt;li&gt;🛠️ Techs &amp;amp; Pre-Knowledge&lt;/li&gt;
&lt;li&gt;🔭 Project Description&lt;/li&gt;
&lt;li&gt;👟 Init NPM Project&lt;/li&gt;
&lt;li&gt;⚙️ Configure Typescript&lt;/li&gt;
&lt;li&gt;🧱 Create Components&lt;/li&gt;
&lt;li&gt;⛑️ Build&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;a id="2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Techs &amp;amp; Pre-Knowledge
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we will be utilizing the following technologies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React.js&lt;/li&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;NPM&lt;/li&gt;
&lt;li&gt;esbuild&lt;/li&gt;
&lt;li&gt;Storybook&lt;/li&gt;
&lt;li&gt;GitHub&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Throughout this tutorial, we assume that you already possess a basic understanding of the following concepts. If you are unfamiliar with any of them, please refer to articles covering the topics below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic React.js&lt;/li&gt;
&lt;li&gt;Basic TypeScript&lt;/li&gt;
&lt;li&gt;Basic GitHub&lt;/li&gt;
&lt;li&gt;Basic NPM&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;a id="3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔭 Project Description
&lt;/h2&gt;

&lt;p&gt;So, in this project, we will create a component library called &lt;code&gt;cool-components&lt;/code&gt; that includes customizable components. To keep things simple, we will focus on creating just one component: the Button! Users will be able to adjust the color, variant, and size of the Button. Curious about how? Let's dive in!&lt;/p&gt;

&lt;p&gt;Note: If you would like to see the final result of this project, please visit the following link.&lt;/p&gt;




&lt;p&gt;&lt;a id="4"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  👟 Init NPM Project
&lt;/h2&gt;

&lt;p&gt;&lt;a id="5"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚙️ Configure Typescript
&lt;/h2&gt;

&lt;p&gt;&lt;a id="6"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🧱 Create Components
&lt;/h2&gt;

&lt;p&gt;&lt;a id="7"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ⛑️ Build
&lt;/h2&gt;

&lt;p&gt;&lt;a id="8"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Publish into NPM
&lt;/h2&gt;

&lt;p&gt;&lt;a id="9"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🤖 (Optional) Automate Publish Using Github
&lt;/h2&gt;

&lt;p&gt;&lt;a id="10"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  📚 (Optional) Add StoryBook
&lt;/h2&gt;

</description>
      <category>library</category>
      <category>component</category>
      <category>mantine</category>
      <category>materialui</category>
    </item>
    <item>
      <title>My First Post</title>
      <dc:creator>Rijal Ghodi</dc:creator>
      <pubDate>Thu, 06 Jul 2023 10:32:37 +0000</pubDate>
      <link>https://dev.to/rijalghodi/my-first-post-d4m</link>
      <guid>https://dev.to/rijalghodi/my-first-post-d4m</guid>
      <description>&lt;p&gt;Hello! How are you today? I'm glad to hear that you're doing fine.&lt;/p&gt;

&lt;p&gt;Here, I aim to share my learning journey in Web Development, Mobile Development, Machine Learning, and other computer science-related topics. I also want to showcase code snippets within the text, like &lt;code&gt;this inline code&lt;/code&gt;, as well as code blocks like:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;It's truly amazing to be able to present code in such a visually appealing manner!&lt;/p&gt;

&lt;p&gt;In conclusion, I look forward to sharing my knowledge and experiences in various areas of computer science and providing engaging content for you to explore.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>coding</category>
    </item>
  </channel>
</rss>
