<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Ashvinee's Substack]]></title><description><![CDATA[My personal Substack]]></description><link>https://www.ashvinee.nyc</link><image><url>https://substackcdn.com/image/fetch/$s_!HxZC!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71a6e98b-5540-4d4b-ae51-1d2d2f3895ee_144x144.png</url><title>Ashvinee&apos;s Substack</title><link>https://www.ashvinee.nyc</link></image><generator>Substack</generator><lastBuildDate>Sat, 05 Dec 2026 05:04:14 GMT</lastBuildDate><atom:link href="https://www.ashvinee.nyc/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Ashvinee]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[ashvineeny@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[ashvineeny@substack.com]]></itunes:email><itunes:name><![CDATA[Ashvinee]]></itunes:name></itunes:owner><itunes:author><![CDATA[Ashvinee]]></itunes:author><googleplay:owner><![CDATA[ashvineeny@substack.com]]></googleplay:owner><googleplay:email><![CDATA[ashvineeny@substack.com]]></googleplay:email><googleplay:author><![CDATA[Ashvinee]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Docker & Kubernetes ]]></title><description><![CDATA[Machine Learning Operation]]></description><link>https://www.ashvinee.nyc/p/docker-and-kubernetes</link><guid isPermaLink="false">https://www.ashvinee.nyc/p/docker-and-kubernetes</guid><dc:creator><![CDATA[Ashvinee]]></dc:creator><pubDate>Thu, 19 Nov 2026 11:37:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!xXBL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xXBL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xXBL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png 424w, https://substackcdn.com/image/fetch/$s_!xXBL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png 848w, https://substackcdn.com/image/fetch/$s_!xXBL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png 1272w, https://substackcdn.com/image/fetch/$s_!xXBL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xXBL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png" width="1272" height="624" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:624,&quot;width&quot;:1272,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:570144,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://ashvineeny.substack.com/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xXBL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png 424w, https://substackcdn.com/image/fetch/$s_!xXBL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png 848w, https://substackcdn.com/image/fetch/$s_!xXBL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png 1272w, https://substackcdn.com/image/fetch/$s_!xXBL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2eea28-7bb8-41fa-841f-a1120ea3add6_1272x624.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You have been assigned some projects and you completed it on your system with good results. Now you deployed you application on the server or on different local system and you started <strong>facing environment issue</strong> related with package missing or different package versions or python is not compatible with your application. </p><p>Now resolving this type of issue is nightmare. It could take your days and night in resolving these issue. Like if you resolve one issue by changing the NumPy version for pandas installation there could be another library which might require another version of NumPy. </p><p>There is one solution for these is to use a virtual environment. With this we can create only for python environment. It doesn&#8217;t bundle OS libraries.</p><p>Another solution could be to use entirely different virtual machine. virtual machine is like a house. you can consider the application like a room in the house. It waste of resources unless you are going to create a very application.</p><p>Best solution could be to use container in your system. Its like isolated environment with host OS and its kernel. It will isolated processes, filesystem, network and this helps in starting this system within a sec instead of mins. This container can be shared.</p><h3>Architecture</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5mmk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5mmk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png 424w, https://substackcdn.com/image/fetch/$s_!5mmk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png 848w, https://substackcdn.com/image/fetch/$s_!5mmk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png 1272w, https://substackcdn.com/image/fetch/$s_!5mmk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5mmk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png" width="1664" height="907" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:907,&quot;width&quot;:1664,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:503280,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.ashvinee.nyc/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049be8f2-786a-4a4d-8db2-7afddbdde88f_1707x952.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5mmk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png 424w, https://substackcdn.com/image/fetch/$s_!5mmk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png 848w, https://substackcdn.com/image/fetch/$s_!5mmk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png 1272w, https://substackcdn.com/image/fetch/$s_!5mmk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62af8202-3995-472b-8d7b-eccdb27acf87_1664x907.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><ul><li><p>Docker daemon - dockerd - is the actual engine running in the background on the host OS. It helps in building , running, managing containers.</p></li><li><p>docker client - This will what running on top of daemon. It will do the communication with the daemon. so whenever you write any command it will pass to daemon for processing.</p></li><li><p>registry - This is place where all the prebuild images exits. Its private one.</p></li><li><p>docker hub - Here we use to register the image publicly.</p></li><li><p>docker swarn - docker own built in orchestration tool. it take several machine (nodes) and turn it into single virtual cluster.</p></li><li><p>images - its blueprint of the application with all the requirements</p></li><li><p>containers - its an instance of the image. one can initiate multiple container using the same image.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nVzh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nVzh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png 424w, https://substackcdn.com/image/fetch/$s_!nVzh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png 848w, https://substackcdn.com/image/fetch/$s_!nVzh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png 1272w, https://substackcdn.com/image/fetch/$s_!nVzh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!nVzh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png" width="1677" height="915" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:915,&quot;width&quot;:1677,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1520085,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.ashvinee.nyc/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa519c869-eb6f-47a3-8b76-044fccb70bec_1707x952.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nVzh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png 424w, https://substackcdn.com/image/fetch/$s_!nVzh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png 848w, https://substackcdn.com/image/fetch/$s_!nVzh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png 1272w, https://substackcdn.com/image/fetch/$s_!nVzh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c25b78c-18f0-48e3-92db-907bceebe8b3_1677x915.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h3>DockerFile</h3><p>It&#8217;s a step by step instructions for running your application.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;dockerfile&quot;,&quot;nodeId&quot;:&quot;bb952228-fa8f-43b4-a048-516aa323ceb1&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-dockerfile">FROM node:18
WORKDIR /app
COPY . .
RUN npm install
CMD [&#8221;npm&#8221;, &#8220;start&#8221;]</code></pre></div><p>Here CMD is default argument that we can override. It can be replaced with at docker run. ENTRYPOINT is fixed command and whatever passed with docker run its become arguments to it.</p><p>COPY and ADD both  copy files to container. ADD has some extra feature like it extract zip or tar file before copying to container. It is always safe to use COPY as ADD can be unstable.</p><p>All these line FROM, COPY, RUN, etc add layers in stack. All these layers are cached. we make any changes to one layer, it check if this layer is modified or not. If not it tries to use caches. Otherwise without cache, the <strong>building process will keep getting slow.</strong></p><p>.dockerignor are used to keep junks like log files out of COPY .. command.</p><h3>Docker compose</h3><p>Using docker compose we can initiate multiple container on the same host. To trigger it on different host we need to use docker swarn or Kubernetes.</p><p>Inside docker compose we can define docker volume for storage.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;yaml&quot;,&quot;nodeId&quot;:&quot;5e73a03e-bc21-471e-8e95-ded7f5357c85&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-yaml">services:
  db:
    image: mysql:8
    volumes:
      - db-data:/var/lib/mysql          # named volume
      # or, for a bind mount:
      # - ./local-db-folder:/var/lib/mysql
volumes:
  db-data:      # declared here so Compose manages it</code></pre></div><h3>How to reduce the docker image size?</h3><ol><li><p>use slim or alpine base image instead of full OS.</p></li><li><p>combines RUN into one.</p></li><li><p>Cleanup cache files using apt-get clean. </p></li><li><p>copy only final artifacts which are necessary after deployment.</p></li></ol><h3>Env variable</h3><p>All the configurations such as API key are not hardcoded. It is passed at the runtime like docker run -e dataset_url=postgres://&#8230;.</p><p>If the container stop, all the files generated inside this container are deleted. All these are temporary files. To store the files permanently, we need to assign volume to the container. use command </p><ul><li><p>docker volume create mydata</p></li><li><p>docker run -d &#8212;name mydb -v mydata:/var/</p></li></ul><h3>Commands</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XD6D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XD6D!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png 424w, https://substackcdn.com/image/fetch/$s_!XD6D!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png 848w, https://substackcdn.com/image/fetch/$s_!XD6D!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png 1272w, https://substackcdn.com/image/fetch/$s_!XD6D!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!XD6D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png" width="1683" height="913" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:913,&quot;width&quot;:1683,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1062154,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.ashvinee.nyc/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb7cda6-da5e-4ee1-8faa-1df76a4bc137_1707x952.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XD6D!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png 424w, https://substackcdn.com/image/fetch/$s_!XD6D!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png 848w, https://substackcdn.com/image/fetch/$s_!XD6D!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png 1272w, https://substackcdn.com/image/fetch/$s_!XD6D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7f1c858-eb12-4de7-a07a-8dcbc814c5b7_1683x913.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Now we can&#8217;t run container from same image on different machine. We can&#8217;t scale it. This is where Docker Swarn and Kubernetes comes in.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!O8LZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!O8LZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png 424w, https://substackcdn.com/image/fetch/$s_!O8LZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png 848w, https://substackcdn.com/image/fetch/$s_!O8LZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png 1272w, https://substackcdn.com/image/fetch/$s_!O8LZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!O8LZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png" width="1548" height="800" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:800,&quot;width&quot;:1548,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:793702,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.ashvinee.nyc/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b983e20-dcb4-4f85-af81-ba89e92d7c2e_1707x952.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!O8LZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png 424w, https://substackcdn.com/image/fetch/$s_!O8LZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png 848w, https://substackcdn.com/image/fetch/$s_!O8LZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png 1272w, https://substackcdn.com/image/fetch/$s_!O8LZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b702299-663c-4276-8fe5-25363a9b32c5_1548x800.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Kubernetes</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R6PM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R6PM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png 424w, https://substackcdn.com/image/fetch/$s_!R6PM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png 848w, https://substackcdn.com/image/fetch/$s_!R6PM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png 1272w, https://substackcdn.com/image/fetch/$s_!R6PM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!R6PM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png" width="941" height="736" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/192562d6-832c-46c6-89d2-43cf0962af75_941x736.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:736,&quot;width&quot;:941,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:329372,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.ashvinee.nyc/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb11ed11-207f-42bb-8420-978babe5abbd_1707x952.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!R6PM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png 424w, https://substackcdn.com/image/fetch/$s_!R6PM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png 848w, https://substackcdn.com/image/fetch/$s_!R6PM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png 1272w, https://substackcdn.com/image/fetch/$s_!R6PM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F192562d6-832c-46c6-89d2-43cf0962af75_941x736.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>It is open sourced system developed by Google. Its an orchestration tolls. It helps in managing containerized applications. It is a system for running and coordinating between containerized application across different cluster of machine. It manages the lifecycle of the containerized application.</p><p>It helps in </p><ul><li><p>load balancing - load across container</p></li><li><p>scaling, scale up and down base on demand</p></li><li><p>storage - keeps storage consistent with multiple instances of an application</p></li><li><p>self-healing - automatically restart container that fail and kill container</p></li></ul><h3>Installation</h3><p>We can install locally or from cloud. if we are choosing cloud, only we need to do configuration and rest of the things will be taken care by cloud. This is best ad easy way to start with Kubernetes. If we are moving aged with local setup. We can use Docker desktop for using Kubernetes. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tLT5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tLT5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png 424w, https://substackcdn.com/image/fetch/$s_!tLT5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png 848w, https://substackcdn.com/image/fetch/$s_!tLT5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png 1272w, https://substackcdn.com/image/fetch/$s_!tLT5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!tLT5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png" width="1456" height="660" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:660,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98068,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ashvineeny.substack.com/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tLT5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png 424w, https://substackcdn.com/image/fetch/$s_!tLT5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png 848w, https://substackcdn.com/image/fetch/$s_!tLT5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png 1272w, https://substackcdn.com/image/fetch/$s_!tLT5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bf1d343-4e20-4a85-a707-ff8b39124021_1571x712.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!g38_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g38_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png 424w, https://substackcdn.com/image/fetch/$s_!g38_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png 848w, https://substackcdn.com/image/fetch/$s_!g38_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png 1272w, https://substackcdn.com/image/fetch/$s_!g38_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!g38_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png" width="1456" height="653" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:653,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:118045,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ashvineeny.substack.com/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!g38_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png 424w, https://substackcdn.com/image/fetch/$s_!g38_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png 848w, https://substackcdn.com/image/fetch/$s_!g38_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png 1272w, https://substackcdn.com/image/fetch/$s_!g38_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc02d11-eb51-49ed-8ba5-914b603a5ea5_1574x706.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h3>Architecture</h3><p><strong>Node</strong> is virtual or physical machine. there is master and worker node. <strong>worker nodes</strong> is mostly referred as nodes. Each nodes will have <strong>kubelet</strong>. Its primary node agent. It help each node to communicate with other and execute task on those nodes. Each of these node can have container from different application. <strong>Master nodes</strong> run several Kubernetes process that are absolutely necessary to run and manage cluster properly. one of such process is <strong>API server</strong> which itself is a container. Its an entry point to the Kubernetes cluster. Kubernetes UI, CLI and API are processor to API server. There is another process running on master node is <strong>controller manager</strong>.  It keep track of what&#8217;s happing in the cluster like if container diet or need to be restarted. Another process running in master node is <strong>scheduler</strong> for scheduling containers on different nodes based on workload and available server resources. There is another process <strong>etcd </strong>key value storage which holds current state of the Kubernetes cluster at any time. There is a very important layer known as virtual network helping master node to communicate with the worker node. This virtual network helps to create one unified virtual machine. Worker nodes have higher workload. Can have multiple master nodes. </p><p></p><h3>Components</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4kor!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4kor!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png 424w, https://substackcdn.com/image/fetch/$s_!4kor!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png 848w, https://substackcdn.com/image/fetch/$s_!4kor!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png 1272w, https://substackcdn.com/image/fetch/$s_!4kor!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!4kor!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png" width="1674" height="904" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/af8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:904,&quot;width&quot;:1674,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:223323,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.ashvinee.nyc/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503738f2-d71e-4f47-931f-d43752dce5d1_1707x952.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4kor!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png 424w, https://substackcdn.com/image/fetch/$s_!4kor!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png 848w, https://substackcdn.com/image/fetch/$s_!4kor!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png 1272w, https://substackcdn.com/image/fetch/$s_!4kor!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf8a4578-a3c9-486f-8c96-3e160ab44072_1674x904.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Pod</strong> is a smallest unit in Kubernetes. It is an abstraction over container and it&#8217;s usually 1 application per pod. <strong>Service</strong> is permanent IP address. Each pod gets its own <strong>IP address</strong>.  Lifecycle of pod and service are not connected. If pod dies, its IP address stay. <strong>external service</strong> is when we needed to access the application from external source. we need to create <strong>internal service</strong> for data access. This is mostly done for testing purpose. The request from the external service goes to <strong>ingress</strong> first and then to the internal services. <strong>Config-map</strong> helps in  external configuration of the application. It contain URL of the database or something like helps in connecting with the pod. <strong>Secret</strong> is similar to config-map helping in storing configuration related with credentials in base64 encoded format.</p><p>Similar to docker, if the pod is restarted, the data generated during the execution are deleted. This is resolved using <strong>volume</strong> from the local storage and attaching it to the dataset pod. The volume could be also remote. Service is also a load-balancing. </p><p>Instead of relaying on a single node, we need to create replica of it with <strong>blueprint</strong>. This will help in distributed system. <strong>Deployment</strong> is a blueprint of application pod. We can create deployments and abstraction of pods. same service will be used for replica pod. The database pod can not be replicated because it has state. It is done in <strong>statefulset. </strong>We use deployment for stateless app and statefulset for stateful app or dataset.</p><p>The Kubernetes configuration are declared in the yaml file. Each file have 3 parts: metadata, specification and status. The status will automatically generated by Kubernetes. </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;yaml&quot;,&quot;nodeId&quot;:&quot;df82962a-40ca-48d5-ab99-7e5d495fd2f5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-yaml">apiVersion: v1
kind: Pod
metadata:
  name: my-app
spec:
  containers:
    - name: app
      image: myapp:1.0
      ports:
        - containerPort: 3000</code></pre></div><h3>Commands</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ir_v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ir_v!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png 424w, https://substackcdn.com/image/fetch/$s_!Ir_v!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png 848w, https://substackcdn.com/image/fetch/$s_!Ir_v!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png 1272w, https://substackcdn.com/image/fetch/$s_!Ir_v!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ir_v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png" width="1695" height="906" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:906,&quot;width&quot;:1695,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:162024,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.ashvinee.nyc/i/217366688?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72a1b62e-c90f-4995-a166-ecc254efb004_1707x952.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ir_v!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png 424w, https://substackcdn.com/image/fetch/$s_!Ir_v!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png 848w, https://substackcdn.com/image/fetch/$s_!Ir_v!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png 1272w, https://substackcdn.com/image/fetch/$s_!Ir_v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ae19cc-6aa8-4638-b865-5e02e0560795_1695x906.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.ashvinee.nyc/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Ashvinee's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Python]]></title><description><![CDATA[Object-oriented programing language]]></description><link>https://www.ashvinee.nyc/p/python</link><guid isPermaLink="false">https://www.ashvinee.nyc/p/python</guid><dc:creator><![CDATA[Ashvinee]]></dc:creator><pubDate>Thu, 19 Nov 2026 10:40:09 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_jyu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built-in data structures,  combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development.</p><p style="text-align: right;">-from python.org</p><p style="text-align: justify;">Guido Van Rossum developed the python programming language as a successor of the ABC  programming language in 1991. It is named after the &#8220;Monty python&#8217;s Flying Circus&#8221; comedy series. It is widely used in reputed companies like Google, Dropbox, Netflix, NASA, NSA, Bit torrent, and all over the world. It&#8217;s used in software development and data science.  It&#8217;s good for starting compared to other programming languages because of its simplicity. PyCharm is an open-source IDE for python development.</p><p style="text-align: justify;"><strong>Oops Concepts</strong></p><p style="text-align: justify;">Oops, stands for Object-Oriented Programming.</p><ol><li><p style="text-align: justify;"><strong>Class</strong></p></li></ol><p>A class in python is a &#8220;blueprint&#8221; for creating an object. It helps in building data and functions together to create a new instance.</p><p><strong>Syntax:</strong></p><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Define">#Define</a> class 
Class class_name: 
    Var1 = data1 
    Var2 = data2 
    Def fun1(self): 
        return(&#8220;Welcome to python&#8221;)   </code></pre><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Call">#Call</a> class 
C = class_name()     
c.fun1() </code></pre><p>[Output]</p><pre><code><strong>&#8220;Welcome to python&#8221;</strong> </code></pre><p><strong>Class example (Delivery system):</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_jyu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_jyu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_jyu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_jyu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_jyu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!_jyu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg" width="740" height="429" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:429,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!_jyu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_jyu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_jyu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_jyu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf05ccd8-e9cf-4393-aba9-ab7c20209a36_740x429.jpeg 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">python class</figcaption></figure></div><p>2. <strong>Object</strong></p><p>An object is an instance of a class. It contains all the properties of the class. One class can have more than one object.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qFeh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qFeh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qFeh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qFeh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!qFeh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg" width="740" height="196" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:196,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Python object&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Python object" title="Python object" srcset="https://substackcdn.com/image/fetch/$s_!qFeh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qFeh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qFeh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qFeh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04b91c50-24b0-4958-83a7-ace70243666e_740x196.jpeg 1456w" sizes="auto, 100vw" loading="lazy"></picture><div></div></div></div><figcaption class="image-caption">Python object</figcaption></figure></div><p>3. <strong>Method</strong></p><p>A method is a function of an object. Method access data within and may also alter an object state.</p><p><strong>Example:</strong></p><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Class">#Class</a> Method 
Class delivery: 
    Def cal_price(items): 
        return(price_data(items)) </code></pre><p style="text-align: justify;">&#9;4.<strong> Inheritance</strong></p><p style="text-align: justify;">&#9;Inheritance is the fundamental property in python. It helps to inherit the features of one class into another class. The properties inherited from the class are called a parent or superclass. The properties inherited from the class are called child or sub-class.</p><p><strong>Example:</strong></p><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Parent">#Parent</a> Class 
Class parent_class: 
    <a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/method_1">#method_1</a></code></pre><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Child">#Child</a> Class 
Class child_class(parent_class): 
    <a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/method_2">#method_2</a> </code></pre><p><strong>For example:</strong></p><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Parent">#Parent</a> Class 
Class shape: 
    Def set_color(self): 
        return(&#8220;Red&#8221;) 
        
<a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Child">#Child</a> Class 
Class circle(shape): 
    Def set_name(self): 
        return(&#8220;Circle one&#8221;) 
        
C = circle() 
c.set_color()</code></pre><p><strong>[Output]</strong></p><pre><code>&#8220;Red&#8221;  </code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Jexy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Jexy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Jexy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Jexy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Jexy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!Jexy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg" width="738" height="499" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:499,&quot;width&quot;:738,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Inheritance in python&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Inheritance in python" title="Inheritance in python" srcset="https://substackcdn.com/image/fetch/$s_!Jexy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Jexy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Jexy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Jexy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F254e01b6-84cc-41d5-b207-573d5c395a72_738x499.jpeg 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Inheritance in python</figcaption></figure></div><p style="text-align: justify;">&#9;5. <strong>Encapsulation</strong></p><p style="text-align: justify;">&#9;Encapsulation helps in protecting the data in or outside of the class. It is done by using public and private data types. It helps to prevent the use and modification of some data or method in or outside of the class. Public data or methods allow access or modify it from anywhere in or outside of the class. The private data or methods can only be accessed inside the class. The private methods are represented by starting with two underscores followed by the name. Setter and getter function is used for data encapsulation in python.</p><p style="text-align: justify;"><strong>Setter function:</strong></p><p style="text-align: justify;">The setter function is used to set values inside the class without directly accessing the private variable. In the example below, &#8220;setPrice&#8221; is used as a setter function to set the new price value for the computer.</p><p style="text-align: justify;"><strong>Getter function:</strong></p><p>It is the same as the setter function. The getter function is used to get the value of desired variables inside the class without directly accessing the private variable. In the example below, getPrice is used as a getter function to get the new price value for the computer.</p><p style="text-align: justify;"><strong>For example:</strong></p><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Encapsulation">#Encapsulation</a> 
class Computer: 
    def __init__(self): 
        self.__price = 150000 
    def show_price(self): 
        print(self.__price)) 
    def getPrice(self): 
        print(self.__price)) 
    def setPrice(self, new_price): 
        self.__price = new_price</code></pre><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Creating">#Creating</a> object 
c = Computer() 
c.show_price() </code></pre><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Setter">#Setter</a> function 
c.setPrice(120000) 
c.show_price()</code></pre><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Getter">#Getter</a> function
c.getPrice(120000) 
c.show_price()</code></pre><p><strong>[Output]</strong></p><pre><code>150000 
120000 
120000 </code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!q-BM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!q-BM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg 424w, https://substackcdn.com/image/fetch/$s_!q-BM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg 848w, https://substackcdn.com/image/fetch/$s_!q-BM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!q-BM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!q-BM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg" width="740" height="437" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:437,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Encapsulation&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Encapsulation" title="Encapsulation" srcset="https://substackcdn.com/image/fetch/$s_!q-BM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg 424w, https://substackcdn.com/image/fetch/$s_!q-BM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg 848w, https://substackcdn.com/image/fetch/$s_!q-BM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!q-BM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff963cc35-1a98-4e5c-ac86-ef6cf7ba34cf_740x437.jpeg 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Encapsulation</figcaption></figure></div><p style="text-align: justify;">&#9;6. <strong>Polymorphism</strong></p><p style="text-align: justify;">&#9;Polymorphism is used to redefine the method with the same name from the base class. This can be performed using method overloading and method overriding.</p><p style="text-align: justify;"><strong>Method overloading:</strong></p><p style="text-align: justify;">A method with the same name as the base class with a different number of arguments or data types is called method overloading.</p><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Parent">#Parent</a> Class 
Class shape: 
    Def set_color(self): 
        return(&#8220;Red&#8221;) 
<a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Child">#Child</a> Class 
Class circle(shape): 
    Def set_color(self, color=&#8217;Yellow&#8217;): 
        return(color) </code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XL3j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XL3j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 424w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 848w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!XL3j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg" width="740" height="430" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:430,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Method overloading in python&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Method overloading in python" title="Method overloading in python" srcset="https://substackcdn.com/image/fetch/$s_!XL3j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 424w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 848w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Method overloading in python</figcaption></figure></div><p><strong>Method overriding:</strong></p><p style="text-align: justify;">A method with the same name as the base class with added extra behaviors is called method overloading.</p><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Parent">#Parent</a> Class 
Class shape: 
    Def set_color(self): 
        return(&#8220;Red&#8221;)</code></pre><pre><code><a href="https://ashvineek9-website.editor.wix.com/html/editor/web/renderer/render/document/ba0f718a-1efa-4c63-818a-2e0671379ac7/blog/hashtags/Child">#Child</a> Class 
Class circle(shape): 
    Def set_color(self): 
        return(color) </code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XL3j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XL3j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 424w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 848w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!XL3j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg" width="740" height="430" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:430,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Method overriding in python&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Method overriding in python" title="Method overriding in python" srcset="https://substackcdn.com/image/fetch/$s_!XL3j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 424w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 848w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!XL3j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd23725fb-d1f3-4f2b-93e1-d89de76a4e54_740x430.jpeg 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Method overriding in python</figcaption></figure></div><p style="text-align: justify;">&#9;7. <strong>Data Abstraction</strong></p><p style="text-align: justify;">&#9;Data abstraction is a way to hide the sensitive or complex part of the code from the real world. It helps to protect unnecessary details of the implementation from the users. This example, shows the image_preprocessing steps are hidden from the external users. Users just need to pass the vehicle or person images to the Image_preprocessing class and output will be generated.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eKZO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eKZO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg 424w, https://substackcdn.com/image/fetch/$s_!eKZO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg 848w, https://substackcdn.com/image/fetch/$s_!eKZO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!eKZO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!eKZO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg" width="740" height="399" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:399,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Data abstraction in python&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Data abstraction in python" title="Data abstraction in python" srcset="https://substackcdn.com/image/fetch/$s_!eKZO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg 424w, https://substackcdn.com/image/fetch/$s_!eKZO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg 848w, https://substackcdn.com/image/fetch/$s_!eKZO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!eKZO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a458f33-afda-45e2-95ea-98c2b963b5a0_740x399.jpeg 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Data abstraction in python</figcaption></figure></div><p>This is all about python as an object-oriented programing language. In the next blog, I will cover more on comments, docstring, modules in python.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.ashvinee.nyc/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Ashvinee's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Activation function]]></title><description><![CDATA[The engine of neural network]]></description><link>https://www.ashvinee.nyc/p/activation-function</link><guid isPermaLink="false">https://www.ashvinee.nyc/p/activation-function</guid><dc:creator><![CDATA[Ashvinee]]></dc:creator><pubDate>Thu, 19 Nov 2026 10:37:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!HxZC!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71a6e98b-5540-4d4b-ae51-1d2d2f3895ee_144x144.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p style="text-align: justify;">Different activation functions are used in the Neural Network (NN) architecture. The work of these activation functions is to activate only the specific neurons responsible for the final prediction. The use of the activation function is to add non-linearity to the NN. The activation can be used in the intermediate layers or at the end of the NN for prediction. The non-linear activation function helps to learn more complex features from the input. The linear activation function cannot be used in the intermediate layers of NN as it cannot be differentiated. The most commonly used activation functions in the hidden layers are Rectified Linear Activation (ReLU), Logistic (Sigmoid), and Hyperbolic Tangent (Tanh).</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!54FC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab75e87d-5a84-4496-9875-737ec0958625_350x235.png 424w, https://substackcdn.com/image/fetch/$s_!54FC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab75e87d-5a84-4496-9875-737ec0958625_350x235.png 848w, https://substackcdn.com/image/fetch/$s_!54FC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab75e87d-5a84-4496-9875-737ec0958625_350x235.png 1272w, https://substackcdn.com/image/fetch/$s_!54FC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab75e87d-5a84-4496-9875-737ec0958625_350x235.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!54FC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab75e87d-5a84-4496-9875-737ec0958625_350x235.png" width="350" height="235" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab75e87d-5a84-4496-9875-737ec0958625_350x235.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:235,&quot;width&quot;:350,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Activation Function&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Activation Function" title="Activation Function" srcset="https://substackcdn.com/image/fetch/$s_!54FC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab75e87d-5a84-4496-9875-737ec0958625_350x235.png 424w, https://substackcdn.com/image/fetch/$s_!54FC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab75e87d-5a84-4496-9875-737ec0958625_350x235.png 848w, https://substackcdn.com/image/fetch/$s_!54FC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab75e87d-5a84-4496-9875-737ec0958625_350x235.png 1272w, https://substackcdn.com/image/fetch/$s_!54FC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab75e87d-5a84-4496-9875-737ec0958625_350x235.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div><figcaption class="image-caption">Activation Function</figcaption></figure></div><h3 style="text-align: justify;">ReLU</h3><p style="text-align: justify;">ReLU stands for rectified linear activation function. ReLU is better than Sigmoid and Tanh activation function. ReLU helps to overcome the gradient vanishing problem. The range of ReLU function is in max(0.0, x). Only certain neurons are activated at a time. ReLU is very computationally efficient for backpropagation. It suffers from dying ReLU as all the negative outputs are made zero. It accelerates the convergence of the gradients toward global minima due to its linear and non-saturating properties. There are different versions of the ReLU activation function. The leaky ReLU tried to solve the dying ReLU problem by making a small positive slope on the negative left side of the graph. The parametric ReLU function also tried to solve the dying ReLU problem by adding an argument &#8216;a&#8217; to the negative left side of the graph. The Exponential linear unit (ELU) activation function also tried to improve the dying ReLU problem by using a log curve on the negative left side of the graph.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zlyj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png 424w, https://substackcdn.com/image/fetch/$s_!Zlyj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png 848w, https://substackcdn.com/image/fetch/$s_!Zlyj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png 1272w, https://substackcdn.com/image/fetch/$s_!Zlyj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zlyj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png" width="350" height="234" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:234,&quot;width&quot;:350,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Zlyj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png 424w, https://substackcdn.com/image/fetch/$s_!Zlyj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png 848w, https://substackcdn.com/image/fetch/$s_!Zlyj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png 1272w, https://substackcdn.com/image/fetch/$s_!Zlyj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37b330c8-af22-4784-88c8-6e0d1c1b61b1_350x234.png 1456w" sizes="100vw"></picture><div></div></div></div></figure></div><p style="text-align: justify;">He Normal and He Uniform:</p><p>Xavier Normal and Xavier Uniform (Glorot initialization)</p><h3 style="text-align: justify;">Sigmoid</h3><p style="text-align: justify;">Sigmoid activation is the same as logistic regression function. Its range is in between 0 and 1 using the formula 1.0 / (1.0 + e^-x). The output is not symmetric around zero and all of the output will be of the same sign. This can lead to a vanishing gradient problem. The training of the neural network using Sigmoid is difficult and unstable.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OpQS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png 424w, https://substackcdn.com/image/fetch/$s_!OpQS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png 848w, https://substackcdn.com/image/fetch/$s_!OpQS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png 1272w, https://substackcdn.com/image/fetch/$s_!OpQS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!OpQS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png" width="350" height="234" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:234,&quot;width&quot;:350,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!OpQS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png 424w, https://substackcdn.com/image/fetch/$s_!OpQS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png 848w, https://substackcdn.com/image/fetch/$s_!OpQS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png 1272w, https://substackcdn.com/image/fetch/$s_!OpQS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f4e179d-32b6-4550-9e45-422ea0a18257_350x234.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div></div></div></div></figure></div><h3>TanH</h3><p style="text-align: justify;">It is a hyperbolic tangent activation function. Its range is in between -1 and 1 using the formula f(x) = (e^x &#8211; e^-x) / (e^x + e^-x).  The tanh function generates very small gradients. It sufferers from vanishing gradient problems as the generated gradient approaches near zero. It helps in centering the data for learning on the next layer. It is preferred to Sigmoid non-linear activation function.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Epm-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89397355-ee20-4e57-b439-136fb0e726fa_350x224.png 424w, https://substackcdn.com/image/fetch/$s_!Epm-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89397355-ee20-4e57-b439-136fb0e726fa_350x224.png 848w, https://substackcdn.com/image/fetch/$s_!Epm-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89397355-ee20-4e57-b439-136fb0e726fa_350x224.png 1272w, https://substackcdn.com/image/fetch/$s_!Epm-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89397355-ee20-4e57-b439-136fb0e726fa_350x224.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!Epm-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89397355-ee20-4e57-b439-136fb0e726fa_350x224.png" width="350" height="224" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89397355-ee20-4e57-b439-136fb0e726fa_350x224.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:224,&quot;width&quot;:350,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Epm-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89397355-ee20-4e57-b439-136fb0e726fa_350x224.png 424w, https://substackcdn.com/image/fetch/$s_!Epm-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89397355-ee20-4e57-b439-136fb0e726fa_350x224.png 848w, https://substackcdn.com/image/fetch/$s_!Epm-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89397355-ee20-4e57-b439-136fb0e726fa_350x224.png 1272w, https://substackcdn.com/image/fetch/$s_!Epm-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89397355-ee20-4e57-b439-136fb0e726fa_350x224.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div></div></div></div></figure></div><p style="text-align: justify;">ReLU is the most commonly used activation function for multi-perceptron and CNN. Sigmoid and TanH are the most commonly used activation function for Recurrent Neural networks. LSTM uses both Sigmoid and TanH activation functions. A few of the commonly used activation functions used in the output layers are Liner, Sigmoid, and  Softmax activation functions.</p><h3>Linear</h3><p style="text-align: justify;">A linear activation function is also known as an Identity function. It returns the output value the same as the input values using the formula f(x) = x. It does not modify the weighted sum of the input. Normalization and standardization transform is used to scale the target values before passing them to the model.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bRDw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png 424w, https://substackcdn.com/image/fetch/$s_!bRDw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png 848w, https://substackcdn.com/image/fetch/$s_!bRDw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png 1272w, https://substackcdn.com/image/fetch/$s_!bRDw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!bRDw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png" width="350" height="235" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:235,&quot;width&quot;:350,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!bRDw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png 424w, https://substackcdn.com/image/fetch/$s_!bRDw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png 848w, https://substackcdn.com/image/fetch/$s_!bRDw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png 1272w, https://substackcdn.com/image/fetch/$s_!bRDw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F046cd83a-ac91-4da3-bda1-a804e788946e_350x235.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div></div></div></div></figure></div><h3>Softmax</h3><p style="text-align: justify;">A softmax activation function is probabilistic values output in the range between 0 and 1 using the formula e^x / sum(e^x). It is a softer version of argmax. For example, the softmax value for a correct predicted class will be near 1 and for the rest of the class will be near 0. The target class will be represented as 0 and 1.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kv3S!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png 424w, https://substackcdn.com/image/fetch/$s_!Kv3S!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png 848w, https://substackcdn.com/image/fetch/$s_!Kv3S!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png 1272w, https://substackcdn.com/image/fetch/$s_!Kv3S!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kv3S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png" width="350" height="234" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:234,&quot;width&quot;:350,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Kv3S!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png 424w, https://substackcdn.com/image/fetch/$s_!Kv3S!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png 848w, https://substackcdn.com/image/fetch/$s_!Kv3S!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png 1272w, https://substackcdn.com/image/fetch/$s_!Kv3S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6509757-761a-436f-ac90-3cbb6b800ae0_350x234.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div></div></div></div></figure></div><p style="text-align: justify;">The activation function used for the regression is the linear activation function. For the binary classification problem, the Sigmoid activation function is used with one node. For the multi-class classification, the Softmax classification is used with a number of nodes equal to the number of classes. For multi-label classification, the Sigmoid activation function is used with a number of nodes equal to the number of classes.</p><p style="text-align: justify;">Creating the NN architecture without using the activation function will create a simple linear regression model. The model will not able to generalize complexity well on the input. It helps to add non-linearly to the model.</p>]]></content:encoded></item><item><title><![CDATA[Starting with basic convolutional neural networks:]]></title><description><![CDATA[Convolution from scratch]]></description><link>https://www.ashvinee.nyc/p/starting-with-basic-convolutional</link><guid isPermaLink="false">https://www.ashvinee.nyc/p/starting-with-basic-convolutional</guid><dc:creator><![CDATA[Ashvinee]]></dc:creator><pubDate>Thu, 19 Nov 2026 10:34:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!XkyC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d717ae5-5ecd-4f26-a840-eb02209e08aa_300x300.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The eye is one of the sensors present in humans similar to our ears, nose, Tong, and skin for vision. Most of the inputs to these sensors in the real world are images, text, and audio. One eye illusion the image as color but in actuality, it&#8217;s black and white.</p><h3><strong>Channels/ Kernel:</strong></h3><div class="image-gallery-embed" data-attrs="{&quot;gallery&quot;:{&quot;images&quot;:[{&quot;type&quot;:&quot;image/webp&quot;,&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d717ae5-5ecd-4f26-a840-eb02209e08aa_300x300.webp&quot;},{&quot;type&quot;:&quot;image/webp&quot;,&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b009fe7a-0008-4638-83da-547c550c2989_300x300.webp&quot;},{&quot;type&quot;:&quot;image/webp&quot;,&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0ba85611-2445-4d94-8ad9-2db9d87946b1_300x300.webp&quot;},{&quot;type&quot;:&quot;image/webp&quot;,&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bc1d9738-bb92-4adf-a7e3-79c941516558_300x300.webp&quot;}],&quot;caption&quot;:&quot;Channels/ Kernel&quot;,&quot;alt&quot;:&quot;Channels/ Kernel&quot;,&quot;staticGalleryImage&quot;:{&quot;type&quot;:&quot;image/png&quot;,&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cbb895ce-23ec-4edc-9454-594b9c9c18e6_1456x1456.png&quot;}},&quot;isEditorNode&quot;:true}"></div><p style="text-align: justify;"><br>Digital photographs or images are in 3 channels (RGB). The same image in the newspaper is in 4 colours (C, M, Y, K). The same image in the magazine is in 7 channels. A  portrait can create images using millions of distinct colours. DNN works on 3 channels (RGB/ LAB (lab color channels)). DNN does not depend on channels (color).  Training results on B&amp;W images will be the same compared to the training results on color images. It is always recommended to divide an image into as many channels as possible. This must be the first step in DNN. Convert a single object into multiple channels. More channel means more features. Why 3 x 3 kernel only? 3 x 3  is a heavily accelerated kernel brought by researchers and NVIDIA in the world.  Increasing the kernel puts a lot of pressure on the hardware. The Channels/ Kernel/ features extractors are the same term.</p><p style="text-align: justify;"></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rgxd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rgxd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Rgxd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Rgxd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Rgxd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rgxd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg" width="740" height="555" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:555,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Rgxd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Rgxd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Rgxd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Rgxd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f955cc-7a09-4d89-8bcf-4178e70599be_740x555.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p style="text-align: justify;">      </p><p style="text-align: justify;"> For example, the text feature extractor is in 26 channels. Each alphabet present in it will be a channel. These alphabets will be considered as features. For extracting each feature such as alphabets &#8216;e&#8217; needs filters which will only allow alphabets &#8216;e&#8217;  and mute other features. Another example is music orchestras have channels equal to the number of musical instruments used. The sound of each instrument is connected to different channels.</p><p style="text-align: justify;"></p><div class="image-gallery-embed" data-attrs="{&quot;gallery&quot;:{&quot;images&quot;:[{&quot;type&quot;:&quot;image/webp&quot;,&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de449f78-2392-402b-97eb-0a9ce1492777_1456x1092.webp&quot;},{&quot;type&quot;:&quot;image/webp&quot;,&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e9c1d8ee-5cc2-459c-bcf2-3be7716cf3dc_1456x971.webp&quot;}],&quot;caption&quot;:&quot;&quot;,&quot;alt&quot;:&quot;&quot;,&quot;staticGalleryImage&quot;:{&quot;type&quot;:&quot;image/png&quot;,&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86b9fdcf-25aa-4253-8a38-57f799a3935d_1456x720.png&quot;}},&quot;isEditorNode&quot;:true}"></div><p style="text-align: justify;"></p><p style="text-align: justify;">         How many kernels do we need? Adding high kernels (more dimension) from the beginning will give superior performance but computation will also increase.<br></p><h4 style="text-align: justify;"><strong>Different kernels:</strong></h4><p>[[0 0 0] [0 1 0] [0 0 0]] ==&gt; identity kernel</p><p>[[0 0 0] [1 1 1] [0 0 0]] ==&gt; horizontal kernel</p><p>[[0 1 0] [0 1 0] [0 1 0]] ==&gt; vertical kernel</p><h4><strong>Channels Vs Features:</strong></h4><p style="text-align: justify;">Features (Edges and gradients) are important rather than colour. Channels for text are going to be all the alphabets &#8216;e&#8217; while features are going to be a single alphabet &#8216;e&#8217;. Kernel values need to be mapped to the requirement of the network. Kernels make the features brighter by convolution on it.</p><h4><strong>Receptive field:</strong></h4><p style="text-align: justify;">RF will be convolution done on the 5x5 image with a 3x3 kernel. Everywhere there will be an increment of 2 RF. 200 RF will be needed for making 1 to 400 images. Global receptive filed is of 5x5 before 3x3 RF and local RF will be 3x3 for just before.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dBcq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dBcq!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif 424w, https://substackcdn.com/image/fetch/$s_!dBcq!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif 848w, https://substackcdn.com/image/fetch/$s_!dBcq!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif 1272w, https://substackcdn.com/image/fetch/$s_!dBcq!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!dBcq!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif" width="1100" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:1100,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Receptive Field&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Receptive Field" title="Receptive Field" srcset="https://substackcdn.com/image/fetch/$s_!dBcq!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif 424w, https://substackcdn.com/image/fetch/$s_!dBcq!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif 848w, https://substackcdn.com/image/fetch/$s_!dBcq!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif 1272w, https://substackcdn.com/image/fetch/$s_!dBcq!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e09e372-4761-4e43-9a69-afe51287717a_1100x500.gif 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Receptive Field by Stanford</figcaption></figure></div><p>Our brain has four layers and follows exactly the same steps of neural network:</p><ul><li><p>Edges and gradients</p></li><li><p>texture and patterns</p></li><li><p>parts of objects</p></li><li><p>objects</p></li></ul><p>We will learn more about CNN in the next section.</p>]]></content:encoded></item><item><title><![CDATA[Interpretation of the brain for computer vision]]></title><description><![CDATA[The human brain is an important part of visualization.]]></description><link>https://www.ashvinee.nyc/p/interpretation-of-the-brain-for-computer</link><guid isPermaLink="false">https://www.ashvinee.nyc/p/interpretation-of-the-brain-for-computer</guid><dc:creator><![CDATA[Ashvinee]]></dc:creator><pubDate>Thu, 19 Nov 2026 10:25:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!UHhb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The human brain is an important part of visualization. The human brain contains approximately a hundred billion neurons and glia. <strong>Neurons</strong> are the building block of the brain that receive and send chemical signals. It helps to feel the environment around us. &#8216;Glia&#8217; is Latin for &#8216;glue&#8217;. <strong>Glia</strong> also helps in brain signaling along with the neurons. It can act like insulation and speed up the signal transmission. It can also act as an immune cell for non-responding neurons in our brain. Artificial intelligence also follows the same mathematics.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UHhb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UHhb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg 424w, https://substackcdn.com/image/fetch/$s_!UHhb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg 848w, https://substackcdn.com/image/fetch/$s_!UHhb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!UHhb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UHhb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg" width="728" height="409.25405405405405" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:416,&quot;width&quot;:740,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Open brain&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="Open brain" title="Open brain" srcset="https://substackcdn.com/image/fetch/$s_!UHhb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg 424w, https://substackcdn.com/image/fetch/$s_!UHhb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg 848w, https://substackcdn.com/image/fetch/$s_!UHhb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!UHhb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcebc3e76-1f2e-40f2-8f80-26770911e811_740x416.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Open Brain</figcaption></figure></div><p style="text-align: justify;">How the brain works for visuals. Our eyes act as cameras for capturing real-world images. The images are passed to the back of the brain for detection and recognition. There are different nerves present in the retina of the eye. These nerves convert the captured light into electrical impulses. These electric impulses are sent to the back of the brain using the optic nerve. This particular area in the back of the brain is the primary visual cortex. The visualization depends on light intensity rather than on color. The same method is followed in computer vision.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Tq4I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Tq4I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Tq4I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Tq4I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Tq4I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Tq4I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg" width="740" height="518" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:518,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Eye&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Eye" title="Eye" srcset="https://substackcdn.com/image/fetch/$s_!Tq4I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Tq4I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Tq4I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Tq4I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5814a4a-69a5-4b0c-b9d2-d6f4d4ae24f8_740x518.jpeg 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Eye</figcaption></figure></div><p style="text-align: justify;">The visualization of the brain function is studied on a  newborn kitten with one eye closed. The experiment is executed by David Hubel and Torstein Wiesel in 1964. They hypothesized that there is a period during which the visual nerve cells develop. The retina should receive any visual information during visual nerve cells development. If it did not receive, the cell of the visual cortex redistributes its response in favor of the working eye. Closing one eye of a newborn kitten reduced visual input to the retina. One conclusion was made based on this experiment. There are few brain cells that are mostly focused on detecting vertical lines. There are also few other brain cells that are focused on detecting other patterns of an object.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TFOu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TFOu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png 424w, https://substackcdn.com/image/fetch/$s_!TFOu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png 848w, https://substackcdn.com/image/fetch/$s_!TFOu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png 1272w, https://substackcdn.com/image/fetch/$s_!TFOu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TFOu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png" width="740" height="482" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:482,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;David Hubel and Torstein Wiesel Experiment&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="David Hubel and Torstein Wiesel Experiment" title="David Hubel and Torstein Wiesel Experiment" srcset="https://substackcdn.com/image/fetch/$s_!TFOu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png 424w, https://substackcdn.com/image/fetch/$s_!TFOu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png 848w, https://substackcdn.com/image/fetch/$s_!TFOu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png 1272w, https://substackcdn.com/image/fetch/$s_!TFOu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b492ed7-68a1-4d5b-8e73-1ff067b37da1_740x482.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">David Hubel and Torstein Wiesel Experiment</figcaption></figure></div><p style="text-align: justify;">With these findings, the computer scientist developed a mathematical model. The model works in the same way as biological neurons. This model is known as artificial neuron. This artificial neuron contains weights for the input streams and has output. The output is based on the mathematical computation of the input and its weight. There can be n number of neurons in the layers of the neural network. There can be m number of layers in the neural network. A convolutional neural network is one such network widely used for computer vision. This is because of its computational efficiency and spatial invariance. You will get to know more about convolutional neural networks in the CV X.X theory part.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e9n5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e9n5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png 424w, https://substackcdn.com/image/fetch/$s_!e9n5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png 848w, https://substackcdn.com/image/fetch/$s_!e9n5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png 1272w, https://substackcdn.com/image/fetch/$s_!e9n5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e9n5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png" width="719" height="342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:719,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Perceptron&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Perceptron" title="Perceptron" srcset="https://substackcdn.com/image/fetch/$s_!e9n5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png 424w, https://substackcdn.com/image/fetch/$s_!e9n5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png 848w, https://substackcdn.com/image/fetch/$s_!e9n5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png 1272w, https://substackcdn.com/image/fetch/$s_!e9n5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf1894d-20db-4e48-a21e-32dfb64b4f5d_719x342.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Perceptron</figcaption></figure></div><p style="text-align: justify;">From here, the idea for computer vision such as object detection started. A lot of algorithms are present today on this principle of pattern recognition. Artificial intelligence or machine learning can be understood as a pattern recognizer. Artificial intelligence as described in <a href="https://www.britannica.com/technology/artificial-intelligence">Britannica</a> is a system endowed with <a href="https://www.merriam-webster.com/dictionary/intellectual">intellectual</a> processes. The intelligence of humans, such as the ability to reason, discover meaning, generalize, or learn from past experience.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_i1o!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_i1o!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_i1o!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_i1o!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_i1o!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!_i1o!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg" width="740" height="654" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Humanoid robot with AI&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Humanoid robot with AI" title="Humanoid robot with AI" srcset="https://substackcdn.com/image/fetch/$s_!_i1o!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_i1o!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_i1o!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_i1o!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf39631f-077a-46c1-ac7f-6a259b12c43e_740x654.jpeg 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Humanoid robot with AI</figcaption></figure></div><p style="text-align: justify;"> <br>This is all explanation of how human vision is replicated into computer vision. This is done with the help of biologists and computer scientists. Mathematicians are extracting information from digital images for a long time. Now, computer vision is the most common technology used in various domains.  New fields are also emerging where computer vision can play a very crucial role. Few of the applications are in medicine, machine vision, military, autonomous vehicle, etc.</p>]]></content:encoded></item><item><title><![CDATA[Structuring machine learning project]]></title><description><![CDATA[Part of Coursera certification]]></description><link>https://www.ashvinee.nyc/p/structuring-machine-learning-project</link><guid isPermaLink="false">https://www.ashvinee.nyc/p/structuring-machine-learning-project</guid><dc:creator><![CDATA[Ashvinee]]></dc:creator><pubDate>Thu, 19 Nov 2026 10:21:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!mxTP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Few ideas may arise after a few experiments on the deep learning projects for improving the performance of the model. </p><p style="text-align: justify;">Do I</p><ul><li><p style="text-align: justify;">Collect more data</p></li><li><p style="text-align: justify;">Collect more diverse training set</p></li><li><p style="text-align: justify;">Train algorithm longer with gradient descent</p></li><li><p style="text-align: justify;">Try Adam instead of gradient descent</p></li><li><p style="text-align: justify;">Try bigger network</p></li><li><p style="text-align: justify;">Try smaller network</p></li><li><p style="text-align: justify;">Try dropout</p></li><li><p style="text-align: justify;">Add L2 regularisation</p></li><li><p style="text-align: justify;">Modify activation functions</p></li><li><p style="text-align: justify;">Change number of hidden units</p></li></ul><p style="text-align: justify;">In this blog, we will try to make an effective environment that can help to quickly figure out the problems present in the ongoing deep learning projects. Orthogonalization is one such process.</p><p style="text-align: justify;"></p><h3 style="text-align: justify;">Orthogonalization</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RS9V!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RS9V!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RS9V!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RS9V!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RS9V!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RS9V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg" width="350" height="244" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:244,&quot;width&quot;:350,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!RS9V!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RS9V!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RS9V!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RS9V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b04c8f-dc14-47a8-a97b-ed0e9a78f9f4_350x244.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p style="text-align: justify;">It can be easily understood with the help of the old TV model. If you used one of these then you might be quite familiar with the few knobs provided at the side of the model to tune the picture quality. With the help of these knobs, the picture can be moved in four directions. The same strategy is followed for deep learning projects.</p><p style="text-align: justify;">The chain of assumption is as follows:</p><ul><li><p style="text-align: justify;">Fit training set well on the cost function</p></li><li><p style="text-align: justify;">Fit validation set well on the cost function</p></li><li><p style="text-align: justify;">Fit test set well on the cost function</p></li><li><p style="text-align: justify;">Problem well in real world</p></li></ul><p style="text-align: justify;">How to move forward when the chain of the assumption is not working?</p><ul><li><p style="text-align: justify;">If the model is not fitting well on the training set, a few of the parameters can be tuned such as training a bigger network, optimizers.</p></li><li><p style="text-align: justify;">If the model is not fitting well on the validation set, try regularisation or increasing the training set.</p></li><li><p style="text-align: justify;">If the model is not fitting well on the test set, try increasing the validation set as the model is over-tuned on the validation set.</p></li><li><p style="text-align: justify;">If the model is not working well in the real world, try changing the validation dataset or modifying the loss function.</p></li></ul><p style="text-align: justify;">Try to avoid using early stopping at the beginning of the hyper-parameter tuning experiments as it affects the generalization of the training as well as a validation set.</p><p style="text-align: justify;">A Single number evaluation metric approach can be used for evaluating the model performance. Precision and recall are two important evaluation metrics used to check the performance of the deep learning model. Precision metric explains how many predictions are actually correct out of the total correct prediction. Recall explains how many predictions are correct out of actual correct values. There is a trade-off between precision and recall metrics. The F1 score helps to find the best performing deep learning model using the 2/[1/Precision + 1/Recall] formula. It is an average of precision and recalls metric or harmonic mean.</p><p style="text-align: justify;">How to perform Train/ Val/ Test data distribution? Choose a validation and test set to reflect data one expects to get in the future and consider it important to do well on. It should be collected from the same distribution. The final dataset needs to be the target for the model fitting. The selection of the data distribution can help to achieve the target in less time. What should be the size of the validation and test set? In the old era of deep learning, there was some thumb rule for dividing the dataset in 70:30 or 60:20:20 ratio for the small dataset. Now, these thumb rules don&#8217;t work. For the large dataset, it must be split in a 98:1:1 ratio. The test set need to be set big enough to give high confidence in the overall performance of the system. Provide larger negative weight values to the features not needed at the time of prediction. It will help to create a good algorithm using the loss function. The loss can be modified to integrate the negative weight values. The model performance can also degrade in the real work because the real world does not have good quality input data proved. It is better to change your validation and test dataset according to the real-world input dataset.</p><p style="text-align: justify;">The deep learning model can be trained to pass human-level performance. If it is not, it can be assisted by humans to improve the model performance such as</p><ul><li><p style="text-align: justify;">Get labeled data.</p></li><li><p style="text-align: justify;">Get insight from manual error analysis: Why did a person get this right?</p></li><li><p style="text-align: justify;">better analysis of bias/variance.</p></li></ul><p style="text-align: justify;">Avoidable bias is a final small training error and human (Bayes) error after which it is difficult to make improvements. In case when the training error and human (Bayes) error is very high, one needs to focus on the bias for improving the deep learning model performance. Make improvements on the training set. In some other cases when the difference between the training error and validation error is very high, one needs to focus on the variance. Make improvements on the validation set. This is only valid when all the training and Val/test set are from the same distribution. What if they come from a different distribution such as image data collected from web and phone cameras? In this case, one small set is made using the training data called the training-val set. The deep learning model is tested on this set and the above comparison are made. If there is a large difference between training and training-val set, it&#8217;s called variance error. If the difference between the training and training-val set is not large, and the training-val and validation error is large, it&#8217;s called data mismatch error. If the training error, training-val error, and validation error are the same, and the human error is quite small, it is a problem of Avoidable bias. If the training error, the training-val error is the same. The validation error is quite high and the human error is quite small. It is a problem of Avoidable bias as well as a data-mismatch problem. The data-mismatch problems can be solved by collecting more data similar to the val-test set data. Another solution can be using artificial data synthesis in which the real data is added with the noise data such as car sound to create new data. One more metric added to check the performance is test error. The large difference between the validation and test error explains the degree of over-fitting on the validation set. There can be cases where the validation, as well as test performance, is better than the training performance.</p><p style="text-align: justify;">Let&#8217;s perform an Error Analysis. To further improve the deep learning model performance, deep error analysis can be done to understand the error. Try to take a look at validation set examples to evaluate ideas. Collect 100 mislabelled validation set examples. There can be an image that looks similar to the other class of the image. The spreadsheet can be maintained to keep the record of the classified images with the reasons. Deep learning algorithms are quite robust to random errors compared to systematic errors in the training set. Apply the same process to validation and test sets to make sure they continue to come from the same distribution. Also, consider examining examples, the deep learning algorithm got right as well as wrong. What about data collected from different distributions? Now, the train and val/test set data come from slightly different distributions. Try to train the model on the data collected from a different distribution such as from a professional camera, internet, or phone camera. The validation and the test set need to be data coming from the target application where the model will be deployed. The training set can contain only data collected from the web and the val/test set can have data collected from the phone camera as the target user is on the phone.</p><p style="text-align: justify;">A lot of different approaches are present to overcome the huge amount of data required for the training to reach a state-of-the-art solution. Transfer learning is one of the very successful approaches for achieving good performance on the deep learning training in less time with fewer data. It learns features from one set of data and transfers it to the deep learning model to learn features of the different sets of data. Multi-task learning is learning more than one task at a time. For example in a self-driving car, the deep learning model is built to learn a few tasks such as recognizing pedestrians, cars, signboards, and traffic lights. The loss can be calculated based on pedestrian, cars, signboards, and traffic light recognition. Multi-task learning is useful when low-level features in the sets are useful for the training on the tasks and when the amount of data present for each task is quite similar. It can also benefit when the big neural network can be trained to do well on all the tasks.</p><p style="text-align: justify;">Here is one example of an end-to-end deep learning approach for food recipe suggestions.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mxTP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mxTP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png 424w, https://substackcdn.com/image/fetch/$s_!mxTP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png 848w, https://substackcdn.com/image/fetch/$s_!mxTP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png 1272w, https://substackcdn.com/image/fetch/$s_!mxTP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!mxTP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png" width="740" height="912" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:912,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!mxTP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png 424w, https://substackcdn.com/image/fetch/$s_!mxTP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png 848w, https://substackcdn.com/image/fetch/$s_!mxTP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png 1272w, https://substackcdn.com/image/fetch/$s_!mxTP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe903243c-4240-45bb-a57d-a5cabd5a0cd7_740x912.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-nxj3kw" tabindex="0" type="button"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button class="pencraft pc-reset pencraft icon-container view-image buttonBase-nxj3kw" tabindex="0" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.ashvinee.nyc/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Ashvinee's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>