<?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 Azeem - I on Medium]]></title>
        <description><![CDATA[Stories by Azeem - I on Medium]]></description>
        <link>https://medium.com/@ibtedaazeem?source=rss-f6f87d909679------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fXWW_fxf-v09YM6hgoUzUA.png</url>
            <title>Stories by Azeem - I on Medium</title>
            <link>https://medium.com/@ibtedaazeem?source=rss-f6f87d909679------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 02:53:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ibtedaazeem/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[McCulloch-Pitts Neuron: Origins of Neural Networks Explained]]></title>
            <link>https://medium.com/@ibtedaazeem/mcculloch-pitts-neuron-origins-of-neural-networks-explained-6153d4bcda34?source=rss-f6f87d909679------2</link>
            <guid isPermaLink="false">https://medium.com/p/6153d4bcda34</guid>
            <category><![CDATA[artificial-neural-network]]></category>
            <category><![CDATA[neural-network-algorithm]]></category>
            <category><![CDATA[mcculloch-pitts-neuron]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Azeem - I]]></dc:creator>
            <pubDate>Sat, 12 Oct 2024 08:52:20 GMT</pubDate>
            <atom:updated>2024-10-12T12:43:04.790Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZoiqD2zmhPfAcjx0DYadQ.jpeg" /><figcaption>AI generated image by freepik</figcaption></figure><p>In 1943, neuroscientist Warren S. McCulloch and logician Walter Pitts published proposed a highly simplified computational model of biological neuron. They sought to understand how the brain generates highly complex patterns using many interconnected basic cells, known as neurons. McCulloch and Pitts presented a highly simplified model of a neuron in their study.</p><p>The McCulloch-Pitts neuron operated as a binary device, functioning in an all-or-nothing manner. It had multiple inputs and a single output; if the combined inputs surpassed a certain threshold, the neuron would ‘fire’. Otherwise, it remained inactive. This straightforward yet potent concept mimicked the fundamental function of neurons in the brain.</p><p>There are basically two functions in MCP neuron . <strong>g </strong>is the aggregation function which takes the sum of all the binary inputs. <strong>f</strong> is the function which takes <strong>g</strong> as the input.</p><p>There are basically two functions in MCP neuron .</p><h4><strong>g </strong>is the aggregation function which takes the sum of all the binary inputs.<br> <strong>f</strong> is the function which takes <strong>g</strong> as the input.</h4><p><strong><em>g aggregates the inputs and the function f takes a decision based on this aggregation.</em></strong></p><p>The inputs can be excitatory or inhibitory.</p><p>y = 0 if any xi is inhibitory,else:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*OOmjTa5HQQikSKSIcgvRDA.png" /></figure><h4><strong>where f(g(x)) will be 1 if g(x) will be greater than certain threshold i.e θ and if g(x) is less than θ then the f(g(x)) will be 0.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J4i0KcZsdbFpQVtddD4-Zg.png" /><figcaption>McCulloh Pitts Neuron Model with four inputs</figcaption></figure><h3><strong>IMPLEMENTATION OF BOOLEAN FUNCTIONS USING MCP NEURON MODEL</strong></h3><p><strong>What do we mean by implementing Boolean functions using MCP neuron model?</strong></p><p>It means that when we pass binary input to a MCP neuron it should give the same output as the Boolean function we are trying to implement.</p><p>A single McCulloh Pitts Neuron can be used to represent Boolean functions which are linearly separable.</p><p><strong>What do you mean by Linear separable Boolean functions?</strong></p><p>There exists a line (plane) such that all inputs which produce a 1 lie on one side of the line(plane) and all inputs which produce 0 lie on other side of line(plane).</p><h3><strong>IMPLEMENTING THE AND FUNCTION</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*o77f-L7z3UVuRPfN8K0Tkg.png" /><figcaption>graphical representation of AND function made with Desmos</figcaption></figure><p>If we visualize the inputs in 2 dimension we can see that the inputs belonging to the output label 0 can be separated from the inputs belonging to output label 1 with a line. The points on the red dotted line and above the red dotted line belongs to output label 1. <br>We can also say that all the points lying in the shaded half space are points belonging to output label 1<br>Hence we can see that our data is linearly separable with the boundary line</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*ddDVu5beS_nRMUQft8wMvg.png" /><figcaption>Boundary Line for AND function with two inputs</figcaption></figure><h4>Let us take two binary inputs for consideration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*qBPQHL8XbHdhczAtddhE1g.png" /><figcaption>AND function Truth Table</figcaption></figure><p>From the AND Truth table we can see that if both the inputs are 1 then only the output is 1.</p><h4>Let us see the all possible combination of inputs along with aggregate function and threshold function output for these inputs</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*aUWoJzn7M8gBa1iRy_eTxA.png" /><figcaption>Truth Table for Boolean AND McCulloh Pitts model</figcaption></figure><p>From the above table we can see that if the <strong>g(x)&lt;2</strong> then the output is zero which means that the neuron will not fire.</p><h4>Only if g(x)=2 then only the output is 1 for ,</h4><h4>For two binary inputs so here we can set 2 as the threshold value.<br> θ i.e threshold = 2<br> if θ &gt;=2 then f(g(x))=1 <br> else if θ &lt;2 then f(g(x))=0</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-jgKUCOt3Y6vdrp66lmU9g.png" /><figcaption>McCulloh Pitts Neuron Model with 4 inputs representing AND function</figcaption></figure><p>Similarly we can generalize the threshold value for n number of inputs if we want to implement AND function.</p><h4><strong><em>For n inputs threshold θ = n for MCP model resembling AND function</em></strong>.</h4><h3><strong>IMPLEMENTING THE OR FUNCTION</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ge8-Ocw2e9M8NtGzlG0gXA.png" /><figcaption>Graphical representation of OR function made with Desmos</figcaption></figure><p>If we visualize the inputs in 2 dimensions we can see that the inputs belonging to the output label 1 can be separated from the inputs belonging to output label 0 with a line. The point on the purple dotted line belongs to output label 0 and the points above purple dotted line belongs to output label 1.<br> We can also say that all the points lying in the purple shaded half space are points belonging to output label 0.<br>Hence we can see that our data is linearly separable with the boundary line .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*PpVKXGOHfAnLNLX6T4wjfA.png" /><figcaption>Boundary Line for OR function with two inputs</figcaption></figure><p>Let us take two binary inputs for consideration.From the OR Truth table we can see that if either of the input is 1 then the output is 1 and when both the inputs are 0 then only output is zero.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*RY-vS1opy-tbK3cpB4m1eQ.png" /><figcaption>OR function Truth Table</figcaption></figure><p>Let us see the all possible combination of inputs along with aggregate function and threshold function output for these inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*hBa920tRDJ8NPanGPlMYPA.png" /><figcaption>Truth Table for Boolean OR McCulloh Pitts Model</figcaption></figure><p>From the above table we can see that if the g(x)&lt;0 then the output is 0 which means that the neuron will not fire.</p><h4>Only if g(x)&gt;0 then only the output is 1 .</h4><h4>For two binary inputs so here we can set 1 as the threshold value.<br> θ i.e threshold = 1<br> if θ &gt;=1 then f(g(x))=1 <br> else if θ &lt;1 then f(g(x))=0</h4><p>Similarly we can generalize the threshold value for n number of inputs if we want to implement OR function. <br>For OR gate implementation for n number of inputs the threshold value will always be 1.</p><h4><strong><em>For n inputs threshold θ = 1 for MCP model resembling OR function</em></strong>.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gs2rZpNlxf3bvyrhOFRFlg.png" /><figcaption>McCulloh Pitts Neuron Model with 4 inputs representing OR function</figcaption></figure><h3>Why McCulloh Pitts Neuron Model is Important ?</h3><p>· <strong>Foundation of Neural Networks:</strong> The McCulloch-Pitts model, developed in 1943, provided the first formal structure of an artificial neuron, laying the groundwork for modern neural networks used in AI today.</p><p>· <strong>Boolean Logic in AI:</strong> By applying Boolean logic, the model showed that neurons could perform logical operations like AND, OR, and NOT, forming the basis for computational logic in AI and computer science.</p><p>· <strong>Inspiration for Future Models:</strong> It influenced the creation of the Perceptron and more advanced neural networks, which evolved into deep learning models widely used for tasks like image recognition and language processing.</p><p>· <strong>Link Between Brain and Computation:</strong> The model demonstrated that brain activity could be replicated as mathematical computation, inspiring interdisciplinary research in neuroscience and AI.</p><p>· <strong>Revealed AI’s Potential and Limitations:</strong> Although it introduced key neural concepts like input summation and activation, its fixed weights and simplicity drove the development of more adaptive algorithms, advancing AI research.</p><h3>Limitations of McCulloh Pitts Neuron Model</h3><p>· All the inputs are treated equally there is no weighting mechanism involved</p><p>· It cannot handle non linearly separable functions</p><p>· It is limited to only Boolean inputs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6153d4bcda34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Brief Historical Review :Path That Led To GenerativeAI]]></title>
            <link>https://medium.com/@ibtedaazeem/a-brief-historical-review-path-that-led-to-generativeai-446a4fb1f556?source=rss-f6f87d909679------2</link>
            <guid isPermaLink="false">https://medium.com/p/446a4fb1f556</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[deep-neural-networks]]></category>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Azeem - I]]></dc:creator>
            <pubDate>Tue, 09 Apr 2024 18:52:00 GMT</pubDate>
            <atom:updated>2024-04-09T18:52:00.361Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Brief Historical Review :Path That Led To GenerativeAI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9vxKmLV4yuWQ9B-vJ98eEQ.png" /><figcaption>Image generated with Microsoft copilot</figcaption></figure><p>Generative Artificial Intelligence (AI) has rapidly advanced in recent years, enabling machines to create data that closely resembles human-generated content.  With the rise of language models like GPT (Generative Pre-trained Transformer), machines can generate coherent and contextually relevant text across various tasks such as storytelling, content creation, and dialogue generation. These models have applications in natural language processing, virtual assistants, and automated content generation for websites and social media platforms.<br>AI-powered translation models can generate translations for text in different languages, aiding in global communication and localization efforts. These models can translate documents, websites, and multimedia content, facilitating cross-cultural exchanges and expanding market reach for businesses.<br>Chatbots and virtual assistants powered by generative models can answer questions, provide customer support, and perform tasks like scheduling appointments or making reservations..  Text summarization models can generate concise summaries of longer documents, articles, or reports, aiding in information retrieval and knowledge extraction.</p><h3>A Brief Explanation about RNN and LSTM</h3><h4>RNN(Recurrent Neural Network)</h4><p>Recurrent Neural Networks (RNNs) stand out among artificial neural networks as they are tailored for handling sequential data. Unlike conventional feedforward neural networks, RNNs feature connections that form loops, enabling them to showcase dynamic temporal behavior. This unique architecture renders them ideal for tackling tasks that involve sequences, including but not limited to time series prediction, natural language processing, and speech recognition. Despite their versatility, traditional RNNs encounter challenges like the vanishing gradient problem, which hampers their capability to effectively capture long-range dependencies.</p><h4>LSTM(Long Short Term Memory)</h4><p>Long Short-Term Memory networks (LSTMs) stand out as a specialized type of RNN meticulously designed to address the vanishing gradient challenge. Distinguished by their intricate architecture compared to traditional RNNs, LSTMs integrate memory cells and a suite of gating mechanisms to finely regulate information flow within the network. This sophisticated arrangement enables LSTMs to effectively capture distant dependencies in sequential data by selectively preserving or discarding information over time</p><h3>Sequence to Sequence Learning with Neural Networks</h3><p>The Seq2Seq Paper, authored by Ilya Sutskever, Oriol Vinyals, and Quoc V. Le in 2014, introduced the concept of sequence-to-sequence learning with neural networks. The paper proposed a novel architecture consisting of two recurrent neural networks, an <strong>encoder and a decoder,</strong> capable of translating sequences of variable length. This groundbreaking approach laid the foundation for numerous subsequent advancements in machine translation and other sequence generation tasks. <br>The seq2seq model consists of two key components: an encoder and a decoder. The encoder takes an input sequence (e.g., a sentence in one language) and processes it into a fixed-size vector representation called the context vector. This vector encapsulates the meaning or context of the input sequence. The decoder then takes this context vector as input and generates the output sequence (e.g., a translated sentence in another language) one token at a time.  One of the major advantages of the seq2seq model is its ability to handle variable-length input and output sequences.<br>In their paper, Sutskever and others demonstrated that the Long Short-Term Memory (LSTM) architecture, offers a straightforward solution to general sequence-to-sequence problems. Their approach involves employing one LSTM to sequentially process the input sequence, generating a large fixed-dimensional vector representation. Subsequently, another LSTM is utilized to decode the output sequence from this vector, effectively acting as a recurrent neural network language model , conditioned on the input sequence. The authors justify their choice of LSTM due to its ability to effectively learn from data with long-range temporal dependencies, which aligns well with the significant time lag between inputs and their corresponding outputs in many applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*pvI2BpkKRk5aGpZjD0462A.png" /><figcaption>Image from original paper-The Seq2Seq Paper, authored by Ilya Sutskever, Oriol Vinyals, and Quoc V. Le</figcaption></figure><p>They described their model’s behavior, where it reads an input sentence, such as “ABC,” and generates an output sentence, such as “WXYZ,” terminating predictions upon encountering the end-of-sentence token. Notably, the model adopts the practice of reading the input sentence in reverse. This approach is chosen because it introduces numerous short-term dependencies in the data, consequently simplifying the optimization problem.</p><h3>Neural Machine Translation by Jointly learning To Align and Translate</h3><p><strong>“Neural Machine Translation by Jointly Learning to Align and Translate” </strong>is a significant contribution by Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio, presenting a novel<strong> attention mechanism</strong> for neural machine translation (NMT) models. <br>Published in 2015, the paper addresses the limitations of conventional NMT systems by proposing a method that learns to align and translate concurrently.  Initially, the authors identify shortcomings in existing NMT models, particularly in handling lengthy input sequences. These models struggle to capture long-range dependencies effectively, resulting in subpar translation quality for longer sentences. To tackle this issue, the paper introduces an attention mechanism that allows the model to selectively focus on different parts of the input sentence. <br>The attention mechanism enhances interpretability, allowing users to discern which parts of the input sentence the model prioritizes during translation. This mechanism has found widespread adoption in diverse sequence-to-sequence tasks beyond machine translation, solidifying its significance in the realm of natural language processing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*65LoBubN2MHzQUTWgZHJqQ.png" /><figcaption>Image from original paper-“Neural Machine Translation by Jointly Learning to Align and Translate” paper by Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio.</figcaption></figure><p>The authors present an extension to the encoder-decoder model, enabling it to simultaneously learn alignment and translation. In this model, each time a word is generated in the translation process, the model conducts a soft search for positions in the source sentence containing the most relevant information. Based on the context vectors associated with these source positions and the previously generated target words, the model predicts the next target word.<br>The attention mechanism operates by assigning each word in the input sentence a weight, indicating its significance in the translation process. During decoding, the model dynamically adjusts these weights, enabling it to attend to different segments of the input sequence as necessary. Consequently, the model can efficiently align words between the source and target languages, even with lengthy sentences.</p><h3>Introduction to Transformers</h3><p><strong>“Attention Is All You Need” </strong>stands as a pivotal work in natural language processing (NLP), penned by Vaswani et al., unveiling the Transformer model architecture. Released in 2017, it proposes an innovative approach to sequence-to-sequence learning, departing from conventional recurrent neural networks (RNNs) and convolutional neural networks (CNNs) by embracing <strong>self-attention mechanisms. </strong><br>The paper introduces the <strong>Transformer architecture</strong> as a scalable and efficient model for processing sequential data. Its core innovation lies in the self-attention mechanism, empowering the model to assess the significance of each word in the input sequence in relation to all others. This capability enhances the model’s ability to capture long-range dependencies within the data, surpassing traditional methods. <br>A standout feature of the Transformer is its adoption of multi-head attention, where attention mechanisms operate in parallel multiple times. This enables the model to attend to diverse aspects of the input sequence concurrently. Furthermore, positional encodings are integrated into the model to convey information about token positions within the sequence, ensuring it understands the sequential order of tokens.</p><h3>Why Transformers?</h3><p><strong>Scalability:</strong> Transformers efficiently handle sequences of varying lengths without significant increases in computational complexity, ensuring scalability.  <br><strong>Effective Handling of Long-Range Dependencies:</strong> They excel in capturing long-range dependencies within sequences, surpassing the capabilities of architectures like RNNs. <br><strong>Parallelization Efficiency:</strong> Transformers allow parallel computation across sequence elements, resulting in faster training and inference compared to traditional architectures. <br><strong>Comprehensive Global Context:</strong> Through their self-attention mechanism, Transformers enable each token to consider information from all others in the sequence, providing a comprehensive global context for improved understanding. <br><strong>Transparent Attention Mechanism:</strong> The attention mechanism offers insights into the model’s decision making process, enhancing interpretability and model comprehension. <br><strong>State-of-the-Art Performance:</strong> Transformers have achieved leading results across multiple NLP tasks, including machine translation, text summarization, and language modeling.<br><strong>Mitigation of Gradient Vanishing Issues:</strong> Unlike RNNs, Transformers exhibit more stable gradient flows, reducing the risk of vanishing gradients and enhancing training stability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EgXaE9VCwdqjWyhVIcULjQ.png" /><figcaption>Image from original paper-“Attention Is All You Need“ paper by Vaswani et al. </figcaption></figure><h4>Tranformer Components</h4><p><strong>Encoder: </strong>The encoder consists of multiple layers, with each layer housing a self-attention mechanism followed by a position-wise feedforward network. It encodes the input sequence tokens by considering interactions with all other tokens, thereby capturing their interrelationships and dependencies.  <br><strong>Decoder:</strong> It also encompasses several layers, each integrating self-attention, encoder-decoder attention, and a positionwise feedforward network. The generation of output sequence tokens is achieved by utilizing encoded representations from the encoder along with previously generated tokens.  <br><strong>Self attention mechanism: </strong>The self-attention mechanism allows every token within the sequence to calculate attention scores concerning all other tokens. These scores determine the relative importance of other tokens in relation to the current token, enabling the model to selectively concentrate on various segments of the sequence during both encoding and decoding phases.  <br><strong>Multi-Head Attention : </strong>It enriches the model’s ability to focus on different facets of the input sequence concurrently. It facilitates parallel attention computations by dividing the input into multiple subspaces and independently processing attention within each subspace.  <br><strong>Position-Wise Feedforward Networks :</strong> apply fully connected feedforward networks separately to every token position within the sequence. This introduces non-linear transformations, thereby augmenting the model’s capability to capture complex data patterns.  <br><strong>Residual Connections and Layer Normalization:</strong> aid in maintaining smooth information flow and alleviating problems associated with vanishing gradients. They improve training stability by normalizing activations within each layer.  <br><strong>Positional Encoding :</strong> incorporates positional information into input embeddings, allowing the model to differentiate between token sequences based on their positions. This enhances the model’s comprehension of the sequence’s token order.  <br><strong>The Output Layer</strong> : produces the final predictions or output sequence based on the representations from the decoder. It commonly includes a softmax layer for sequence classification tasks or a linear layer for sequence generation tasks.</p><h3>How Is GPT-1 Trained From Scratch?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NIg38Jt0WuuT4aEZ4tvVrg.png" /><figcaption>Image Generated with Microsoft Copilot</figcaption></figure><p>GPT-1 learns from scratch by reading a lot of text. It’s like teaching a smart robot to understand and generate sentences. GPT-1 tries to guess the next word in a sentence based on the words before it. This helps it understand how words fit together and what usually comes next in a sentence. It looks at lots of sentences and tries to learn patterns and connections between words.  <br>GPT-1 utilizes a transformer-based architecture similar to the one introduced in the “Attention is All You Need” paper. This architecture consists of multiple layers of self-attention mechanisms and feedforward networks.The transformer architecture allows GPT-1 to capture contextual information efficiently across long sequences, facilitating its language modeling capabilities.  <br>Like BERT, GPT-1 adopts a tokenization scheme to convert raw text into tokens suitable for model input. This typically involves breaking text into words or subwords and assigning a unique token to each. <br> GPT-1 is trained on a large corpus of text data, similar to BERT. The training corpus can include diverse sources such as books, articles, and websites to ensure broad coverage of language patterns and concepts.  The training procedure consists of two stages. The first stage is learning a high-capacity language model on a large corpus of text. This is followed by a fine-tuning stage, where the model is adapted to a discriminative task with labeled data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XpplLzgdGSdvTRwnpPhkuA.png" /><figcaption>Image from original paper-Improving Language Understanding by Generative Pre-Training by Alec Radford et al. by openAI</figcaption></figure><p>During <strong>pre-training</strong>, GPT-1 is exposed to sequences of tokens from the training corpus. For each sequence, the model predicts the next token based on the preceding context.The training objective involves minimizing the cross-entropy loss between the predicted tokens and the actual next tokens in the sequences.  <br>The model parameters are updated using backpropagation and gradient descent algorithms to minimize the loss function.Training typically proceeds over multiple epochs, iterating through the training corpus multiple times to improve the model’s language modeling capabilities.  After pre-training, GPT-1 can be <strong>fine-tuned </strong>for specific downstream tasks if required. This involves further training the model on task-specific labeled data to adapt its parameters to the task at hand. Fine-tuning may involve adjusting the learning rate, training duration, and other hyperparameters to optimize performance on the target task. <br>Overall, GPT-1 is trained from scratch using a transformer-based architecture and autoregressive language modeling objective, similar to BERT. It leverages a large corpus of text data and undergoes pre-training followed by potential fine-tuning for specific downstream tasks.  <br>By pre-training on a diverse corpus with long stretches of contiguous text the model acquires significant world knowledge and ability to process long-range dependencies which are then successfully transferred to solving discriminative tasks such as question answering, semantic similarity assessment, entailment determination, and text classification.</p><h3>References</h3><blockquote>The Seq2Seq Paper, authored by Ilya Sutskever, Oriol Vinyals, and Quoc V. Le .  <br>“Neural Machine Translation by Jointly Learning to Align and Translate” paper by Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. <br> “Attention Is All You Need“ paper by Vaswani et al.  <br>Improving Language Understanding by Generative Pre-Training by Alec Radford et al. by openAI</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=446a4fb1f556" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding ResNet Architecture: A Deep Dive into Residual Neural Network]]></title>
            <link>https://medium.com/@ibtedaazeem/understanding-resnet-architecture-a-deep-dive-into-residual-neural-network-2c792e6537a9?source=rss-f6f87d909679------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c792e6537a9</guid>
            <category><![CDATA[artificial-neural-network]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Azeem - I]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 10:31:05 GMT</pubDate>
            <atom:updated>2023-11-14T10:31:05.544Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*21dtCA1NcDdfir0gdX2IEA.jpeg" /><figcaption>&lt;a href=”<a href="https://www.freepik.com/free-ai-image/blueeyed-cyborg-woman-watches-futuristic-computer-data-generated-by-ai_41438379.htm#fromView=search&amp;term=Computer+Visison&amp;page=1&amp;position=0&amp;track=ais_ai_generated&amp;regularType=ai">https://www.freepik.com/free-ai-image/blueeyed-cyborg-woman-watches-futuristic-computer-data-generated-by-ai_41438379.htm#fromView=search&amp;term=Computer+Visison&amp;page=1&amp;position=0&amp;track=ais_ai_generated&amp;regularType=ai</a>&quot;&gt;Image By vecstock&lt;/a&gt;</figcaption></figure><p>Residual Network is a deep Learning model used for computer vision applications.<br> The ResNet (Residual Neural Network) architecture was introduced by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian sun in their paper titled “Deep residual Learning for Image Recognition “ in 2015.This article is primarily based on this paper.<br> One of the most significant developments in the ILVRSC (ImageNet Large Scale Visual Recognition Challenge) 2015 was the introduction of Residual network. Resnet achieved unprecedented results by addressing the challenges associated with training very deep neural networks. <br> Resnet outperformed other architectures by winning winning the image classification task in ILVRSC 2015 by a substantial margin with top 5 error rate of 3.57 % and achieved remarkable results .</p><h3><strong>Challenges faced by Deep Neural Networks</strong></h3><p>· <strong>Vanishing/Exploding Gradient Problem:</strong></p><p>As the number of layers in the neural network increases the gradients of the loss function with respect to the weight may become extrememly small during backpropogation. This makes it difficult for the latter layers to learn any meaningful pattern as the updates of the weights are almost negligible to have an impact.<br> Conversely in some cases the gradients can become very large during backpropogation leading to unstability in the training process by causing the weights to be updated by large amount, making the optimization process difficult to control.</p><p>· <strong>Degradation Problem in Neural Network:<br> </strong>The degradation<strong> </strong>problem in neural networks refers to the phenomenon where, as the depth of a neural network increases ,the performance of the network on the training data saturates and then starts to degrade. The degradation problem is particularly problematic because it goes against the intuition that deeper networks are more able to extract intricate and abstract features.We can see it as twofold problem</p><p>o <strong>Performance Plateau: </strong>As the number of layers in the neural network increases the training error tends to saturate and stops improving.It means that the additional layers are not having any significant benefit on the reduction of training error.</p><p>o <strong>Accuracy Degradation: </strong>After the addition of more layers surprisingly the error on the validation set starts increasing and the performance on the unseen data becomes poor.</p><h3><strong>Key Components of ResNet Architecture</strong></h3><p><strong>1-Residual Block:</strong></p><p>Residual blocks are the main components of Residual Neural network .In a classical neural network the input is transformed by a set of convolutional layers then it is passed to the activation function. In a residual network the input to the block is added to the output of<br> the block creating a residual connection.The output of the residual block H(x) can be represented by:</p><p>H(x) = F(x) + x</p><p>F(x) represents the residual mapping learned by the network .The presence of identity term x allows the gradient to flow more easily .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-sbE72ZXVIdMQnVpZdg_w.png" /><figcaption>image from original paper-link-<a href="https://arxiv.org/pdf/1512.03385.pdf">https://arxiv.org/pdf/1512.03385.pdf</a></figcaption></figure><p><strong>2- Skip Connection:</strong></p><p>Skip connection helps in forming the residual blocks.Skip connection consists of the input of the residual block that is bypassed over the convolutional layer and added to the output of the residual block.</p><p><strong>3- Stacked layers</strong>:</p><p>ResNet architectures are formed by stacking multiple residual blocks together.Using these multiple residual blocks together resnet architecture can be built very deep.Versions of ResNet with 50,101,152 layers were introduced.</p><p><strong>4-Global Average Pooling(GAP)</strong></p><p>Resnet architectures typically utilises Global average Pooling as the final layer before the fully connected layer .GAP reduces spatial dimensions to a single value per feature map providing a compact representation of the entire feature map.</p><h3><strong>A Look into the 34 layered Residual Neural Network</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4sfcZjm3AvWBhwYLl7PYQ.png" /><figcaption>image from original paper-link-<a href="https://arxiv.org/pdf/1512.03385.pdf">https://arxiv.org/pdf/1512.03385.pdf</a></figcaption></figure><p>In this diagram we can see the VGC-19 ,34 layer plain network and 34 layered residual network.<br> In this residual network there are total 16 residual blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hjsawyQ2FOQ20-NvQJIaiw.png" /></figure><p>· The first set consists of 3 residual blocks. Each residual block consists of 2 convolution layers where each convolution layer consists of 64 filters of size 3x3 and a skip connection which performs identity mapping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-qK6I0THlYpNIgWsr-iFg.png" /></figure><p>· Second set consists of 4 residual blocks. Each residual block contains 2 convolutional layers where each layer consists of 128 kernels of of size 3x3 and a skip connection .</p><p>· <strong>Dotted line</strong> <strong>skip connections</strong> represents the connections when the dimension are increased then it has to match the dimension of the output of convolutional layers.</p><p>When the dimensions increase (dotted line shortcuts ), we consider two options: <br> The first is that the shortcut still performs identity mapping, with extra zero entries padded for increasing dimensions. The second is that the projection shortcut is used to match dimensions (done by 1×1 convolutions). For both options, when the shortcuts go across feature maps of two sizes, they are performed with a stride of 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wcjJu9SY9HF8a4PJpv1RCA.png" /></figure><p>· Third set consists of 6 residual blocks where each residual blocks contains two convolutional layers . Each convolution layer has 256 filters of size 3x3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*asm-MxkG0-97NIV85dkfJw.png" /></figure><p>· The fourth set consists of 3 residual blocks where each residual blocks consists of 2 convolutional layers .Each convolutional layer contains 512 filters of 3x3 each.</p><p>· After that the feature map is passed through average pooling layer and then it is passes through dense layer containing 1000 neurons to classify 1000 classes.</p><h3><strong>Comparing The Performance of Plain Networks with residual networks</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0fbhcc6-asuGeA03H2NiA.png" /><figcaption>image from original paper-link-<a href="https://arxiv.org/pdf/1512.03385.pdf">https://arxiv.org/pdf/1512.03385.pdf</a></figcaption></figure><p>Above figure shows the training error and test error on CIFAR-10 with 20 layer and 56 layer plain network. We can observe from above that as we are increasing the number of layers both training and test error of 56 layered network are higher than the 20 layered network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*IQeAx3MclRLFWKdec2e1wA.png" /><figcaption>image from original paper-link-<a href="https://arxiv.org/pdf/1512.03385.pdf">https://arxiv.org/pdf/1512.03385.pdf</a></figcaption></figure><p>Above figure shows the training on Imagenet .Thick curves denotes validation error and thin curve denotes training error.Left figure is for plain network of 18 layers and 34 layers.<br> Right figure is for Residual Network for 18 layers and 34 layers. <br> For the plain networks the 34 layers has more training and validation error as compared to the 18 layered network.<br> Conversely for the Residual Network the training error and validation error are significantly less for 34 layered network as compared to 18 layered network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*qUX1R_uHwV1AnZuId7y6Ew.png" /></figure><h4><strong>Conclusion :</strong></h4><p>· Residual Networks offer several advantages including improved training of very deep networks,faster convergence and reduced model complexity.</p><p>· ResNets facilitates the training of deep neural network without suffering from degradation in performance which is the main issue in plain networks.</p><p>· The skip connections in ResNets allow the network to learn identity mappings making it easier for the model to learn the identity function when needed.</p><p>· Skip connections helps in optimization process which leads to faster convergence and less training time.</p><p>· The skip connections in the residual networks leads to better generalization on the unseen data as the network can skip unnnecesary or irrelevant information.</p><p>REsNets have consistently demonstrated state of the art performance on the various datasets and their flexibility have made them useful in various other task including object detection,segmentation .Because of these attributes they have been widely adopted for many deep learning<strong> </strong>task.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c792e6537a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Brief Overview Of ZFNet Architecture.]]></title>
            <link>https://medium.com/@ibtedaazeem/a-brief-overview-of-zfnet-architecture-c56aa015d20f?source=rss-f6f87d909679------2</link>
            <guid isPermaLink="false">https://medium.com/p/c56aa015d20f</guid>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Azeem - I]]></dc:creator>
            <pubDate>Thu, 09 Nov 2023 14:54:51 GMT</pubDate>
            <atom:updated>2023-11-09T14:54:51.261Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*ECaGUyArFKJlU_5MzcXHhw.png" /><figcaption>image generated with Microsoft Bing</figcaption></figure><p>To understand ZFNet First we have to take a look into what is Convolutional neural network and Imagenet.<br> A <strong>convolutional neural network </strong>is a special kind of multi neural network designed to extract visual patterns from a given image. Since images are formed of pixels so a convolutional neural network tries to capture the important pixels values by a process known as convolution.</p><p><strong>ImageNet Project</strong> is a large database designed for use in visual object recognition software research.<br> The ImageNet Project runs an annual competition ImageNet Large Scale Visual Recognition Challenge (ILSVRC ) where software programs compete to correctly classify the objects and scenes.</p><p>It is imperative to know about <strong>AlexNet </strong>before coming to ZFNet. AlexNet was primarily designed by Alex Krishevsky. It was published with Ilya Sutskever and Geoffry Hinton.It won first place in ImageNet large Scale Visual recognition Challenge in 2012 by achieving error of 15.3%.This was 10.8% lower than that of runner up. AlexNet was considered as a massive jump in the accuracy of neural networks.</p><h3><strong>ZFNet</strong></h3><p>Rob Fergus and Matthew D.Zeiler introduced ZFNet. ZFNet is named after their surname Zeiler and Fergus. ZFNet was a slight improvement over AlexNet .The 2013 ILSVRC was won by ZFNet.It actually visualized how each layer of AlexNet performs and what parameters can be tuned to achieve greater accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*49_vJ62vKLLL9FiN6xS9Pg.png" /><figcaption>image from original paper-<a href="https://arxiv.org/pdf/1311.2901.pdf">https://arxiv.org/pdf/1311.2901.pdf</a></figcaption></figure><p><strong>Some Key Features of ZFNet architecture</strong></p><p>· <strong>Convolutional layers:<br> </strong>In these layers convolutional filters are applied to extract important features,ZFNet consists of multiple convolutional layers to extract important features.</p><p>· <strong>MaxPooling Layers:</strong></p><p>MaxPooling Layers are used to downsample the spatial dimensions of feature map in.It consist of aggregation function known as maxima.</p><p>· <strong>Rectified Linear Unit:</strong></p><p>Relu is used after each convolution layer to introduce non linearity into the model which is crucial for learning complex patterns. It rectifies the feature map ensuring the feature maps are always positive.</p><p>· <strong>Fully Connected Layers:</strong></p><p>In the latter part of ZFNet architecture fully connected dense layers are used to extract patterns from features .The activation function used in the neurons is relu.</p><p>· <strong>SoftMax Activation:</strong></p><p>SoftMax activation is used in the last layer to obtain the probabilities of the image belonging to the 1000 classes.</p><p>· <strong>Deconvolution Layers:</strong>ZFNet introduced a visualization technique involving deconvolutional layers(Transposed Layers) .These layers provide insights into what network has learned by projecting feature activations back into input pixel space.</p><h3><strong>Architecture</strong>:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOUT7XvMctngGQwCHu_woA.png" /><figcaption>ZFNet Architecture (image by me)</figcaption></figure><p><strong>Input</strong></p><p>· The input image is of size 224x224x3.</p><p><strong>First Layer</strong></p><p>· In the first layer 96 filters of size 7x7 and stride of 2 are used to convolve followed by relu activation.<br> The output feature map is then passed through Max Pooling Layer with pool kernel of 3x3 and stride of 2 .Then the features are contrast normalized.</p><p><strong>Second layer</strong></p><p>· In the second layer 256 filters are applied of size 3x3 with stride of 2. Again the obtained feature map is passed through MaxPooling layer with pooling kernel of 3x3 with stride of 2.After that features are contrast normalized.</p><p><strong>Third layer and Fourth Layer</strong></p><p>· The third and fourth layers are identical with 384 kernels of size 3x3 and padding is kept as same and stride is set to 1.</p><p><strong>Fifth Layer</strong></p><p>· In the fifth layer 256 filters of size 3x3 are applied with stride 1. After then the MaxPooling kernel of size 3x3 is applied with stride of 2 .Then the features are contrast normalized.</p><p><strong>Sixth Layer and Seventh Layer</strong></p><p>· The sixth and seventh layers are fully connected dense layers with 4096 neurons each.</p><p><strong>Eighth Layer</strong></p><p>· The last layer is dense layer with 1000 neurons(number of classes).</p><h3><strong>Differences Between AlexNet and ZFNet</strong></h3><p><strong>Architecture</strong></p><p>· AlexNet consists of eight layers, five convolutional layers followed by three fully connected layers. ZFNet retained basic architecture of AlexNet but made some architectural adjustments,particularly in the first few layers.</p><p><strong>Filters</strong></p><p>· AlexNet used 11x11,5x5 and 3x3 filter sizes while ZFNet used 7x7 filter size in the first layer only and 3x3 in the latter layers only.</p><p><strong>Strides</strong></p><p>· There is stride of 4 in the first layer of AlexNet while in ZFNet there is stride of 2 used.</p><p><strong>Normalization</strong></p><p>· AlexNet used Local Response Normalization while ZFNet used Local Contrast Normalization</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c56aa015d20f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Loss functions in Deep Learning]]></title>
            <link>https://medium.com/@ibtedaazeem/loss-functions-in-deep-learning-e4bd353ea08a?source=rss-f6f87d909679------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4bd353ea08a</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Azeem - I]]></dc:creator>
            <pubDate>Wed, 11 Oct 2023 01:24:39 GMT</pubDate>
            <atom:updated>2024-10-02T11:53:28.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qdzPWPN-UcDwIIK1C66l1w.png" /><figcaption>&lt;a href=”<a href="https://www.freepik.com/free-ai-image/glowing-circuit-board-complex-technology-inside-modern-computer-generated-by-ai_42191800.htm#fromView=search&amp;term=loss+functions+in+deep+learning&amp;page=1&amp;position=0&amp;track=ais_ai_generated&amp;regularType=ai">https://www.freepik.com/free-ai-image/glowing-circuit-board-complex-technology-inside-modern-computer-generated-by-ai_42191800.htm#fromView=search&amp;term=loss+functions+in+deep+learning&amp;page=1&amp;position=0&amp;track=ais_ai_generated&amp;regularType=ai</a>&quot;&gt;Image By vecstock&lt;/a&gt;</figcaption></figure><p><strong>What is loss function? <br> </strong>The loss function is the core of machine learning and deep learning.By the name of it we can surmise that it is related to some difference .This difference is the error produced by model when comparing the predicted value by the model with the original value given in the dataset.</p><p>Loss/Error = Actual_value — Predicted_value</p><p><strong>What is the need of loss function?</strong></p><p>Loss function is a method with which we can evaluate or measure how our model is working.<br> Loss function also known as cost function is a mathematical function which is used to evaluate how well our algorithm is modelling the dataset. It is the function of the parameters of the algorithm.</p><p>If the value of the loss function is lower then our model is working well otherwise we have to change the parameter of the model to reduce or minimize the loss. It guides the learning algorithm in adjusting the model’s parameter i.e weights and biases during the training time.</p><p><strong>What is cost function and how it is different from loss function?<br> </strong>Sometimes we get confused between the loss function and the cost function because these are more often used interchangeably. When we calculate loss over a single training datapoint it is often referred to as loss function .However when we calculate loss over the entire or batch of training data point it is known as cost functio</p><p><strong>Losses for different task in Deep Learning</strong></p><p>In Deep Learning, the choice of loss function is crucial for training a model. Different types of tasks(classification, regression, etc) require different loss functions.</p><p>If the value that we have to predict is a continuous numerical value then the task we are going to perform is the regression task .If the value to be predicted is discrete then the task is going to be classification.</p><p>Here are some common types of losses used in deep learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9ZlaHamgJaSO3zgTCUCWg.png" /><figcaption>commonly used loss functions for different tasks</figcaption></figure><h3>Regression Losses</h3><p><strong>Note:</strong> In the regression task the activation function in the output layer should be an<strong> Identity Function</strong>. Identity Function is a linear function which gives the output same as the input passed to this activation function.</p><p><strong>i.e I(x)=x</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlbzzmhlDHz5xn03-ilrbQ.png" /><figcaption>Multi Layered Neural Network for Regression Task</figcaption></figure><h3><strong>Mean Squared Error</strong></h3><p>Mean squared loss function is the most popular loss function which is used to calculate the difference between the actual value and the predicted value. Here we just square the difference of the actual and predicted value and take the mean of it.</p><h4>MSE or Cost Function = (1/n) * Σ(y_actual - y_predicted)²</h4><h4>Loss Function for single data point = (y _actual-y_predicted)²</h4><p><strong>Advantages of MSE:</strong></p><p>· Fairly simple and easy to calculate</p><p>· We get the quadratic equation of polynomial degree 2 for which we can find derivative while updating weights during back propogation.</p><p><strong>Disadvantage of MSE:</strong></p><p>· It is affected by outliers.</p><p>· We cannot use MSE to interpret or compare directly with actual value.</p><h3><strong>Mean Absolute Error</strong></h3><p>Mean Absolute Error is the mean of the absolute difference between the actual and predicted value.</p><h4>MAE = (1/n) * Σ|y_actual — y_predicted|</h4><p><strong>Advantages:</strong></p><p>· It is not affected by outliers.</p><p>· This loss function can be used to interpret actual value.</p><p><strong>Disadvantages:</strong></p><p>· Graph, not differential. we can not use gradient descent directly, then we can apply Subgrad to overcome discontinuity.</p><h3><strong>Huber loss</strong></h3><p>Huber loss combines both MSE and MAE .It behaves like MSE for small deviations from original value and for large deviations from original value it behaves like MAE.</p><h4>Huber Loss = (1/n) * Σ(1/2* (y_actual — y_predicted)²</h4><h4>if | y_actual — y_predicetd | &lt;= δ</h4><h4>else 1/n * Σ δ * (|y_actual — y_predicted | — (1/2* δ))</h4><p>Huber Loss is mainly used when there are more number of outliers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*zShX-zWLWQCzDvhw3ciTlA.png" /><figcaption>Outliers and its affect on various losses</figcaption></figure><h3><strong>Classification Losses</strong></h3><p>Now take a look some of the loss functions used in classification tasks.</p><h3><strong>Binary cross entropy</strong></h3><p>We use this loss function when we have a binary classification task that is we have to predict the datapoint belonging to either of the two classes.</p><p>Binary cross entropy compares each of the predicted probabilities to the actual class output which can be either 0 or 1. It then calculates the score that penalizes the probabilities based on the distance from the expected value. That means how close or far from the actual value.</p><p>The activation function always gives the probability of the datapoint belonging to positive class or label 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3hyqStZS-9nA_mSGW4oAtA.png" /><figcaption>Multi layered Neural Network for Binary classification</figcaption></figure><h4>Loss=-y_actuallog(y_predicted) — (1- y_actual)log(1-y_predicted)</h4><h4>Cost function=-1/n(∑((y_actuallog(ypredicted) + (1- y_actual)log(1-y_predicted))</h4><p>n is the number of training data points.</p><h3><strong>Categorical Cross Entropy</strong></h3><p>Whenever we have to perform Multiclass classification we use Categorical Cross entropy or Multi logloss to evaluate our model.In Categorical Cross Entropy Loss,the predicted output of the model should be a probability distribution which means that the outputs should be non negative and sums upto 1.This can be achieved using activation functions like the softmax function in the output layer of neural network.</p><p><strong>Note</strong> : The number of neurons in the output layer should be same as the number of classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JB3yNjm5soKEuf-mZfRSpw.png" /><figcaption>Multi layered Neural Network for Multi-class Classification</figcaption></figure><p>Softmax activation function=modification of sigmoid function</p><p><strong>Softmax=ezi/(∑ezi) </strong>,where i goes from 1 to kth class</p><p>Where z is the dot product of the previous input layer.</p><p>Whenever we are using categorical cross entropy we should perform one hot encoding transformation on the actual values.</p><h4>Loss= -∑ki=1 y_actual *log(y_predicted) ,where k is the kth class</h4><h4>Cost function== -∑ ∑ y_actual *log(y_predicted),</h4><p>where outer sum goes from 1 to n datapoints and inner sum goes from 1 to kth class.</p><h3><strong>Sparse Categorical Cross Entropy</strong></h3><p>Sparse categorical cross entropy loss function is similar to categorical entropy loss.For Sparse categorical cross entropy loss function we need not transform the target feature to numerical one hot encoded feature.It works on integer label encoded feature.</p><p>It is used when we have large number of classes and one hot encoding becomes impractical in terms of memory usage.</p><h4>Loss= -∑ y_actual*log(y_predicted)</h4><h4>Cost function== -∑ ∑ y_actual*log(y_predicted)</h4><p>where outer sum goes from 1 to n datapoints and inner sum goes from 1 to kth class.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4bd353ea08a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Artificial Intelligence,Deep learning and MCP neuron]]></title>
            <link>https://medium.com/@ibtedaazeem/introduction-to-artificial-intelligence-deep-learning-and-mcp-neuron-f44cc8a2b8ed?source=rss-f6f87d909679------2</link>
            <guid isPermaLink="false">https://medium.com/p/f44cc8a2b8ed</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Azeem - I]]></dc:creator>
            <pubDate>Thu, 21 Sep 2023 03:44:33 GMT</pubDate>
            <atom:updated>2023-09-21T03:44:33.834Z</atom:updated>
            <content:encoded><![CDATA[<h3>Artificial Intelligence</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RfSNJKfJl5kvw4TCbgCToA.png" /></figure><p>In today’s advance developing world we can see the rise in popularity of fancy terms like Artificial Intelligence,Machine Learning,Deep Learning.What do these even mean?<br> Let’us take a closer look into it as why it is garnering so much of attention.</p><p><strong>Artificial Intelligence</strong>: Artificial Intelligence refers to the science of developing machines that can imitate human intelligence.Humans have sensory organs like skin,tongue,eye,nose,tongue and skin.Whenever we see an object we are able to easily identifying what it is based on the previous experience of seeing that object.Similarly we can feel whether something is cold or hot when it comes in contact with our skin.When we listen to someone speaking we are able to comprehend and revert back .All these are examples of Human intelligence.<br> Artificial Intelligence works on the same principle .Artificial Intelligence combines computer science and datasets to enable the machine to mimic human behavior.<br> To learn a new language with new script we have to memorize the alphabets by practicing the alphabets of the language by repeatedly looking at it .A memory in our brain is created for a particular alphabet,so when we encounter that again we are able to easily recognize it.<br> Like this only we can provide dataset to machine and make that to learn from it using simpler or complicated algorithms.</p><h3><strong>Machine Learning and Deep Learning</strong></h3><p>Machine Learning and Deep learning both comes under realm of Artificial Intelligence .Machine Learning is important in achieving the aim of Artificial intelligence that is to mimic Human intelligence .Machine Learning can be thought of as a process of making machines learn from historical data,extracting valuable insights and patterns existing within data, predicting values and grouping of data.</p><p>Deep learning is similar to Machine learning in terms of objective.It is a subset of Machine learning. Deep Learning employs complex algorithms and deep neural networks models to solve complicated problems .Deep learning adds more layers of learning from data .These layers have somewhat similar functionality as neurons in human.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W3u2jDLzNlP096R39GKHGg.png" /></figure><p><strong><em>Differences between machine Learning and Deep learning</em></strong></p><p>· <strong>Technique applied</strong>: Machine learning makes use of statistical techniques to perform predictions and make decisions while Deep learning rely on logical structure,complex neural networks to process data.</p><p>· <strong>Feature extraction</strong>: In Machine Learning Feature extraction requires human effort also to select relevant features apart from Machine Learning operations while Deep learning algorithms have automatic feature extraction capabilities that takes only the vital features from the data.</p><p>· <strong>Training period</strong>: Machine learning Models have shorter training time while deep Learning models often require large training time because of their complex architecture.</p><p>· <strong>Data size</strong>: Machine Learning models can work both on large and small data but deep Learning models require vast amount of data .If we increase the size of data the performance of Machine Learning Models increases but after some point even if we increase the size of the data the performance of machine learning models will remain same.<br> There is total different scenario in case of Deep learning models. If we increase the size of data the performance of Deep learning Models goes on increasing.</p><p><strong>· Hardware Requirements</strong>: Machine Learning Models can run smoothly on low performance CPUs while Deep learning Models require high performance CPUs and GPUs .</p><p><strong>· Interpretability</strong>: Machine Learning Models rely on simple algorithms hence they are interpretable which means we can find how a particular output is generated given a set of some inputs .Deep Learning involves complicated architecture and intricate neural networks so the complete model is like a black box which is less interpretable.</p><p>Whether to choose Machine learning or Deep learning approach depends completely on the type of problem we are trying to solve. Machine Learning Models are great with data that are in tabular format like .csv,.xlxs,.json.<br> When we have unstructured data like text,images,audios and videos Deep learning Models produce accurate insights and predictions .They can recognize complex patterns in images,sounds ,text etc which is impossible do manually.</p><h3><strong>Brief History of Deep learning</strong></h3><p>· The history of deep learning dates back to <strong>1943 when Warren McCulloch and Walter Pitt </strong>introduced the concept of <strong>artificial neurons</strong> which were based on biological neurons.They introduced the simplified version of how a biological neuron works which laid the foundation for artificial neural networks.</p><p>· <strong>In 1957 Frank Rosenblatt </strong>created <strong>Perceptron neuron </strong>which was also a simplified version of biological neuron,It gained popularity for its ability to learn simple task.</p><p>· The decade of <strong>1970s -1980 </strong>marks the <strong>First AI winter </strong>as many drawbacks of simple biological neuron came into picture.</p><p>· In<strong> 1986 Geoffery Hinton</strong> introduced the<strong> back propagation algorithm</strong> which marks a significant advancement in deep learning approach. <strong>Geoffery Hinton is often regarded as Father of Deep Learning.</strong></p><p>· Due to lack of computational resources and insufficient data the deep learning saw a period of stagnation in <strong>1990s </strong>often referred as <strong>second AI winter.</strong></p><p>· In <strong>2006 Geoffery Hinton and his team</strong> introduced <strong>Modern deep learning techniques</strong> that marks the resurgence of interest in Deep Learning.</p><p>· In <strong>2012 </strong>during the <strong>ImageNet large scale Visual recognition challenge </strong>the team of<strong> AlexKrizhevsky,Ilya Sutskever and Geoffery Hinton</strong> demonstrated the power of deep learning in <strong>computer vision tasks .</strong></p><p>· In <strong>2015 RNN(recurrent neural network )</strong> and <strong>(LSTMs) </strong>made significant development in the field of natural language processing that included machine translation and text generation.</p><p>Research in deep learning is still going on .Deep learning has found many applications in fields like healthcare,finance and has revolutioned fields such as computer vision,natural language processing and speech recognition.It continues to be the major driving force in the field of Artificial intelligence</p><h3><strong>MCP Neuron</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ckP-lUQC0oSrbyJZo-dSPQ.png" /></figure><p>The MCP neuron was proposed by Warren McCulloh and Walter pitts in 1943.This model was inspired by the biological neuron or we can say that it was a simplified version of biological neuron.This model laid the foundation for development of more complex artificial neural networks.To understand the MCP neuron let us first take a look at biological neuron.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pL9uaHe3PHmctez1dNQ2AQ.png" /><figcaption>image from wikipedia</figcaption></figure><p>A biological neuron is the fundamental building block of the nervous system that transmits information in the form of electrical signals.<br> Here is a brief explanation of the structure of neuron.</p><p><strong>· Soma(cell body)</strong>: It is the central part of neuron that contains nucleus which conatains the DNA of the cell.This part is responsible for processing the information.</p><p><strong>· Dendrites</strong>:These are the extensions that come off the cell body.Dendrites receive signals(in the form of neurotransmitters) from other neurons or sensory receptors.They convey these signals to the cell body.</p><p><strong>· Axon:</strong>This is a part of neuron that carries signals away from the cell body.</p><p><strong>· Synapse</strong>:This is the junction where the axon terminal of one neuron meets the dendrites of another neuron.</p><p><strong><em>Just like biological neuron the MCP neuron processes inputs in binary format similar to electrochemical signal in the brain</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*UivGOxqA6TcNy02gwty1fA.png" /><figcaption>image from wikipedia</figcaption></figure><h4><strong>Major Components of MCP neuron</strong></h4><p><strong>· Soma processing</strong>:The soma of the neuron processes incoming binary inputs from dendrites.</p><p><strong>· Activation function:</strong>Processed inputs are then passes through an activation function which acts as the decision .This function provides a binary output of either 0 or 1.</p><p><strong>· Equal Feature Importance:</strong>In the MCP neuron model all the features are having equal importance i.e equal weightage is given to each feature.</p><p><strong>· Threshold Value</strong>: The neuron takes the threshold value into consideration and makes decision by comparing the sum of weighted inputs with the threshold value.</p><h4><strong>Activation Function in MCP neuron:</strong></h4><p>The most common activation functions in the MCP neuron are the AND and OR function.</p><p>· AND activation function: This function gives the output as 1 only if all the inputs are 1 otherwise it will give output as 0.</p><p>· OR activation function: This function gives the output as 1 if at least one of the inputs is 1 .If all the inputs are 0 then only it will give zero.</p><h4><strong>MCP Neuron Limitations:</strong></h4><p>· MCP neurons works only for linearly separable data.It is not suitable for handling complex,non-linear relationships in data.</p><p>· The Model works only with binary inputs.</p><p>· The threshold value must be manually set which can limit its working for complex datasets.</p><p>· All the features are given equal importance which is not possible in real life scenarios as each of the features can have different impact on the output.</p><p>In Conclusion we can say that MCP neuron was the fundamental concept in the history of neural network development and laid the groundwork for more sophisticated artificial neural networks such as perceptron and later deep learning models.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f44cc8a2b8ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>