<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhammad Shoaib Ali on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Shoaib Ali on Medium]]></description>
        <link>https://medium.com/@muhammadshoaibali?source=rss-163225d76b71------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bxgSjljn3lrc15J0</url>
            <title>Stories by Muhammad Shoaib Ali on Medium</title>
            <link>https://medium.com/@muhammadshoaibali?source=rss-163225d76b71------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 20:25:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muhammadshoaibali/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Build a Chatbot using LLM(ChatGPT) with Jupyter Notebook]]></title>
            <link>https://medium.com/@muhammadshoaibali/build-a-chatbot-using-llm-chatgpt-with-jupyter-notebook-b5ecfd291e4d?source=rss-163225d76b71------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5ecfd291e4d</guid>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[lms-software]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Muhammad Shoaib Ali]]></dc:creator>
            <pubDate>Sat, 20 May 2023 02:20:31 GMT</pubDate>
            <atom:updated>2023-05-20T02:29:52.752Z</atom:updated>
            <content:encoded><![CDATA[<p>since large language models (LLM) came into picture our NLP tasks are getting more precise and automated. I would say NLP world has been revolutionized with the release of ChatGPT since Nov 2022. we can automate our daily routine tasks by use of ChatGPT. I will try to explain with few examples like below:</p><ul><li>Summarize large text into smaller content.</li><li>Create custom chatbot.</li><li>Transforming text (language Translation as it’s trained on different languages)</li><li>Content generation (writing post, articles or general content, topic explanation, content into multiple languages, writing essays etc.)</li><li>Code or debug code (ChatGPT is trained on different language documentations, so it writes code for any given task in sentence).</li><li>Solve smaller mathematical task. (ask to explain it)</li></ul><p>The fun thing is you can also ask for jokes 😅 Let’s focus on the objective here to create a chatbot using ChatGPT model into <a href="https://jupyter.org/">Jupyter notebook</a>. probably you may be familiar with Jupyter environment its a web-based interactive python framework to show ML output. we will create a chatbot with basic front end to show conversation between user and AI assistant.</p><h4>Step1: Create OpenAI secret Key:</h4><p>pre-requisit of ChatGPT model into your notebook you have to register OpenAI website and get secret API key by navigating under your user account as shown below (Initially OpenAI grants users with free credit of worth 18$ usually quite enough to play around different projects later you will be charges based on tokens):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXzD7TFoUxFVG666fg-enQ.png" /></figure><p>you can also see your usage limit under your `Rate limits` tab. please be clear using ChatGPT chatbot interface does not caries any charges its free while only using ChatGPT with its API supports get’s charged base on token counts.</p><h4>Step2: Create Chatbot basic example:</h4><p>Create a new Jupyter notebook and Install OpenAI python module to communicate with all its functions and models. you can install it using pip `pip install openai`. The secret key which you get in step1 place it here by calling `api_key` functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*eKk-UW0vXsiFVoSXqeyD2g.png" /></figure><p>From set of models that improve on GPT-3 and can understand as well as generate natural language or code is `gpt-3.5-turbo` with <strong>175B</strong> parameters and trained on <strong>45TB</strong> text data from different resources. we will use it for our chatbot. Write a helper function which gets response from model and show as text as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*5ypcEfWsiNmPt8TKgbYfrw.png" /></figure><p>you see here we pass temperature as parameter which ranges from 0–1 as a factor for randomness of response from low to high respectively.</p><p><strong>Example:</strong> as we already know chatGPT is trained on TBs of data and it know a lot but we have to customize its response based on domain specific data. here are some questions and answer we give as prompt:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*ur8n3x4zHWsYC_5U6F9Kwg.png" /></figure><p>we tell system it should be a assistant who speaks like a shakespeare and with some conversation between user and assistant. In our given prompt user ask for a joke and assistant ask ‘why did the chicken cross the road’ user reply with ‘I don’t know’ below your see response from assistant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*2Nberkp3-Rjdvk4Cy2B3QQ.png" /></figure><p>as you see model understand context of conversation and responds accordingly. here we used `temperature=1` mean response from model should be highly random. when I get response again it gives different response like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*E1fPznXUIx2JkD8ZNQxU5g.png" /></figure><p>based on sensitivity and robustness of your application you can play around with temperature.</p><h4>Step3: Create Order bot Dashboard:</h4><p>At previous step we understand how model responds to prompt and now think of a pizza restaurant bot where we have menu alongside few specific questions to be asked for pizza order collection like size of pizza or extras. The first thing first install python dashboard module by `pip install panel`. no create a helper function to collect all messages to memorize model what discussion is going on in order to complete the order. We can automate the collection of user prompts and assistant responses to build a OrderBot. The OrderBot will take orders at a pizza restaurant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AFiX1xFoK1V23kW_QSMy1w.png" /></figure><p>Call Panel GUI functions for dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*gK6R9b7-CAhbJLI9hGG6NQ.png" /></figure><p>Below is compete prompt what we teach model to learn our domain specific question and collect order based on these rules we set below. we included menu details and some additional information to ask alongside the order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*24yQ_Vf1qRzA7aWsNYARuw.png" /></figure><p>Now we already set our rules for order collection and write a helper function to display interface and collect message alongside responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*icw33XD9dBsunsBq54D2fA.png" /></figure><p>Finally, you can see the responses bot is collecting order based on what we prompted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*kQWAdUNB_LsQtuve6CCz_g.gif" /><figcaption>orderbot</figcaption></figure><p>Find complete notebook <a href="https://github.com/shoaib-intro/chatgpt_nb.git">here</a></p><p><strong>Conclusion</strong>: In this article we see how easily we created orderbot for a restaurant to collect order using ChatGPT based on what we prompted to model. model takes our input and collects order accordingly. we can create any other bot same way.</p><p><strong>Reference</strong>:</p><ul><li>ChatGPT Course by Andrew Ng and OpenAI: <a href="https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/">ChatGPT Prompt Engineering for Developers — DeepLearning.AI</a></li><li>Creator of LLMs OpenAI: <a href="https://openai.com/blog/chatgpt">Introducing ChatGPT (openai.com)</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5ecfd291e4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Code tips]]></title>
            <link>https://medium.com/@muhammadshoaibali/python-code-tips-e13bd130ed41?source=rss-163225d76b71------2</link>
            <guid isPermaLink="false">https://medium.com/p/e13bd130ed41</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Muhammad Shoaib Ali]]></dc:creator>
            <pubDate>Sat, 23 Jul 2022 15:55:42 GMT</pubDate>
            <atom:updated>2022-07-23T15:55:42.453Z</atom:updated>
            <content:encoded><![CDATA[<p>Python code tips for memory and faster computation</p><h3>Iterate with enumerate</h3><p>When we need to iterate <strong>list</strong> with <strong>index</strong> and <strong>value</strong> then use If you need to iterate with enumerate instead of range(len(x)) which returns index and value as tuple.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55209a2a71eb7abcb3939381242223c5/href">https://medium.com/media/55209a2a71eb7abcb3939381242223c5/href</a></iframe><h3>List comprehension</h3><p>Use list comprehension with instead of formal loop which includes powerful loop and if else statement. let’s see in below example which calculates square of each number from 0–9.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0aab860a5040fabe379e28b9641a8d3a/href">https://medium.com/media/0aab860a5040fabe379e28b9641a8d3a/href</a></iframe><h3>Sort timetables</h3><p>If you need to sort a list, tuple, dictionary or complex iterables use built in sorted(x) function which will sort in ascending by default. it can be sorted reverse by setting sorted(x, reverse=True) . Dictionary can be sorted by setting key as function here we are sorting by ‘age’.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e85aef03f4d21ee4fe106756a7d0a58/href">https://medium.com/media/3e85aef03f4d21ee4fe106756a7d0a58/href</a></iframe><h3>Store unique values</h3><p>In stead of writing unique values in a list put list into a set which removes duplicate values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaa4b33309af82e976740d86c24cbc05/href">https://medium.com/media/eaa4b33309af82e976740d86c24cbc05/href</a></iframe><h4><strong>Save memory with generators comprehension</strong></h4><p>list comprehension is always good but when we are dealing with large amount of data then <strong>generators</strong> save lot of memory. here in this example we are generating sum of 10k numbers wit generator is only 112bytes but with list comprehension is 85k bytes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbc8f0a3d6bf9d152b9f929abed8a969/href">https://medium.com/media/fbc8f0a3d6bf9d152b9f929abed8a969/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/116/1*yTin2inO2Sx-RnPiOPSsqQ.png" /></figure><h3>get set dictionary items</h3><p>we can set some dictionary without crashing with <strong>key</strong> error by using .get() method which returns default value None without raising an error. we can also update dictionary with .setdefault(key, value) .</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de641cd158da64c44add2761505a71be/href">https://medium.com/media/de641cd158da64c44add2761505a71be/href</a></iframe><h3>use collections.counter</h3><p>If we need to count values in hashable objects like in list. It returns optimized count for each item. we can also get count for most common item with .most_common method which returns tuple with key and count.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa811efb8d423e3f6ea14f4c66baac2d/href">https://medium.com/media/aa811efb8d423e3f6ea14f4c66baac2d/href</a></iframe><h3>String formatting</h3><p>In python 3.6 we can format string and print with specific no of floating digits to be printed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a2ff01c1acc3ae804ed8fb146a8d36e/href">https://medium.com/media/9a2ff01c1acc3ae804ed8fb146a8d36e/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e13bd130ed41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parallelization with Pandas Series]]></title>
            <link>https://medium.com/@muhammadshoaibali/parallelization-with-pandas-series-889cd21fc08c?source=rss-163225d76b71------2</link>
            <guid isPermaLink="false">https://medium.com/p/889cd21fc08c</guid>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[multiprocess]]></category>
            <category><![CDATA[pandas-series]]></category>
            <category><![CDATA[parallelization]]></category>
            <category><![CDATA[multithreading]]></category>
            <dc:creator><![CDATA[Muhammad Shoaib Ali]]></dc:creator>
            <pubDate>Tue, 19 Jul 2022 21:24:37 GMT</pubDate>
            <atom:updated>2022-07-29T14:52:10.155Z</atom:updated>
            <content:encoded><![CDATA[<p>How to <strong>speedup</strong> the Pandas series operations and visualize progress</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ynHv9cE5_awFa-a1haPlyA.png" /><figcaption>image by author</figcaption></figure><p>pandas API uses only one core<strong> </strong>by default, while with only one line of code change allows user to take advantage of multi-core computer.</p><p>I will explain how to process different pandas operation with parallelization with pandarallel library which is a simple and efficient tool to <strong>parallelize</strong> Pandas operations on all available CPUs.</p><p>pandarallel also offers nice <strong>progress bars</strong> to get an rough idea of the remaining amount of computation.</p><h3><strong>Pandas default looping</strong></h3><p>Generally for efficient looping through rows of data in <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.apply.html">pandas series</a> we use pandas.Series.apply() which invoke function on value of pandas series. It acts similar to python default function map() which iterates throw each row of pandas to perform a given function.</p><p><strong>Example</strong>: here is an example for apply method where we are generating random number between 10–100 in df[Number] column by used of python function range() then looping through number series using pandas function .apply() for performing function(which calculates square of number) over each row in Number column.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5bdf5516bd7baa403e75e60b08965f55/href">https://medium.com/media/5bdf5516bd7baa403e75e60b08965f55/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*MB5lkmC9_rpIFj2ulV3usQ.png" /><figcaption>df.apply() method output in ‘Square column’</figcaption></figure><h3>Pandas Parallelization</h3><p>Generally the purpose of using the Pandas .apply() method is to speed up operations and avoid the use of loops for iterating over your data, but you can make Pandas operations run faster by distributing the operations all over the CPUs in your computer using the .parallel_apply()method from .pandarallel library.</p><h3>Installation</h3><pre>pip install pandarallel</pre><p>To use .parallel_apply() method just import and initialize it.</p><ul><li>I<strong>mport</strong> pandarallel using from pandarallel import pandarallel .</li><li><strong>Initialize</strong> pandarallel after importing it using pandarallel.initialize() . or if you want to see progress meter also with parallelization then enable as parameter by setting True pandarallel.initialize(progress_bar=True)</li><li><strong>Replace</strong> .apply() method in your code with .parallel_apply() .</li></ul><p><strong>Example</strong>:</p><p>we are using same above example with parallelization from pandarallel.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94be2e3047bf10132918e5251f917a25/href">https://medium.com/media/94be2e3047bf10132918e5251f917a25/href</a></iframe><p>Time taken by.parallel_apply() from pandarallel is <strong>141ms</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u38_R8M5Aa_2m5dEdkOFdg.png" /><figcaption>Total CPU time with <strong>.parallel_apply()</strong> from pandarallel</figcaption></figure><p>Time taken by pandas default method.apply() is <strong>922ms</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YswGRL_596R7WzvGUjTVBw.png" /><figcaption>Total time with <strong>.apply()</strong> method from pandas</figcaption></figure><p><strong>Performance </strong>wise usage of .parallel_apply() method from Pandarallel is much efficient which takes <strong>141ms</strong> where it runs on all available cores in my CPU, while for same operation on pandas series .apply()takes <strong>917ms</strong> which basically runs on single CPU core.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*AE_eDQRCy_rNw8tKmRko_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*FUT8TCJ2xK2eZADa70f-gw.png" /></figure><h3>Features</h3><p>here are some other features which pandarallel provides solution for parallelization pandas series. you can read more about these <a href="https://nalepae.github.io/pandarallel/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*_FR_zTtyeYFhwsOWUj3dgg.png" /><figcaption>image source from <a href="https://nalepae.github.io/pandarallel/">Pandarallel</a></figcaption></figure><h3><strong>Pandas Progress bar</strong></h3><p>If you are dealing with hunge amount of data and wants to track progress of operation on pandas series thenpandarallel also offers nice progress bars to get a rough idea of the remaining amount of computation to be done. The .progress_apply() method is part of the originally created <strong>tqdm</strong> package which enables you to create a progress meter and estimate “Time To Completion” for your iterations.</p><pre>pip install tqdm</pre><p>To use .progress_apply() method just import and initialize it.</p><ul><li><strong>Import</strong> <strong>tqdm</strong> using from tqdm import tqdm.</li><li>Initialize <strong>tqdm</strong> after importing it simply byusing tqdm.pandas() .</li><li><strong>Replace</strong> .apply() method in your code with .progress_apply() .</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2389addf2902b64c26ee81d9fe8aef5f/href">https://medium.com/media/2389addf2902b64c26ee81d9fe8aef5f/href</a></iframe><p>Output of above progress_apply() is shown below with bar measuring progress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G9KpjNWE2rFf1RNpELk9_g.png" /><figcaption>.progress_apply() shows progress meter</figcaption></figure><h3>Final thoughts</h3><p>In this article, we have discussed two alternatives which we can use over the Pandas series <strong>.</strong>apply<strong>() </strong>method depending on the problem and size of data you’re trying to solve.</p><ul><li>parallel_apply() if you want to speed up your Pandas operations which is recommended if you are working with large dataset or if you’re using CPU from cloud.</li><li>progress_apply() if you want to show a progress meter of your Pandas operations.</li></ul><p>Reference:</p><ul><li>[Pandas] <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.apply.html">https://pandas.pydata.org/docs/reference/api/pandas.Series.apply.html</a></li><li>[Pandarallel docs] <a href="https://nalepae.github.io/pandarallel/">https://medium.com/analytics-vidhya/2-apply-method-alternatives-you-should-try-909f3f06cec6</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=889cd21fc08c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flattening CNN layers for Neural Network and basic concepts]]></title>
            <link>https://medium.com/@muhammadshoaibali/flattening-cnn-layers-for-neural-network-694a232eda6a?source=rss-163225d76b71------2</link>
            <guid isPermaLink="false">https://medium.com/p/694a232eda6a</guid>
            <category><![CDATA[convolutional-network]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Muhammad Shoaib Ali]]></dc:creator>
            <pubDate>Thu, 23 Jun 2022 18:12:02 GMT</pubDate>
            <atom:updated>2022-06-23T18:19:03.970Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Why Deep learning?</strong></p><p>In real world data is increasing constantly. when amount of data always increasing then at a certain point traditional <strong>machine learning</strong> algorithms shows maximum accuracy and after that specific interval fails to increase accuracy. There outshines <strong>deep learning</strong> where algorithms constantly increases accuracy with the increasing amount of data. ML also doesn’t perform well over high dimensional data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*laCiveXbzbigj4fvDrP2XA.jpeg" /></figure><p>let’s see how model layers works firstly</p><ul><li><strong>Convolutional layer</strong></li></ul><p>Image filtering (kernel) is process modifying image by changing its shades or colour of pixels. it is also used for brightness and contrast.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*fGF6Na0_Y8_mboYNNysI2A.gif" /><figcaption>kernel size 3x3 in convolutional layer of channel 1</figcaption></figure><ul><li><strong>Pooling layer</strong></li></ul><p>Pooling layer used to reduce feature map dimension&#39;s. Thus it reduces <strong><em>no. of parameters to learn</em></strong> and <strong><em>amount of computation</em></strong> performed in network. pooling layer <strong><em>summarises features</em></strong> present in a region of feature map generated by convolutional layer.</p><figure><img alt="dsdsasdsadadsa" src="https://cdn-images-1.medium.com/max/563/1*XTqD1NfrY9HPj9rLEtXm2A.png" /><figcaption>Max and Average pooling layers</figcaption></figure><p>In this image kernel size is 2x2 and stride 2. which means kernel steps twice.</p><p>Max pooling layer finds max in 2x2 kernel of input image (like max in light blue kernel area out of <strong>[8,7,12,9]</strong> is <strong>12</strong>)</p><p>Average pooling layer takes average of 2x2 kernel (like in blue areas [8+7+12+9]/4 = <strong>9</strong>)</p><ul><li><strong>Padding layer</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*AGxifEav63gspZ1dd4mZIQ.gif" /><figcaption>Padding effects output image size while filtering in Conv/padding layer</figcaption></figure><p>Its similar like convolutional layer as it refers amount of pixels added to an image when it is being processed by kernel or filter. when don’t use stride then by default is 1. Half padding mean half of filter size and full padding mean padding equal to size of filter/kernel. Padding is done to reduce the loss of data among the sides/boundary of the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*6-m5H08XhyIF44PPct8a1A.png" /></figure><p>output size of image calculated using this formula [(W−K+2P)/S]+1.</p><ul><li>W is the input volume</li><li>K is the Kernel size</li><li>P is the padding</li><li>S is the stride</li><li><strong>Flatten operation</strong></li></ul><p>Intuition behind flattening layer is to converts data into 1-dimentional array for feeding next layer. we flatted output of convolutional layer into single long feature vector. which is connected to final classification model, called fully connected layer. let’s suppose we’ve <strong>[5,5,5]</strong> pooled feature map are flattened into <strong>1x125</strong> single vector. So, flatten layers converts multidimensional array to single dimensional vector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*_Cb1dzBhciwRi9y1-J6qjQ.png" /></figure><ul><li><strong>Connected Components</strong></li></ul><p>The model take input image of size 28x28 and applies first Conv layer with kernel 5x5 , stride 1 and padding zero output n1 channels of size 24x24 which is calculated by the output of a pooling layer is (Input Size — Pool Size + 2*Padding)/Stride + 1.. then poling layer same like conv but this time filter size 2x2 and stride 2, when we calculate using Conv layer formula outputs are 12x12 of same channel n1. i repeats similar way once again and at the end flatten layer converts two dimensional arrays to one dimensional vector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*laCiveXbzbigj4fvDrP2XA.jpeg" /></figure><h3>Conclusion:</h3><p>we gone through basic convolutional layers details and components which are basic component for working with CNN. In the end of this article we classified image.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=694a232eda6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>