<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-2000632512313948863</atom:id><lastBuildDate>Wed, 10 Jun 2026 04:07:24 +0000</lastBuildDate><category>Databases</category><category>Neural Networks</category><category>Software Engineering</category><category>Machine Learning</category><category>Web Technologies</category><category>Deep Learning</category><category>Artificial Intelligence</category><category>Relational Database</category><category>Software Architecture</category><category>MySQL</category><category>Agile</category><category>Glossary</category><category>Terms</category><category>C++</category><category>Classes</category><category>Database</category><category>Graphics</category><category>Hardware</category><category>Java/J2EE</category><category>NLP</category><category>RDBMS</category><category>Relational Algebra</category><category>SOAP</category><category>Services</category><category>Transformers</category><category>UDDI</category><category>WSDL</category><category>XP</category><category>programming</category><category>AI</category><category>Abstract Factory</category><category>Abstraction</category><category>Apache</category><category>Architecture</category><category>Builder</category><category>CNN</category><category>Codd&#39;s Rules</category><category>Computer Graphics</category><category>Computer Science</category><category>Creational Patterns</category><category>Data Models</category><category>Design Patterns</category><category>GUI</category><category>HLA</category><category>LLM</category><category>Large Language Models</category><category>Natural Language Processing</category><category>ORDBMS</category><category>Object Oriented Analysis and Design</category><category>Object Oriented Paradigm</category><category>Operating Systems</category><category>PHP</category><category>Platform independent</category><category>Prototype</category><category>Qt</category><category>RUP</category><category>Scrum</category><category>Singleton</category><category>Software Development Methodology</category><category>Software Quality</category><category>Use Case Analysis</category><category>WAMP</category><category>Web Services</category><category>XML</category><category>phpMyAdmin</category><category>phptriad</category><category>4+1 Philip Krutchen</category><category>AI Applications</category><category>AI Language Models</category><category>AI Models</category><category>AI Tutorial</category><category>AIModels</category><category>AOP</category><category>API</category><category>ASD</category><category>Activation Function</category><category>Activation Functions</category><category>Adapter</category><category>Adversarial</category><category>Agile Manifesto</category><category>Agile Principles</category><category>Analytics</category><category>Andriy Luntovskyy</category><category>Animation</category><category>Application</category><category>Applications of Deep Learning</category><category>Architectural Design Decisions</category><category>Architectural Styles</category><category>Architectural Views</category><category>Artifical Intelligence</category><category>ArtificialIntelligence</category><category>AspectJ</category><category>Association</category><category>Attribute</category><category>Authentication</category><category>Auto Encoders</category><category>BERT Explained</category><category>Backpropagation</category><category>Beamer</category><category>Behavioural Patterns</category><category>Blockchain</category><category>Boundary</category><category>Bridge</category><category>CMMI</category><category>CMS</category><category>CMainFrame</category><category>CView</category><category>Call to Action</category><category>Challenges</category><category>Change Management</category><category>ChatGPT</category><category>ChatGPT Architecture</category><category>Clear Objective</category><category>Communication Management</category><category>Component Communication</category><category>Composite</category><category>ComputerVision</category><category>Concise</category><category>Control</category><category>Convolutional</category><category>ConvolutionalNeuralNetwork</category><category>Copywriting</category><category>Cross cutting concerns</category><category>Cybersecurity</category><category>DAS</category><category>DBMS</category><category>DIP</category><category>DSDM</category><category>Data Science</category><category>Datawarehouse</category><category>Decorator</category><category>DeepLearning</category><category>Denial of Service</category><category>Dietbert Gütter</category><category>Digital Marketing</category><category>DirectX</category><category>Documentation</category><category>Dropout Rate</category><category>Energy Efficiency</category><category>Entity</category><category>Evolutionary Algorithms</category><category>Extreme Programming</category><category>FDD</category><category>Factory Method</category><category>FeatureExtraction</category><category>Forget Gate</category><category>Future Technologies</category><category>Fuzzy Logic</category><category>GAN</category><category>GELU</category><category>GPT</category><category>GPT Explained</category><category>Game Engines</category><category>Gaming Consoles</category><category>Generative</category><category>Generative AI</category><category>Generative AI Guide</category><category>Generators</category><category>Google Talk</category><category>Gradient</category><category>Graphics Card</category><category>Graphics Engines</category><category>HR</category><category>HTML</category><category>HTTP</category><category>Hierarchical</category><category>Highly Distributed Systems</category><category>History of Computers</category><category>Hyperparameters of Neural Networks</category><category>IEEE 1471-2000</category><category>ISO 15504</category><category>ISP</category><category>ImageProcessing</category><category>ImageRecognition</category><category>Industry 5.0</category><category>Input Gate</category><category>Interface Segregation</category><category>IoT</category><category>JDBC</category><category>Join operation</category><category>Kanban</category><category>Kazman</category><category>LSP</category><category>LSTM</category><category>LSTM Architecture</category><category>LSTM Gates</category><category>LSTM Tutorial</category><category>Language Models</category><category>Latex</category><category>Lean</category><category>Learning Rate</category><category>Linear</category><category>Liskov substitution</category><category>Long Short Term Memory</category><category>Long Short-Term Memory</category><category>Loss</category><category>Loss Function</category><category>MFC</category><category>MachineLearning</category><category>Macine Learning</category><category>Malware</category><category>Manifesto</category><category>Mechanisms</category><category>Methodologies</category><category>Middleware</category><category>MikTex</category><category>Mobile Apps</category><category>Model</category><category>Motherboard</category><category>NAS</category><category>NLP Deep Learning</category><category>NTSC</category><category>National Programme on AI</category><category>Network</category><category>Network Security</category><category>Neural Networks Architecture</category><category>Neural Networks Terms Explained</category><category>NeuralNetworks</category><category>Nokia</category><category>Non-Functional Requirements</category><category>Normal Forms</category><category>Normalization</category><category>Number of Layers</category><category>Number of Neurons per Layer</category><category>OCP</category><category>OLAP</category><category>OLTP</category><category>OODBMS</category><category>OOP</category><category>OR Gate</category><category>ObjectDetection</category><category>Open Closed</category><category>OpenGL</category><category>Opportunities</category><category>Optimizer</category><category>Output Gate</category><category>PAL</category><category>PAUL</category><category>PMBOK</category><category>PMI</category><category>PMP</category><category>Persuasive  Language</category><category>PhD</category><category>Pitch RTI</category><category>Poka Yoke</category><category>Pretrained</category><category>Principles</category><category>Probabilistic Reasoning</category><category>Process Capability</category><category>Process Maturity</category><category>Product Management</category><category>Project Management</category><category>Project Planning</category><category>Prompt Engineering</category><category>Proofreading</category><category>Properties of Light.</category><category>Quality</category><category>RAD</category><category>RAG</category><category>RC</category><category>RNN</category><category>RNN vs LSTM</category><category>RUP Version</category><category>Radiosity</category><category>Ray Tracing</category><category>ReLU</category><category>Recurrent</category><category>Regularization Parameters</category><category>Relational</category><category>Relational Operations</category><category>Release Candidate</category><category>Rendering</category><category>Required functionality</category><category>Resolution</category><category>Resource Management</category><category>Retrieval Augmented Generation</category><category>Risk Management</category><category>Robotics</category><category>SAN</category><category>SEI Views</category><category>SOLID Principles</category><category>SRP</category><category>SaaS</category><category>Security</category><category>Self Attention Mechanism</category><category>Sequence Models</category><category>Shaw and Mary</category><category>Sigmoid</category><category>Simple Neural Networks</category><category>Single Responsibility</category><category>Socio-Economic impact</category><category>Soft Computing</category><category>Softmax</category><category>Software Development</category><category>Software Project Management</category><category>Software Structure</category><category>Strong Headline</category><category>Structural Patterns</category><category>Swing</category><category>Tensorflow</category><category>TexLive</category><category>TexWorks</category><category>Text Generation</category><category>Time Series</category><category>Tokenization</category><category>Transformer Models</category><category>Trolltech</category><category>UI/UX Design</category><category>VC++</category><category>Visualization</category><category>Weight Initialization</category><category>Weights Adjustment</category><category>Windows 10</category><category>Word Embeddings</category><category>Word2Vec</category><category>Working of Neural Networks</category><category>Workstations</category><category>access modifiers</category><category>adjourning</category><category>agriculture</category><category>applications</category><category>availability</category><category>call and return</category><category>client-server</category><category>cloud computing</category><category>coaching</category><category>cobots</category><category>collaboration</category><category>confidentiality</category><category>conflict</category><category>culture</category><category>data analytics</category><category>data centred</category><category>data flow</category><category>dependency inversion</category><category>difference from DBMS</category><category>embedded</category><category>encapsulation</category><category>ethical use</category><category>features</category><category>file oriented approach</category><category>focus on benefits</category><category>forming</category><category>healthcare</category><category>information</category><category>information  security</category><category>inheritance</category><category>integrity</category><category>interview questions</category><category>layered</category><category>leadership</category><category>learning</category><category>machine and deep learning paradigm</category><category>management</category><category>manufacturing</category><category>modularity</category><category>most important terms in deep learning</category><category>norming</category><category>object orientation</category><category>object-oriented</category><category>objects</category><category>peer-to-peer</category><category>performing</category><category>polymorphism</category><category>productivity</category><category>project</category><category>purpose</category><category>relational calculus</category><category>reuse</category><category>schema</category><category>smart networks</category><category>storming</category><category>target audience</category><category>teamstages</category><category>teamwork</category><category>tiered</category><category>trust</category><category>trust factors</category><title>Computer Science Notes</title><description></description><link>http://computer-science-notes.blogspot.com/</link><managingEditor>noreply@blogger.com (ITMastersPro)</managingEditor><generator>Blogger</generator><openSearch:totalResults>125</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-297493678518609100</guid><pubDate>Wed, 10 Jun 2026 04:07:24 +0000</pubDate><atom:updated>2026-06-09T21:07:24.820-07:00</atom:updated><title>AI Will Not Replace You, But Someone Using AI Might: The Ultimate Career Survival Guide for the AI Age</title><description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Introduction: The New Reality of Work&lt;/h2&gt;&lt;p&gt;Artificial Intelligence is no longer a futuristic concept confined to science fiction. It has entered boardrooms, offices, factories, creative studios, and everyday workflows. From automating repetitive tasks to assisting with complex decision-making, AI is reshaping the way we work.&lt;/p&gt;&lt;p&gt;The biggest career question today is not:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&quot;Will AI take my job?&quot;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The more important question is:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&quot;How can I evolve so that I remain valuable in an AI-driven world?&quot;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The future will not belong only to those with technical skills. It will belong to those who can combine human intelligence with artificial intelligence.&lt;/p&gt;&lt;h2&gt;The AI Revolution: A Career Disruption or an Opportunity?&lt;/h2&gt;&lt;p&gt;Every major technological shift in history has changed the nature of work. The industrial revolution replaced manual processes with machines. The internet transformed communication and business. AI is now transforming knowledge work.&lt;/p&gt;&lt;p&gt;Many tasks that once required hours can now be completed in minutes:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Data analysis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Content creation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Research&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Customer support&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Coding assistance&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Administrative work&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Market insights&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;However, AI still struggles with qualities that define human excellence:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Emotional intelligence&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Creativity&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Ethical judgment&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Leadership&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Strategic thinking&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Relationship building&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The professionals who survive and grow will not compete with AI — they will learn to collaborate with it.&lt;/p&gt;&lt;h2&gt;1. Become AI-Literate: The New Workplace Superpower&lt;/h2&gt;&lt;p&gt;You do not need to become a machine learning engineer to benefit from AI.&lt;/p&gt;&lt;p&gt;Every professional should understand:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;How AI tools work&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;How to write effective prompts&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;How to verify AI-generated information&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;How to integrate AI into daily workflows&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;AI literacy will soon become as important as computer literacy became decades ago.&lt;/p&gt;&lt;p&gt;A person who knows how to use AI effectively can outperform someone who refuses to adapt.&lt;/p&gt;&lt;h2&gt;2. Shift From Task-Based Skills to Problem-Solving Skills&lt;/h2&gt;&lt;p&gt;In the past, careers were built around performing specific tasks.&lt;/p&gt;&lt;p&gt;The AI age rewards people who can solve meaningful problems.&lt;/p&gt;&lt;p&gt;Instead of asking:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&quot;What task do I perform?&quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Ask:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&quot;What problem do I solve?&quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;A marketer is not just someone who creates campaigns; they understand customer psychology.&lt;/p&gt;&lt;p&gt;A salesperson is not just someone who closes deals; they build trust and influence decisions.&lt;/p&gt;&lt;p&gt;A manager is not just someone who monitors work; they create clarity and direction.&lt;/p&gt;&lt;p&gt;The deeper your understanding of problems, the harder you are to replace.&lt;/p&gt;&lt;h2&gt;3. Build the Skills AI Cannot Easily Copy&lt;/h2&gt;&lt;p&gt;The future belongs to professionals who strengthen their uniquely human abilities.&lt;/p&gt;&lt;h3&gt;Emotional Intelligence&lt;/h3&gt;&lt;p&gt;AI can analyze conversations, but humans create genuine connections.&lt;/p&gt;&lt;p&gt;People who can communicate, negotiate, inspire, and empathize will remain highly valuable.&lt;/p&gt;&lt;h3&gt;Creativity&lt;/h3&gt;&lt;p&gt;AI can generate ideas, but human creativity provides purpose, originality, and cultural understanding.&lt;/p&gt;&lt;h3&gt;Critical Thinking&lt;/h3&gt;&lt;p&gt;AI can provide answers, but humans must decide:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Is this answer correct?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Is this the right decision?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;What are the consequences?&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Leadership&lt;/h3&gt;&lt;p&gt;The ability to guide people through uncertainty will always be a powerful career asset.&lt;/p&gt;&lt;h2&gt;4. Become a Lifelong Learner&lt;/h2&gt;&lt;p&gt;The biggest career risk in the AI age is not lack of talent.&lt;/p&gt;&lt;p&gt;It is becoming outdated.&lt;/p&gt;&lt;p&gt;The half-life of skills is shrinking. What you learned five years ago may not be enough for tomorrow&#39;s workplace.&lt;/p&gt;&lt;p&gt;Successful professionals will adopt a continuous learning mindset:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Learn new AI tools&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Follow industry trends&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Take online courses&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Experiment with new technologies&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Upgrade existing skills&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Your career is no longer a fixed destination. It is an evolving journey.&lt;/p&gt;&lt;h2&gt;5. Create Your Personal Brand&lt;/h2&gt;&lt;p&gt;In an AI-driven world, visibility matters.&lt;/p&gt;&lt;p&gt;Thousands of professionals may have similar qualifications, but those who build trust and authority stand out.&lt;/p&gt;&lt;p&gt;Start sharing:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Your knowledge&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Your insights&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Your experiences&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Your unique perspective&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A strong personal brand makes you memorable in a crowded marketplace.&lt;/p&gt;&lt;h2&gt;6. Develop the Human-AI Partnership Mindset&lt;/h2&gt;&lt;p&gt;The winning mindset is not:&lt;/p&gt;&lt;p&gt;&quot;AI versus humans.&quot;&lt;/p&gt;&lt;p&gt;It is:&lt;/p&gt;&lt;p&gt;&quot;AI with humans.&quot;&lt;/p&gt;&lt;p&gt;The best professionals will know when to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Let AI handle speed and automation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Use human judgment for decisions&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Combine data with intuition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Balance efficiency with empathy&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;AI is a tool. Your ability to use it wisely is the real advantage.&lt;/p&gt;&lt;h2&gt;The Future Career Formula&lt;/h2&gt;&lt;p&gt;The professionals who thrive in the AI age will combine:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Technical Awareness + Human Skills + Adaptability + Continuous Learning&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The future workplace will not ask only:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&quot;What degree do you have?&quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;It will ask:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&quot;How quickly can you learn, adapt, and create value?&quot;&lt;/em&gt;&lt;/p&gt;&lt;h2&gt;Conclusion: Adapt or Become Invisible&lt;/h2&gt;&lt;p&gt;The AI age is not the end of human careers. It is the beginning of a new definition of success.&lt;/p&gt;&lt;p&gt;Those who resist change may struggle. Those who embrace learning will discover new opportunities.&lt;/p&gt;&lt;p&gt;The goal is not to beat AI.&lt;/p&gt;&lt;p&gt;The goal is to become the kind of professional who becomes more powerful with AI.&lt;/p&gt;&lt;p&gt;Because the future does not belong to humans or machines alone.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;It belongs to humans who know how to work with machines.&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/06/ai-will-not-replace-you-but-someone.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-2529656727193666742</guid><pubDate>Fri, 05 Jun 2026 05:18:28 +0000</pubDate><atom:updated>2026-06-04T22:18:28.878-07:00</atom:updated><title>The Dubai Real Estate Deal That Almost Closed… But Didn’t: Why Agents Lose Deals at the Final Moment and How to Fix It</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h1&gt;The Deal Slipped Away Again: The Hidden Mistakes Dubai Real Estate Agents Make in a Down Market&lt;/h1&gt;&lt;p&gt;The property market in Dubai has always rewarded aggressive, smart, and emotionally intelligent real estate professionals. But when the market slows down, something painful happens — deals that looked certain suddenly disappear.&lt;/p&gt;&lt;p&gt;The client visited the property.&lt;br /&gt;The negotiation happened.&lt;br /&gt;The paperwork was almost ready.&lt;/p&gt;&lt;p&gt;And then, at the final moment:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&quot;Let me think about it.&quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&quot;I need to discuss with my family.&quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&quot;I found another option.&quot;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;The dream commission vanishes.&lt;/p&gt;&lt;p&gt;When this happens repeatedly, many real estate agents ask themselves:&lt;/p&gt;&lt;p&gt;&quot;Do I lack convincing power?&quot;&lt;br /&gt;&quot;Am I not communicating well enough?&quot;&lt;br /&gt;&quot;Am I weak in negotiation?&quot;&lt;/p&gt;&lt;p&gt;The answer is usually deeper.&lt;/p&gt;&lt;p&gt;Most lost deals are not lost during closing. They are lost much earlier.&lt;/p&gt;&lt;h2&gt;The Biggest Myth: Real Estate Is About Convincing People&lt;/h2&gt;&lt;p&gt;Many agents believe their job is to convince buyers.&lt;/p&gt;&lt;p&gt;That mindset creates pressure.&lt;/p&gt;&lt;p&gt;A buyer today is far more informed than before. They have access to property portals, market reports, social media reviews, and dozens of agents.&lt;/p&gt;&lt;p&gt;The modern Dubai buyer does not want to be convinced.&lt;/p&gt;&lt;p&gt;They want to feel confident.&lt;/p&gt;&lt;p&gt;The best agents do not push clients toward decisions. They remove uncertainty until the client naturally reaches a decision.&lt;/p&gt;&lt;p&gt;A closing failure is often a trust failure.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Problem 1: You Are Selling the Property, Not the Client&#39;s Dream&lt;/h1&gt;&lt;p&gt;A common mistake:&lt;/p&gt;&lt;p&gt;&quot;This apartment has a great view.&quot;&lt;br /&gt;&quot;The building has amazing amenities.&quot;&lt;br /&gt;&quot;The developer has a strong reputation.&quot;&lt;/p&gt;&lt;p&gt;All these points matter.&lt;/p&gt;&lt;p&gt;But the buyer is silently asking:&lt;/p&gt;&lt;p&gt;&quot;How does this improve my life?&quot;&lt;/p&gt;&lt;p&gt;An investor thinks:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Will this property appreciate?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Is the rental yield realistic?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Is my money safe?&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A family thinks:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Will my children enjoy living here?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Is this location practical?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Does this match our lifestyle?&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A successful agent connects the property with the buyer&#39;s personal goal.&lt;/p&gt;&lt;p&gt;Instead of:&lt;/p&gt;&lt;p&gt;&quot;This is a 2-bedroom apartment in Dubai Marina.&quot;&lt;/p&gt;&lt;p&gt;Say:&lt;/p&gt;&lt;p&gt;&quot;This gives you waterfront living with strong rental demand and flexibility if you decide to lease it later.&quot;&lt;/p&gt;&lt;p&gt;The difference is emotional positioning.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Problem 2: Weak Discovery Before Showing Properties&lt;/h1&gt;&lt;p&gt;Many agents rush into property tours.&lt;/p&gt;&lt;p&gt;A client says:&lt;/p&gt;&lt;p&gt;&quot;I need a 3-bedroom apartment.&quot;&lt;/p&gt;&lt;p&gt;The agent immediately sends listings.&lt;/p&gt;&lt;p&gt;That is a mistake.&lt;/p&gt;&lt;p&gt;The real questions are:&lt;/p&gt;&lt;p&gt;Why three bedrooms?&lt;br /&gt;Investment or living?&lt;br /&gt;Why Dubai?&lt;br /&gt;What matters more — price, location, returns, lifestyle?&lt;br /&gt;What would make you reject a property?&lt;/p&gt;&lt;p&gt;Without understanding motivation, agents become property suppliers instead of trusted advisors.&lt;/p&gt;&lt;p&gt;The best agents spend more time discovering before presenting.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Problem 3: You Start Negotiating Too Early&lt;/h1&gt;&lt;p&gt;In a difficult market, agents often reduce price too quickly.&lt;/p&gt;&lt;p&gt;The buyer says:&lt;/p&gt;&lt;p&gt;&quot;The price is high.&quot;&lt;/p&gt;&lt;p&gt;The agent immediately:&lt;/p&gt;&lt;p&gt;&quot;Let me ask the seller for a discount.&quot;&lt;/p&gt;&lt;p&gt;This weakens your position.&lt;/p&gt;&lt;p&gt;Instead, understand the real objection.&lt;/p&gt;&lt;p&gt;The buyer may not actually have a price problem.&lt;/p&gt;&lt;p&gt;They may have:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;trust concerns&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;timing issues&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;fear of making the wrong decision&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;comparison confusion&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A good negotiation starts with:&lt;/p&gt;&lt;p&gt;&quot;Is price the only thing stopping you from moving forward?&quot;&lt;/p&gt;&lt;p&gt;That single question can reveal the real barrier.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Problem 4: The Final Closing Conversation Is Missing&lt;/h1&gt;&lt;p&gt;Many agents show properties beautifully but fail at the final stage.&lt;/p&gt;&lt;p&gt;After the viewing they ask:&lt;/p&gt;&lt;p&gt;&quot;Do you like it?&quot;&lt;/p&gt;&lt;p&gt;This creates a simple yes/no situation.&lt;/p&gt;&lt;p&gt;Instead ask:&lt;/p&gt;&lt;p&gt;&quot;On a scale of 1 to 10, where would you place this property?&quot;&lt;/p&gt;&lt;p&gt;If the client says 7:&lt;/p&gt;&lt;p&gt;&quot;What would make it a 9?&quot;&lt;/p&gt;&lt;p&gt;Now the buyer tells you exactly what is stopping the deal.&lt;/p&gt;&lt;p&gt;Closing becomes problem-solving.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Problem 5: You Are Talking Too Much&lt;/h1&gt;&lt;p&gt;The strongest negotiators are often the best listeners.&lt;/p&gt;&lt;p&gt;When agents become nervous, they talk more.&lt;/p&gt;&lt;p&gt;They explain.&lt;br /&gt;They justify.&lt;br /&gt;They oversell.&lt;/p&gt;&lt;p&gt;But silence is powerful.&lt;/p&gt;&lt;p&gt;A buyer saying:&lt;/p&gt;&lt;p&gt;&quot;I need to think.&quot;&lt;/p&gt;&lt;p&gt;should not trigger a long speech.&lt;/p&gt;&lt;p&gt;Instead:&lt;/p&gt;&lt;p&gt;&quot;Of course. What part would you like to think about?&quot;&lt;/p&gt;&lt;p&gt;The answer reveals the real objection.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;How I Would Change My Strategy to Close More Deals&lt;/h1&gt;&lt;p&gt;If I were a Dubai real estate agent struggling in this market, I would follow these steps:&lt;/p&gt;&lt;h2&gt;1. Build Trust Before Selling&lt;/h2&gt;&lt;p&gt;Every conversation should answer:&lt;/p&gt;&lt;p&gt;&quot;Why should this client trust me?&quot;&lt;/p&gt;&lt;p&gt;Share:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;market insights&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;honest comparisons&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;risks as well as benefits&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;realistic expectations&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Trust closes more deals than pressure.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;2. Create a Buyer Decision Framework&lt;/h2&gt;&lt;p&gt;Before showing properties, understand:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;budget&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;timeline&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;purpose&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;decision makers&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;emotional motivation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;deal breakers&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Never show random properties.&lt;/p&gt;&lt;p&gt;Show solutions.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;3. Master Objection Handling&lt;/h2&gt;&lt;p&gt;Every objection has a hidden meaning.&lt;/p&gt;&lt;p&gt;&quot;I need to think.&quot;&lt;/p&gt;&lt;p&gt;Could mean:&lt;/p&gt;&lt;p&gt;&quot;I don&#39;t see enough value.&quot;&lt;/p&gt;&lt;p&gt;&quot;The price is high.&quot;&lt;/p&gt;&lt;p&gt;Could mean:&lt;/p&gt;&lt;p&gt;&quot;I don&#39;t understand why this is worth it.&quot;&lt;/p&gt;&lt;p&gt;&quot;I will call you.&quot;&lt;/p&gt;&lt;p&gt;Could mean:&lt;/p&gt;&lt;p&gt;&quot;I don&#39;t feel urgency.&quot;&lt;/p&gt;&lt;p&gt;Your job is not to fight objections.&lt;/p&gt;&lt;p&gt;Your job is to decode them.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;4. Create Controlled Urgency&lt;/h2&gt;&lt;p&gt;Urgency is not manipulation.&lt;/p&gt;&lt;p&gt;Real urgency comes from facts:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;limited inventory&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;changing developer incentives&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;rental demand&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;upcoming price movements&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A buyer acts faster when they understand consequences of waiting.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;5. Improve Negotiation Like a Skill&lt;/h2&gt;&lt;p&gt;Negotiation is not winning against the buyer.&lt;/p&gt;&lt;p&gt;It is finding a structure where both sides feel comfortable.&lt;/p&gt;&lt;p&gt;Use:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;alternative options&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;value stacking&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;clear comparisons&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;win-win positioning&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A professional negotiator protects both price and relationship.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;The Final Lesson&lt;/h1&gt;&lt;p&gt;In a down market, average agents blame the market.&lt;/p&gt;&lt;p&gt;Great agents upgrade themselves.&lt;/p&gt;&lt;p&gt;Lost deals are rarely because the property was wrong.&lt;/p&gt;&lt;p&gt;They happen because:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;trust was not built&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;buyer motivation was unclear&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;objections were misunderstood&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;the closing process was weak&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The future belongs to agents who stop being salespeople and become trusted real estate advisors.&lt;/p&gt;&lt;p&gt;In Dubai&#39;s competitive market, the agent who understands human psychology will always outperform the agent who only understands property.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/06/the-dubai-real-estate-deal-that-almost.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-8697787608215144808</guid><pubDate>Thu, 04 Jun 2026 04:13:43 +0000</pubDate><atom:updated>2026-06-03T21:13:43.356-07:00</atom:updated><title>Dubai Real Estate Under Fire? How Israel–US–Iran Tensions Could Reshape the Property Market and Survival Guide for Real Estate Agents</title><description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Israel–US–Iran tensions are creating uncertainty across global markets. Explore how the Dubai real estate sector may be affected, what investors should expect, and how property agents can survive and grow during geopolitical turbulence.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Introduction: Is Dubai Real Estate Entering a New Era of Uncertainty?&lt;/h2&gt;&lt;p&gt;Dubai has built its reputation as a safe haven for global investors, attracting buyers from Europe, Asia, Russia, Africa, and the Middle East. But rising geopolitical tensions involving Israel, the United States, and Iran have introduced a new question:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can Dubai’s real estate boom continue during a regional crisis?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The answer is complex. While conflicts create fear and short-term volatility, they can also create new investment flows. Dubai’s property market is not only connected to regional demand — it is deeply linked with global wealth movement, tourism, business migration, and investor confidence.&lt;/p&gt;&lt;p&gt;For real estate communication agents, this period is not just a challenge — it is a test of adaptability.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;How Could Israel–US–Iran Tensions Impact Dubai Real Estate?&lt;/h1&gt;&lt;h2&gt;1. Investor Sentiment: The First Shockwave&lt;/h2&gt;&lt;p&gt;Real estate is heavily influenced by psychology.&lt;/p&gt;&lt;p&gt;During geopolitical uncertainty:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Buyers delay decisions&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Investors become more cautious&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Luxury property transactions may slow&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Negotiation periods become longer&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A buyer who was ready to purchase a AED 5 million villa may now ask:&lt;/p&gt;&lt;p&gt;“Should I wait for six months?”&lt;/p&gt;&lt;p&gt;Even without a major economic impact, fear itself can temporarily reduce transaction velocity.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. Dubai as a Safe Haven: The Hidden Opportunity&lt;/h1&gt;&lt;p&gt;Historically, when uncertainty rises in nearby regions, some wealthy investors move capital toward stable locations.&lt;/p&gt;&lt;p&gt;Dubai benefits because of:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Political stability&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Strong infrastructure&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Tax-friendly environment&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;International lifestyle&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;High-quality housing&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Global connectivity&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A portion of capital that leaves risky markets may flow into Dubai apartments, villas, and commercial assets.&lt;/p&gt;&lt;p&gt;This creates a two-sided effect:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Short-term hesitation + long-term safe-haven demand&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. Possible Impact on Property Prices&lt;/h1&gt;&lt;p&gt;A realistic scenario-based outlook:&lt;/p&gt;&lt;h3&gt;Short Term (0–6 months)&lt;/h3&gt;&lt;p&gt;Possible effects:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Luxury segment may experience slower sales&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Investors may demand discounts&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Off-plan buyers may become cautious&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Rental demand may remain relatively stable&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Potential price impact:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;0–5% correction in certain segments is possible if uncertainty continues.&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Medium Term (6–24 months)&lt;/h3&gt;&lt;p&gt;Dubai could see:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Renewed foreign investment&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Increased wealth migration&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Strong demand for premium assets&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Well-located properties may continue to perform.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;4. Impact on Rentals&lt;/h1&gt;&lt;p&gt;The rental market may behave differently from sales.&lt;/p&gt;&lt;p&gt;Even during uncertainty, Dubai continues to attract:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Professionals&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Entrepreneurs&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Remote workers&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Families relocating&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Areas with strong infrastructure may remain resilient.&lt;/p&gt;&lt;p&gt;Demand drivers include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Schools&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Metro connectivity&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Business districts&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Lifestyle communities&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;5. The Biggest Challenge: Buyer Confidence&lt;/h1&gt;&lt;p&gt;The real battle is not only financial.&lt;/p&gt;&lt;p&gt;It is emotional.&lt;/p&gt;&lt;p&gt;Real estate agents may hear:&lt;/p&gt;&lt;p&gt;“Let’s wait until things settle.”&lt;/p&gt;&lt;p&gt;The agents who survive will be those who can answer:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Why Dubai?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Why now?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Why this property?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;What risk management strategy should buyers follow?&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Survival Strategy for Dubai Real Estate Communication Agents&lt;/h1&gt;&lt;h2&gt;1. Stop Selling Properties — Start Selling Confidence&lt;/h2&gt;&lt;p&gt;In uncertain times, buyers do not need aggressive sales pitches.&lt;/p&gt;&lt;p&gt;They need:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Market education&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Honest insights&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Risk analysis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Long-term perspective&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Become a trusted advisor, not just a broker.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;2. Create Data-Based Content&lt;/h2&gt;&lt;p&gt;Content will become your biggest advantage.&lt;/p&gt;&lt;p&gt;Create posts like:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;“Dubai Property Market During Middle East Crisis: Facts vs Fear”&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;“Is This the Right Time to Buy Dubai Real Estate?”&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;“Why Wealthy Investors Still Choose Dubai”&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Educational content builds authority.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;3. Focus on End Users, Not Only Speculators&lt;/h2&gt;&lt;p&gt;Speculative investors may pause.&lt;/p&gt;&lt;p&gt;But genuine buyers still exist:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Families relocating&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Entrepreneurs&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Long-term investors&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Residency seekers&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Target real needs.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;4. Diversify Your Client Base&lt;/h2&gt;&lt;p&gt;Do not depend only on one region.&lt;/p&gt;&lt;p&gt;Expand communication toward:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Indian investors&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;European buyers&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;African investors&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Asian markets&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Global outreach reduces regional risk.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;5. Use Technology to Reduce Costs&lt;/h2&gt;&lt;p&gt;During slower markets:&lt;/p&gt;&lt;p&gt;Smart agents will use:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;AI-powered follow-ups&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Virtual property tours&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Automated lead nurturing&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Social media education&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The goal:&lt;/p&gt;&lt;p&gt;Do more with fewer resources.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Final Thoughts: Crisis or Opportunity?&lt;/h1&gt;&lt;p&gt;Every real estate cycle creates winners and losers.&lt;/p&gt;&lt;p&gt;During uncertainty:&lt;/p&gt;&lt;p&gt;Weak agents disappear.&lt;/p&gt;&lt;p&gt;Strong agents build relationships.&lt;/p&gt;&lt;p&gt;Dubai real estate may face short-term turbulence from geopolitical tensions, but its fundamentals — infrastructure, global connectivity, investor-friendly policies, and lifestyle appeal — remain powerful.&lt;/p&gt;&lt;p&gt;For communication agents, the winning formula is simple:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Build trust. Educate buyers. Adapt faster than the market.&lt;/strong&gt;&lt;/p&gt;&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/06/dubai-real-estate-under-fire-how.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-3443699774685384458</guid><pubDate>Thu, 16 Apr 2026 02:13:00 +0000</pubDate><atom:updated>2026-04-15T19:13:09.289-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">adjourning</category><category domain="http://www.blogger.com/atom/ns#">Agile</category><category domain="http://www.blogger.com/atom/ns#">coaching</category><category domain="http://www.blogger.com/atom/ns#">collaboration</category><category domain="http://www.blogger.com/atom/ns#">conflict</category><category domain="http://www.blogger.com/atom/ns#">culture</category><category domain="http://www.blogger.com/atom/ns#">forming</category><category domain="http://www.blogger.com/atom/ns#">HR</category><category domain="http://www.blogger.com/atom/ns#">leadership</category><category domain="http://www.blogger.com/atom/ns#">learning</category><category domain="http://www.blogger.com/atom/ns#">management</category><category domain="http://www.blogger.com/atom/ns#">norming</category><category domain="http://www.blogger.com/atom/ns#">PAUL</category><category domain="http://www.blogger.com/atom/ns#">performing</category><category domain="http://www.blogger.com/atom/ns#">productivity</category><category domain="http://www.blogger.com/atom/ns#">project</category><category domain="http://www.blogger.com/atom/ns#">storming</category><category domain="http://www.blogger.com/atom/ns#">teamstages</category><category domain="http://www.blogger.com/atom/ns#">teamwork</category><category domain="http://www.blogger.com/atom/ns#">trust</category><title>Team Development Stages Explained: Forming, Storming, Norming, Performing and the PAUL Framework</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;flex flex-col gap-2 [&amp;amp;:not(:first-child)]:mt-2&quot;&gt;&lt;div class=&quot;popover bg-token-bg-primary dark:bg-token-bg-elevated-secondary border-token-border-default dark:border-token-border-light relative z-0 border [--canvas-bg:var(--bg-primary)] dark:[--canvas-bg:var(--bg-elevated-secondary)] overflow-visible cursor-text font-regular rounded-3xl w-full w-full pt-1 pb-3 sm:max-w-none&quot; id=&quot;textdoc-message-69dfbee5b4b48191b532c82e9596f8a6&quot;&gt;&lt;div class=&quot;relative flex min-h-0 w-full flex-1 flex-col self-end&quot;&gt;&lt;div class=&quot;relative flex min-h-0 flex-auto flex-col overflow-hidden border-t transition-colors border-transparent&quot;&gt;&lt;section class=&quot;popover flex h-full w-full flex-col bg-transparent&quot;&gt;&lt;section class=&quot;relative flex min-h-0 flex-auto grow flex-col overflow-hidden&quot;&gt;&lt;div class=&quot;block h-auto&quot;&gt;&lt;div class=&quot;h-full w-full&quot;&gt;&lt;div class=&quot;flex h-full justify-center&quot;&gt;&lt;div class=&quot;z-0 flex w-full flex-col items-center&quot;&gt;&lt;div class=&quot;relative z-10 flex max-w-full h-fit&quot; id=&quot;prosemirror-editor-container&quot;&gt;&lt;div class=&quot;_9XkC5G_main z-10 markdown prose dark:prose-invert contain-inline-size focus:outline-hidden bg-transparent ProseMirror&quot; contenteditable=&quot;false&quot; translate=&quot;no&quot;&gt;&lt;h1&gt;&lt;span&gt;Understanding Team Development: From Forming to Adjourning, with the PAUL Framework Revisited&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span&gt;Teams are the backbone of every successful organization. Whether it is a project team, a leadership group, a startup founding team, or a cross-functional task force, success depends not only on individual competence but also on how people work together.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;One of the most respected models in team development is Bruce Tuckman’s five-stage framework: &lt;/span&gt;&lt;strong&gt;&lt;span&gt;Forming, Storming, Norming, Performing, and Adjourning&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;. These stages explain how teams evolve over time.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Alongside this, the &lt;/span&gt;&lt;strong&gt;&lt;span&gt;PAUL framework&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; offers a simple and human-centered way to understand team behaviors and emotional dynamics. As per your correction, in this framework:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;P = Polite&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;A = Angry&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;U = Understanding&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;L = Learning&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;This revised article integrates that meaning throughout.&lt;/span&gt;&lt;/p&gt;&lt;div contenteditable=&quot;false&quot;&gt;&lt;hr /&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;Why Team Stages Matter&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;No team starts at peak performance.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Every group of people moves through phases of uncertainty, conflict, trust-building, excellence, and closure. Leaders who understand these phases are better equipped to guide teams compassionately and effectively.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The human side of teamwork is just as important as the professional side.&lt;/span&gt;&lt;/p&gt;&lt;div contenteditable=&quot;false&quot;&gt;&lt;hr /&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;1. Forming: The Polite Beginning&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;The &lt;/span&gt;&lt;strong&gt;&lt;span&gt;forming stage&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; is where the team first comes together.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;People are typically &lt;/span&gt;&lt;strong&gt;&lt;span&gt;polite, cautious, and observant&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;. They are trying to understand the team’s purpose, the expectations, and each other’s personalities.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This is where the &lt;/span&gt;&lt;strong&gt;&lt;span&gt;P in PAUL – Polite&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; strongly applies.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;At this stage, members often:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;span&gt;introduce themselves&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;listen more than they speak&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;avoid disagreement&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;seek clarity on roles&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;observe the leader’s style&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;People are usually on their best behavior.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;They do not yet know what is safe to say.&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span&gt;Leadership Focus&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span&gt;The leader should provide:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;span&gt;clear goals&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;role clarity&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;timelines&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;communication norms&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;psychological safety&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;A strong beginning sets the tone for future collaboration.&lt;/span&gt;&lt;/p&gt;&lt;div contenteditable=&quot;false&quot;&gt;&lt;hr /&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;2. Storming: When Anger and Conflict Surface&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;The &lt;/span&gt;&lt;strong&gt;&lt;span&gt;storming stage&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; is where real teamwork begins.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;As familiarity grows, differences in ideas, styles, and expectations start to emerge.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This naturally connects with &lt;/span&gt;&lt;strong&gt;&lt;span&gt;A = Angry&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; in the PAUL framework.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Anger here does not necessarily mean aggression.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Rather, it refers to:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;span&gt;frustration&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;disagreement&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;resistance&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;emotional reactions&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;conflicting viewpoints&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;This stage may include:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;span&gt;clashes over priorities&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;power struggles&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;confusion about ownership&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;missed expectations&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;This is a normal and necessary phase.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Healthy conflict helps teams move from superficial harmony to authentic collaboration.&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span&gt;Leadership Focus&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span&gt;Leaders should channel anger into constructive dialogue.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The goal is to resolve issues, not suppress emotions.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;When handled professionally, storming strengthens trust.&lt;/span&gt;&lt;/p&gt;&lt;div contenteditable=&quot;false&quot;&gt;&lt;hr /&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;3. Norming: Moving Toward Understanding&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;The &lt;/span&gt;&lt;strong&gt;&lt;span&gt;norming stage&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; is where the team starts settling into effective patterns.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This aligns beautifully with &lt;/span&gt;&lt;strong&gt;&lt;span&gt;U = Understanding&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Members begin to understand:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;span&gt;each other’s strengths&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;communication preferences&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;work styles&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;limitations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;expectations&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;Trust starts to grow.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The team begins functioning as a unit rather than as separate individuals.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Common signs include:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;span&gt;smoother communication&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;mutual respect&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;process discipline&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;collaborative problem-solving&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;This is where empathy becomes a performance driver.&lt;/span&gt;&lt;/p&gt;&lt;div contenteditable=&quot;false&quot;&gt;&lt;hr /&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;4. Performing: Learning and Excellence in Action&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;The &lt;/span&gt;&lt;strong&gt;&lt;span&gt;performing stage&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; is the high-performance phase.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This strongly reflects &lt;/span&gt;&lt;strong&gt;&lt;span&gt;L = Learning&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Great teams are always learning.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;They learn from:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;span&gt;mistakes&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;feedback&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;customer insights&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;retrospectives&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;evolving business needs&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;At this stage, the team demonstrates:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;span&gt;strong accountability&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;autonomy&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;innovation&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;resilience&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;proactive decision-making&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;People no longer need constant supervision.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The leader’s role becomes that of a coach and enabler.&lt;/span&gt;&lt;/p&gt;&lt;div contenteditable=&quot;false&quot;&gt;&lt;hr /&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;5. Adjourning: Ending with Reflection and Learning&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;The &lt;/span&gt;&lt;strong&gt;&lt;span&gt;adjourning stage&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; happens when the team completes its mission.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This may be the end of a project, transformation initiative, or temporary assignment.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This phase should also emphasize &lt;/span&gt;&lt;strong&gt;&lt;span&gt;Learning&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Teams should reflect on:&lt;/span&gt;&lt;/p&gt;&lt;ul data-spread=&quot;false&quot;&gt;&lt;li&gt;&lt;span&gt;what worked well&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;what could improve&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;lessons for future teams&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;recognition of contributions&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span&gt;Closure matters deeply from both a professional and emotional perspective.&lt;/span&gt;&lt;/p&gt;&lt;div contenteditable=&quot;false&quot;&gt;&lt;hr /&gt;&lt;/div&gt;&lt;h1&gt;&lt;span&gt;The PAUL Framework Explained&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span&gt;The PAUL framework can be understood as a human emotional progression within team development.&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span&gt;P – Polite&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;At the beginning, people are courteous and careful.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;They are still building trust.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This corresponds closely to the &lt;/span&gt;&lt;strong&gt;&lt;span&gt;forming stage&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span&gt;A – Angry&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;As differences emerge, emotions surface.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Conflict, frustration, and resistance become visible.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This maps naturally to &lt;/span&gt;&lt;strong&gt;&lt;span&gt;storming&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Anger in this context means emotional energy that needs direction.&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span&gt;U – Understanding&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;Once teams work through conflict, they begin to appreciate one another.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This is the foundation of &lt;/span&gt;&lt;strong&gt;&lt;span&gt;norming&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Understanding reduces friction and strengthens collaboration.&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span&gt;L – Learning&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;The highest level of team maturity is continuous learning.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This supports both &lt;/span&gt;&lt;strong&gt;&lt;span&gt;performing&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; and &lt;/span&gt;&lt;strong&gt;&lt;span&gt;adjourning&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Learning transforms experience into wisdom.&lt;/span&gt;&lt;/p&gt;&lt;div contenteditable=&quot;false&quot;&gt;&lt;hr /&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;How Leaders Can Use This Model&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;A humane leader recognizes where the team currently is.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;If the team is polite, provide clarity.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;If the team is angry, provide space for healthy dialogue.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;If the team is understanding, strengthen systems.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;If the team is learning, empower innovation.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This model helps leaders respond with empathy rather than judgment.&lt;/span&gt;&lt;/p&gt;&lt;div contenteditable=&quot;false&quot;&gt;&lt;hr /&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;Final Thoughts&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;The journey from &lt;/span&gt;&lt;strong&gt;&lt;span&gt;Forming to Adjourning&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; is both professional and deeply human.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;The revised &lt;/span&gt;&lt;strong&gt;&lt;span&gt;PAUL framework — Polite, Angry, Understanding, Learning&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; — captures the emotional rhythm of team evolution beautifully.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Teams begin with courtesy, pass through conflict, grow through empathy, and mature through learning.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;That is how strong, resilient, and high-performing teams are built.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal outline-none keyboard-focused:focus-ring [.text-message+&amp;amp;]:mt-1&quot; data-message-author-role=&quot;assistant&quot; data-message-id=&quot;1db0216e-21c3-4e75-89e2-5d7f046b0355&quot; data-message-model-slug=&quot;gpt-5-3&quot; dir=&quot;auto&quot;&gt;&lt;div class=&quot;flex w-full flex-col gap-1 empty:hidden&quot;&gt;&lt;div class=&quot;markdown prose dark:prose-invert w-full wrap-break-word light markdown-new-styling&quot;&gt;&lt;p data-end=&quot;88&quot; data-start=&quot;0&quot;&gt;I’ve rewritten the entire article in the canvas using your corrected &lt;strong data-end=&quot;87&quot; data-start=&quot;69&quot;&gt;PAUL framework&lt;/strong&gt;:&lt;/p&gt;
&lt;ul data-end=&quot;165&quot; data-start=&quot;90&quot;&gt;
&lt;li data-end=&quot;106&quot; data-section-id=&quot;1jvmnda&quot; data-start=&quot;90&quot;&gt;
&lt;strong data-end=&quot;106&quot; data-start=&quot;92&quot;&gt;P = Polite&lt;/strong&gt;
&lt;/li&gt;
&lt;li data-end=&quot;122&quot; data-section-id=&quot;t87kwn&quot; data-start=&quot;107&quot;&gt;
&lt;strong data-end=&quot;122&quot; data-start=&quot;109&quot;&gt;A = Angry&lt;/strong&gt;
&lt;/li&gt;
&lt;li data-end=&quot;146&quot; data-section-id=&quot;gi16n8&quot; data-start=&quot;123&quot;&gt;
&lt;strong data-end=&quot;146&quot; data-start=&quot;125&quot;&gt;U = Understanding&lt;/strong&gt;
&lt;/li&gt;
&lt;li data-end=&quot;165&quot; data-section-id=&quot;jtz965&quot; data-start=&quot;147&quot;&gt;
&lt;strong data-end=&quot;165&quot; data-start=&quot;149&quot;&gt;L = Learning&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;325&quot; data-start=&quot;167&quot;&gt;The revised version now aligns the &lt;strong data-end=&quot;241&quot; data-start=&quot;202&quot;&gt;emotional journey of the PAUL model&lt;/strong&gt; with the &lt;strong data-end=&quot;278&quot; data-start=&quot;251&quot;&gt;team development stages&lt;/strong&gt;, making it feel much more human and intuitive.&lt;/p&gt;
&lt;p data-end=&quot;384&quot; data-start=&quot;327&quot;&gt;I especially like how this naturally maps as:&lt;/p&gt;
&lt;ul data-end=&quot;500&quot; data-start=&quot;386&quot;&gt;
&lt;li data-end=&quot;408&quot; data-section-id=&quot;n6ozlz&quot; data-start=&quot;386&quot;&gt;
&lt;strong data-end=&quot;408&quot; data-start=&quot;388&quot;&gt;Forming → Polite&lt;/strong&gt;
&lt;/li&gt;
&lt;li data-end=&quot;431&quot; data-section-id=&quot;nixka6&quot; data-start=&quot;409&quot;&gt;
&lt;strong data-end=&quot;431&quot; data-start=&quot;411&quot;&gt;Storming → Angry&lt;/strong&gt;
&lt;/li&gt;
&lt;li data-end=&quot;461&quot; data-section-id=&quot;1xe78g0&quot; data-start=&quot;432&quot;&gt;
&lt;strong data-end=&quot;461&quot; data-start=&quot;434&quot;&gt;Norming → Understanding&lt;/strong&gt;
&lt;/li&gt;
&lt;li data-end=&quot;500&quot; data-section-id=&quot;9j2c9l&quot; data-start=&quot;462&quot;&gt;
&lt;strong data-end=&quot;500&quot; data-start=&quot;464&quot;&gt;Performing/Adjourning → Learning&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;571&quot; data-start=&quot;502&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://computer-science-notes.blogspot.com/2026/04/team-development-stages-explained.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-2893451303140558665</guid><pubDate>Tue, 14 Apr 2026 15:41:50 +0000</pubDate><atom:updated>2026-04-14T08:41:50.136-07:00</atom:updated><title>How the Myers-Briggs Type Indicator Helps Decode Human Behavior</title><description>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;The&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Myers–Briggs Type Indicator (MBTI)&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;is a widely used psychological framework designed to categorize human personality into distinct types based on preferences in how people perceive the world and make decisions. It was developed by&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Katharine Cook Briggs&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;and her daughter&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Isabel Briggs Myers&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;, inspired by the theories of Swiss psychologist&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Carl Jung&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h1 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;🌟&quot; aria-label=&quot;🌟&quot; class=&quot;an1&quot; data-emoji=&quot;🌟&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f31f/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Overview of MBTI&lt;/h1&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;The MBTI classifies individuals into&amp;nbsp;&lt;strong&gt;16 personality types&lt;/strong&gt;, based on four dichotomies (pairs of opposite preferences). Each person falls somewhere along each pair, forming a four-letter personality type.&lt;/p&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h1 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;🧠&quot; aria-label=&quot;🧠&quot; class=&quot;an1&quot; data-emoji=&quot;🧠&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f9e0/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;The Four Dimensions of MBTI&lt;/h1&gt;&lt;h2 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;1. Extraversion (E) vs Introversion (I)&lt;/h2&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;This dimension describes where you get your energy from.&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Extraversion (E)&lt;/strong&gt;: Energized by social interaction&lt;br /&gt;&lt;em&gt;Example:&lt;/em&gt;&amp;nbsp;A person who enjoys parties and group discussions&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Introversion (I)&lt;/strong&gt;: Energized by solitude&lt;br /&gt;&lt;em&gt;Example:&lt;/em&gt;&amp;nbsp;Someone who prefers reading or working alone&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;img alt=&quot;👉&quot; aria-label=&quot;👉&quot; class=&quot;an1&quot; data-emoji=&quot;👉&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f449/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Example:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Rahul (E)&lt;/strong&gt;&amp;nbsp;enjoys team brainstorming sessions&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Amit (I)&lt;/strong&gt;&amp;nbsp;prefers working quietly on his own&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h2 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;2. Sensing (S) vs Intuition (N)&lt;/h2&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;This dimension explains how people gather information.&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Sensing (S)&lt;/strong&gt;: Focus on facts, details, and present reality&lt;br /&gt;&lt;em&gt;Example:&lt;/em&gt;&amp;nbsp;A mechanic focusing on practical repair steps&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Intuition (N)&lt;/strong&gt;: Focus on patterns, ideas, and possibilities&lt;br /&gt;&lt;em&gt;Example:&lt;/em&gt;&amp;nbsp;An inventor imagining future technologies&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;img alt=&quot;👉&quot; aria-label=&quot;👉&quot; class=&quot;an1&quot; data-emoji=&quot;👉&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f449/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Example:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Priya (S)&lt;/strong&gt;&amp;nbsp;follows a recipe step-by-step&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Neha (N)&lt;/strong&gt;&amp;nbsp;experiments creatively while cooking&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h2 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;3. Thinking (T) vs Feeling (F)&lt;/h2&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;This dimension relates to decision-making.&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Thinking (T)&lt;/strong&gt;: Decisions based on logic and objectivity&lt;br /&gt;&lt;em&gt;Example:&lt;/em&gt;&amp;nbsp;A judge analyzing evidence impartially&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Feeling (F)&lt;/strong&gt;: Decisions based on emotions and values&lt;br /&gt;&lt;em&gt;Example:&lt;/em&gt;&amp;nbsp;A teacher considering students’ feelings&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;img alt=&quot;👉&quot; aria-label=&quot;👉&quot; class=&quot;an1&quot; data-emoji=&quot;👉&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f449/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Example:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Arjun (T)&lt;/strong&gt;&amp;nbsp;chooses a job based on salary and growth&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Meera (F)&lt;/strong&gt;&amp;nbsp;chooses a job based on passion and work environment&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h2 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;4. Judging (J) vs Perceiving (P)&lt;/h2&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;This dimension reflects lifestyle and approach to structure.&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Judging (J)&lt;/strong&gt;: Organized, planned, and decisive&lt;br /&gt;&lt;em&gt;Example:&lt;/em&gt;&amp;nbsp;Someone who maintains a strict daily schedule&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Perceiving (P)&lt;/strong&gt;: Flexible, spontaneous, adaptable&lt;br /&gt;&lt;em&gt;Example:&lt;/em&gt;&amp;nbsp;Someone who prefers last-minute plans&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;img alt=&quot;👉&quot; aria-label=&quot;👉&quot; class=&quot;an1&quot; data-emoji=&quot;👉&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f449/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Example:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Karan (J)&lt;/strong&gt;&amp;nbsp;plans his trip weeks in advance&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Riya (P)&lt;/strong&gt;&amp;nbsp;decides travel plans on the go&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h1 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;🔢&quot; aria-label=&quot;🔢&quot; class=&quot;an1&quot; data-emoji=&quot;🔢&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f522/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;The 16 Personality Types (with Examples)&lt;/h1&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Each type combines one preference from each dimension:&lt;/p&gt;&lt;h3 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;🧑‍💼&quot; aria-label=&quot;🧑‍💼&quot; class=&quot;an1&quot; data-emoji=&quot;🧑‍💼&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f9d1_200d_1f4bc/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Analysts (NT types)&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;INTJ&lt;/strong&gt;&amp;nbsp;– Strategic planner (&lt;em&gt;Example: long-term business strategist&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;INTP&lt;/strong&gt;&amp;nbsp;– Logical thinker (&lt;em&gt;Example: scientist or philosopher&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ENTJ&lt;/strong&gt;&amp;nbsp;– Natural leader (&lt;em&gt;Example: CEO managing teams&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ENTP&lt;/strong&gt;&amp;nbsp;– Innovative debater (&lt;em&gt;Example: entrepreneur with new ideas&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;❤️&quot; aria-label=&quot;❤️&quot; class=&quot;an1&quot; data-emoji=&quot;❤️&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/2764_fe0f/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Diplomats (NF types)&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;INFJ&lt;/strong&gt;&amp;nbsp;– Insightful and idealistic (&lt;em&gt;Example: counselor guiding others&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;INFP&lt;/strong&gt;&amp;nbsp;– Creative and empathetic (&lt;em&gt;Example: writer or artist&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ENFJ&lt;/strong&gt;&amp;nbsp;– Charismatic leader (&lt;em&gt;Example: motivational speaker&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ENFP&lt;/strong&gt;&amp;nbsp;– Enthusiastic and imaginative (&lt;em&gt;Example: creative marketer&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;🛠️&quot; aria-label=&quot;🛠️&quot; class=&quot;an1&quot; data-emoji=&quot;🛠️&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f6e0_fe0f/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Sentinels (SJ types)&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ISTJ&lt;/strong&gt;&amp;nbsp;– Responsible and organized (&lt;em&gt;Example: accountant&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ISFJ&lt;/strong&gt;&amp;nbsp;– Caring and detail-oriented (&lt;em&gt;Example: nurse&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ESTJ&lt;/strong&gt;&amp;nbsp;– Efficient manager (&lt;em&gt;Example: project manager&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ESFJ&lt;/strong&gt;&amp;nbsp;– Social and supportive (&lt;em&gt;Example: event planner&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h3 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;🎨&quot; aria-label=&quot;🎨&quot; class=&quot;an1&quot; data-emoji=&quot;🎨&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f3a8/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Explorers (SP types)&lt;/h3&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ISTP&lt;/strong&gt;&amp;nbsp;– Practical problem-solver (&lt;em&gt;Example: mechanic&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ISFP&lt;/strong&gt;&amp;nbsp;– Artistic and gentle (&lt;em&gt;Example: designer&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ESTP&lt;/strong&gt;&amp;nbsp;– Energetic risk-taker (&lt;em&gt;Example: salesperson&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;ESFP&lt;/strong&gt;&amp;nbsp;– Fun-loving entertainer (&lt;em&gt;Example: performer&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h1 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;📌&quot; aria-label=&quot;📌&quot; class=&quot;an1&quot; data-emoji=&quot;📌&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f4cc/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Applications of MBTI&lt;/h1&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;MBTI is used in many areas:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Career guidance&lt;/strong&gt;&amp;nbsp;→ Helps people choose suitable professions&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Team building&lt;/strong&gt;&amp;nbsp;→ Improves workplace collaboration&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Personal development&lt;/strong&gt;&amp;nbsp;→ Enhances self-awareness&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;&lt;strong&gt;Relationships&lt;/strong&gt;&amp;nbsp;→ Helps understand differences between people&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;img alt=&quot;👉&quot; aria-label=&quot;👉&quot; class=&quot;an1&quot; data-emoji=&quot;👉&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f449/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Example:&lt;br /&gt;A company may use MBTI to balance a team with both&amp;nbsp;&lt;strong&gt;creative thinkers (N types)&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;detail-oriented workers (S types)&lt;/strong&gt;.&lt;/p&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h1 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;⚖️&quot; aria-label=&quot;⚖️&quot; class=&quot;an1&quot; data-emoji=&quot;⚖️&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/2696_fe0f/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Criticism of MBTI&lt;/h1&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;While popular, MBTI has some limitations:&lt;/p&gt;&lt;ul style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;Lacks strong scientific validity compared to modern psychology models&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;People may not fit strictly into one category&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-left: 15px;&quot;&gt;&lt;p&gt;Personality can change over time&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;&lt;h1 style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img alt=&quot;✅&quot; aria-label=&quot;✅&quot; class=&quot;an1&quot; data-emoji=&quot;✅&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/2705/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;Conclusion&lt;/h1&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;The Myers–Briggs Type Indicator is a useful tool for understanding personality differences and improving interpersonal relationships. Though not scientifically perfect, it provides a simple and relatable framework for self-discovery.&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;img alt=&quot;👉&quot; aria-label=&quot;👉&quot; class=&quot;an1&quot; data-emoji=&quot;👉&quot; draggable=&quot;false&quot; loading=&quot;lazy&quot; src=&quot;https://fonts.gstatic.com/s/e/notoemoji/17.0/1f449/32.png&quot; style=&quot;height: 1.2em; vertical-align: middle; width: 1.2em;&quot; /&gt;&amp;nbsp;In short: MBTI doesn’t define who you are—but it helps you understand how you think, feel, and interact with the world.&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/04/how-myers-briggs-type-indicator-helps.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-7982403390559563087</guid><pubDate>Thu, 19 Mar 2026 15:04:00 +0000</pubDate><atom:updated>2026-03-19T08:04:33.904-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AIModels</category><category domain="http://www.blogger.com/atom/ns#">ArtificialIntelligence</category><category domain="http://www.blogger.com/atom/ns#">CNN</category><category domain="http://www.blogger.com/atom/ns#">ComputerVision</category><category domain="http://www.blogger.com/atom/ns#">ConvolutionalNeuralNetwork</category><category domain="http://www.blogger.com/atom/ns#">DeepLearning</category><category domain="http://www.blogger.com/atom/ns#">FeatureExtraction</category><category domain="http://www.blogger.com/atom/ns#">ImageProcessing</category><category domain="http://www.blogger.com/atom/ns#">ImageRecognition</category><category domain="http://www.blogger.com/atom/ns#">MachineLearning</category><category domain="http://www.blogger.com/atom/ns#">NeuralNetworks</category><category domain="http://www.blogger.com/atom/ns#">ObjectDetection</category><title>Convolutional Neural Networks (CNN): A Complete Beginner-Friendly Guide</title><description>&lt;p&gt;&lt;em&gt;A deep and intuitive explanation of architecture, layers, kernels, pooling, fully connected layers, and Softmax&lt;/em&gt;&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;1. Introduction to Convolutional Neural Networks&lt;/h1&gt;&lt;p&gt;In modern &lt;strong&gt;Deep Learning&lt;/strong&gt;, one of the most powerful models used for &lt;strong&gt;image recognition, computer vision, and pattern detection&lt;/strong&gt; is the &lt;strong&gt;Convolutional Neural Networks (CNN)&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;CNNs are widely used in applications such as:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Face recognition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Medical image diagnosis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Autonomous driving&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Satellite image analysis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Object detection in videos&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Companies like &lt;strong&gt;Google&lt;/strong&gt;, &lt;strong&gt;Meta Platforms&lt;/strong&gt;, and &lt;strong&gt;Tesla&lt;/strong&gt; rely heavily on CNNs for vision-based AI systems.&lt;/p&gt;&lt;p&gt;The key strength of CNNs is their ability to &lt;strong&gt;automatically learn visual features from images&lt;/strong&gt;, eliminating the need for manual feature engineering.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;2. Why Traditional Neural Networks Fail for Images&lt;/h1&gt;&lt;p&gt;Suppose we input a &lt;strong&gt;200 × 200 pixel image&lt;/strong&gt; into a traditional neural network.&lt;/p&gt;&lt;p&gt;Total inputs:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;200 × 200 = 40,000 pixels
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the first hidden layer has &lt;strong&gt;100 neurons&lt;/strong&gt;, then the number of parameters becomes:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;40,000 × 100 = 4,000,000 weights
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This creates several problems:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Huge computational cost&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Overfitting&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Slow training&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Loss of spatial information&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;CNNs solve this problem by using &lt;strong&gt;local connections and shared weights&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Instead of analyzing the entire image at once, CNNs analyze &lt;strong&gt;small regions of the image at a time&lt;/strong&gt;.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;3. Intuition Behind CNN&lt;/h1&gt;&lt;p&gt;Think about how &lt;strong&gt;humans recognize images&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;If you see a picture of a &lt;strong&gt;cat&lt;/strong&gt;, your brain does not analyze every pixel.&lt;/p&gt;&lt;p&gt;Instead it identifies:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;edges&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;whiskers&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;eyes&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;ears&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;face shape&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Then combines these features to recognize the object.&lt;/p&gt;&lt;p&gt;CNNs mimic this process.&lt;/p&gt;&lt;p&gt;They detect:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Edges → Textures → Shapes → Objects
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Layer by layer.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;4. Basic CNN Architecture&lt;/h1&gt;&lt;p&gt;A typical CNN architecture contains the following layers:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input Image
      ↓
Convolution Layer
      ↓
Activation Function (ReLU)
      ↓
Pooling Layer
      ↓
Convolution Layer
      ↓
Pooling Layer
      ↓
Flatten Layer
      ↓
Fully Connected Layer
      ↓
Softmax Output Layer
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Let us understand each component in detail.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;5. Convolution Operation (The Core Idea)&lt;/h1&gt;&lt;p&gt;The fundamental operation in CNN is &lt;strong&gt;convolution&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Convolution is a mathematical operation where &lt;strong&gt;a small matrix called a kernel slides across an image to extract features&lt;/strong&gt;. (&lt;a href=&quot;https://homepages.inf.ed.ac.uk/rbf/HIPR2/convolve.htm?utm_source=chatgpt.com&quot; title=&quot;Glossary - Convolution&quot;&gt;Informatics Homepages&lt;/a&gt;)&lt;/p&gt;&lt;h3&gt;Convolution Process&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Take a small matrix called a &lt;strong&gt;kernel&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Place it on the image&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Multiply overlapping values&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Sum them&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Store the result in the output feature map&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Then the kernel &lt;strong&gt;moves across the image&lt;/strong&gt;.&lt;/p&gt;&lt;hr&gt;&lt;h2&gt;Example of Convolution&lt;/h2&gt;&lt;h3&gt;Convolution Operation Visualization&lt;/h3&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/338956987/figure/fig1/AS%3A853567619477504%401580517787870/Performing-convolution-operation-by-sliding-the-kernel-over-the-input-data-to-form-the.png&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/343356912/figure/fig2/AS%3A926728918671360%401597960800175/A-3-3-kernel-is-introduced-in-this-example-We-adopt-stride-of-1-ie-sliding-the.png&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://media.licdn.com/dms/image/v2/D4D12AQHMz5kTcCa7eQ/article-cover_image-shrink_720_1280/article-cover_image-shrink_720_1280/0/1673940856506?e=2147483647&amp;amp;t=0rcjdI1uJ1Jq5n_OIVyMqeMS_Q9K8Ll3FEEkbB5sAkk&amp;amp;v=beta&quot;&gt;&lt;/p&gt;&lt;p&gt;Here the kernel slides across the image and produces a &lt;strong&gt;feature map&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;The convolution process repeats across all positions of the image, generating an output feature map. (&lt;a href=&quot;https://artificial-intelligence-wiki.com/deep-learning/convolutional-neural-networks/convolution-operation-fundamentals/?utm_source=chatgpt.com&quot; title=&quot;Convolution Operation Fundamentals - Complete Guide | Artificial Intelligence Wiki&quot;&gt;Artificial Intelligence Wiki&lt;/a&gt;)&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;6. What is a Kernel (Filter)?&lt;/h1&gt;&lt;p&gt;A &lt;strong&gt;kernel (also called a filter)&lt;/strong&gt; is a &lt;strong&gt;small matrix of learnable weights&lt;/strong&gt; used to detect patterns in images.&lt;/p&gt;&lt;p&gt;Typical sizes:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;3 × 3
5 × 5
7 × 7
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Example kernel:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;1 0 1
0 1 0
1 0 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The kernel scans the image and produces a &lt;strong&gt;feature map&lt;/strong&gt;.&lt;/p&gt;&lt;hr&gt;&lt;h2&gt;What Features Can Kernels Detect?&lt;/h2&gt;&lt;p&gt;Different kernels learn different patterns:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Kernel Type&lt;/th&gt;&lt;th&gt;Detects&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Edge kernel&lt;/td&gt;&lt;td&gt;object boundaries&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Blur kernel&lt;/td&gt;&lt;td&gt;smoothing&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Sharpen kernel&lt;/td&gt;&lt;td&gt;fine details&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Texture kernel&lt;/td&gt;&lt;td&gt;repeated patterns&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;In CNNs these kernels are &lt;strong&gt;not manually designed&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;They are &lt;strong&gt;learned automatically during training&lt;/strong&gt; using backpropagation.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;7. Feature Maps&lt;/h1&gt;&lt;p&gt;After convolution, the result is called a &lt;strong&gt;feature map&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Feature maps highlight &lt;strong&gt;where a particular feature exists in the image&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;p&gt;Kernel detecting edges → Feature map showing edges.&lt;/p&gt;&lt;p&gt;CNNs usually use &lt;strong&gt;many kernels simultaneously&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Kernel 1 → edges
Kernel 2 → curves
Kernel 3 → textures
Kernel 4 → patterns
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Thus CNN extracts &lt;strong&gt;multiple feature maps&lt;/strong&gt;.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;8. Activation Function (ReLU)&lt;/h1&gt;&lt;p&gt;After convolution, we apply an activation function.&lt;/p&gt;&lt;p&gt;The most common activation function is &lt;strong&gt;Rectified Linear Unit (ReLU)&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Formula:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;ReLU(x) = max(0, x)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Meaning:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Negative values → 0
Positive values → unchanged
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Why ReLU is used:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;introduces non-linearity&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;faster training&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;avoids vanishing gradients&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;h1&gt;9. Pooling Layer&lt;/h1&gt;&lt;p&gt;After convolution, the next step is &lt;strong&gt;pooling&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Pooling reduces the size of feature maps.&lt;/p&gt;&lt;p&gt;This helps:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;reduce computation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;reduce parameters&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;reduce overfitting&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;h2&gt;Max Pooling Example&lt;/h2&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/380339283/figure/fig3/AS%3A11431281240858089%401714835389024/Fig-5-Illustration-of-max-pooling-of-2x2-filter-and-stride-2-for-down-sampling-of.ppm&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://i.sstatic.net/S0Azc.jpg&quot;&gt;&lt;/p&gt;&lt;p&gt;In &lt;strong&gt;2×2 max pooling&lt;/strong&gt;, the network selects the &lt;strong&gt;maximum value from each block&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Input:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;1 3 2 4
5 6 7 8
3 2 1 0
1 2 3 4
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After 2×2 max pooling:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;6 8
3 4
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h2&gt;Types of Pooling&lt;/h2&gt;&lt;h3&gt;1 Max Pooling&lt;/h3&gt;&lt;p&gt;Selects the &lt;strong&gt;maximum value&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Most common.&lt;/p&gt;&lt;hr&gt;&lt;h3&gt;2 Average Pooling&lt;/h3&gt;&lt;p&gt;Selects the &lt;strong&gt;average value&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;(1+3+5+6)/4 = 3.75
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h3&gt;Why Pooling is Important&lt;/h3&gt;&lt;p&gt;Pooling provides:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dimensionality reduction&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Translation invariance&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Noise reduction&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;h1&gt;10. Multiple Convolution Layers&lt;/h1&gt;&lt;p&gt;CNNs typically stack multiple convolution layers.&lt;/p&gt;&lt;p&gt;Example architecture:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Conv Layer → detect edges
Conv Layer → detect shapes
Conv Layer → detect object parts
Conv Layer → detect objects
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This hierarchical learning is one reason CNNs are extremely powerful.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;11. Flatten Layer&lt;/h1&gt;&lt;p&gt;After several convolution and pooling layers, we get &lt;strong&gt;feature maps&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example feature map:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;4 × 4 × 32
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This means:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;height = 4&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;width = 4&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;channels = 32&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;But traditional neural networks require &lt;strong&gt;1D input vectors&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;So we &lt;strong&gt;flatten the matrix&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;4 × 4 × 32 = 512 values
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Flatten layer converts:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;3D Feature Map → 1D Vector
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[0.4, 0.7, 0.2, 0.9, 0.1, ...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This vector is then fed into dense layers.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;12. Fully Connected Layer&lt;/h1&gt;&lt;p&gt;The &lt;strong&gt;Fully Connected Layer (Dense Layer)&lt;/strong&gt; is similar to layers in traditional neural networks.&lt;/p&gt;&lt;p&gt;Each neuron connects to &lt;strong&gt;all neurons in the previous layer&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Purpose:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Combine extracted features&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Perform classification&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Flatten Output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;512 neurons
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Fully Connected Layer:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;512 → 128 neurons
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next Layer:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;128 → 64 neurons
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Final Layer:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;64 → number of classes
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;For digit recognition:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Output neurons = 10
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h1&gt;13. Softmax Layer&lt;/h1&gt;&lt;p&gt;The final layer in CNN classification is usually &lt;strong&gt;Softmax&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Softmax converts outputs into &lt;strong&gt;probabilities&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example raw output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[2.5, 1.2, 0.3]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After Softmax:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[0.72, 0.21, 0.07]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Interpretation:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Class 1 → 72%
Class 2 → 21%
Class 3 → 7%
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Softmax ensures:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Sum of probabilities = 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Formula:&lt;/p&gt;&lt;p&gt;[&lt;br&gt;P_i = \frac{e^{z_i}}{\sum e^{z_j}}&lt;br&gt;]&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;(z_i) = output score&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;(P_i) = probability of class&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;h1&gt;14. Complete CNN Workflow&lt;/h1&gt;&lt;p&gt;Let us see the complete process.&lt;/p&gt;&lt;h3&gt;Step 1 Input Image&lt;/h3&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;28 × 28 grayscale image
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h3&gt;Step 2 Convolution Layer&lt;/h3&gt;&lt;p&gt;Apply 32 kernels:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Output → 28 × 28 × 32
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h3&gt;Step 3 ReLU Activation&lt;/h3&gt;&lt;p&gt;Remove negative values.&lt;/p&gt;&lt;hr&gt;&lt;h3&gt;Step 4 Pooling Layer&lt;/h3&gt;&lt;p&gt;Reduce size:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;28 × 28 → 14 × 14
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h3&gt;Step 5 Second Convolution&lt;/h3&gt;&lt;p&gt;Apply 64 filters:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;14 × 14 × 64
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h3&gt;Step 6 Pooling&lt;/h3&gt;&lt;p&gt;Reduce again:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;7 × 7 × 64
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h3&gt;Step 7 Flatten&lt;/h3&gt;&lt;p&gt;Convert to vector:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;7 × 7 × 64 = 3136
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h3&gt;Step 8 Fully Connected Layer&lt;/h3&gt;&lt;pre&gt;&lt;code&gt;3136 → 128 neurons
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h3&gt;Step 9 Output Layer&lt;/h3&gt;&lt;pre&gt;&lt;code&gt;128 → number of classes
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h3&gt;Step 10 Softmax&lt;/h3&gt;&lt;p&gt;Convert outputs to probabilities.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;15. Visual Overview of CNN Architecture&lt;/h1&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/0%2A1KEew1smVFM7AnA3&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/v2/resize%3Afit%3A1400/1%2AgmJmP0jEmfOM2qTuyJvrxQ.png&quot;&gt;&lt;/p&gt;&lt;p&gt;This diagram shows how CNN gradually converts &lt;strong&gt;raw pixels into high-level features and finally into predictions&lt;/strong&gt;.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;16. Real Example: Recognizing a Cat&lt;/h1&gt;&lt;p&gt;Suppose CNN sees a &lt;strong&gt;cat image&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Layer-by-layer detection:&lt;/p&gt;&lt;h3&gt;Layer 1&lt;/h3&gt;&lt;p&gt;Detect edges.&lt;/p&gt;&lt;h3&gt;Layer 2&lt;/h3&gt;&lt;p&gt;Detect shapes.&lt;/p&gt;&lt;h3&gt;Layer 3&lt;/h3&gt;&lt;p&gt;Detect object parts:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;eyes&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;ears&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;whiskers&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Layer 4&lt;/h3&gt;&lt;p&gt;Combine parts.&lt;/p&gt;&lt;h3&gt;Output&lt;/h3&gt;&lt;pre&gt;&lt;code&gt;Cat = 0.95 probability
Dog = 0.03
Rabbit = 0.02
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h1&gt;17. Advantages of CNN&lt;/h1&gt;&lt;h3&gt;Automatic Feature Extraction&lt;/h3&gt;&lt;p&gt;No manual feature engineering required.&lt;/p&gt;&lt;hr&gt;&lt;h3&gt;Parameter Sharing&lt;/h3&gt;&lt;p&gt;Same kernel used across the image.&lt;/p&gt;&lt;p&gt;This reduces parameters drastically.&lt;/p&gt;&lt;hr&gt;&lt;h3&gt;Translation Invariance&lt;/h3&gt;&lt;p&gt;Object can be detected anywhere in the image.&lt;/p&gt;&lt;hr&gt;&lt;h3&gt;Hierarchical Feature Learning&lt;/h3&gt;&lt;pre&gt;&lt;code&gt;Edges → shapes → objects
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&lt;h1&gt;18. Famous CNN Architectures&lt;/h1&gt;&lt;p&gt;Some landmark CNN models include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;LeNet-5&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;AlexNet&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;VGGNet&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;ResNet&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Inception Network&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These architectures pushed the boundaries of computer vision.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;19. Applications of CNN&lt;/h1&gt;&lt;p&gt;CNNs are widely used in:&lt;/p&gt;&lt;h3&gt;Computer Vision&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;face recognition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;image classification&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;object detection&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;h3&gt;Medical Imaging&lt;/h3&gt;&lt;p&gt;Detecting:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;tumors&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;fractures&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;cancer&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;h3&gt;Autonomous Vehicles&lt;/h3&gt;&lt;p&gt;Detect:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;pedestrians&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;traffic lights&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;road signs&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr&gt;&lt;h3&gt;Security Systems&lt;/h3&gt;&lt;p&gt;Facial authentication.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;20. Final Intuition (Simple Summary)&lt;/h1&gt;&lt;p&gt;A **Convolutional Neural Networks model works like a visual brain.&lt;/p&gt;&lt;p&gt;Step-by-step process:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Image
 ↓
Convolution → detect features
 ↓
ReLU → add nonlinearity
 ↓
Pooling → reduce size
 ↓
Convolution → detect complex patterns
 ↓
Flatten → convert to vector
 ↓
Fully Connected → decision making
 ↓
Softmax → output probabilities
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In essence:&lt;/p&gt;&lt;p&gt;CNN converts &lt;strong&gt;pixels into patterns → patterns into objects → objects into predictions&lt;/strong&gt;.&lt;/p&gt;&lt;hr&gt;&lt;p&gt;✅ &lt;strong&gt;One-line takeaway&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;A CNN learns visual patterns using &lt;strong&gt;kernels in convolution layers, compresses information through pooling, converts features through flattening, and finally classifies images using fully connected layers with Softmax probabilities.&lt;/strong&gt;&lt;/p&gt;&lt;hr&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/convolutional-neural-networks-cnn.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-7035145309201699977</guid><pubDate>Sun, 15 Mar 2026 04:30:19 +0000</pubDate><atom:updated>2026-03-14T21:30:19.153-07:00</atom:updated><title>Reinforcement Learning Explained: What It Is, How It Works, and Real-Life Examples</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Artificial Intelligence has transformed the way machines learn from data. Most people are familiar with &lt;strong&gt;supervised learning&lt;/strong&gt; and &lt;strong&gt;unsupervised learning&lt;/strong&gt;, but there is another powerful approach that enables machines to learn through &lt;strong&gt;trial and error&lt;/strong&gt; — this is called &lt;strong&gt;Reinforcement Learning (RL)&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Reinforcement Learning is the technology behind many modern breakthroughs such as &lt;strong&gt;robot learning, game-playing AI, autonomous vehicles, recommendation systems, and dynamic decision making&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;This article explains &lt;strong&gt;Reinforcement Learning in simple terms&lt;/strong&gt;, covering how it works, key concepts, real-world examples, and how it differs from other machine learning approaches.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;What is Reinforcement Learning?&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Reinforcement Learning is a machine learning technique where an agent learns how to make decisions by interacting with an environment and receiving rewards or penalties.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Instead of learning from labeled data, the system learns by &lt;strong&gt;trying different actions and observing the outcomes&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;In simple words:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Reinforcement Learning = Learning by Trial and Error&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The machine performs actions, receives feedback, and gradually improves its decisions.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Simple Real-Life Analogy&lt;/h1&gt;&lt;p&gt;Think about how a &lt;strong&gt;child learns to ride a bicycle&lt;/strong&gt;.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;The child tries to ride.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Sometimes they fall (negative feedback).&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Sometimes they maintain balance (positive feedback).&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Gradually they learn what works and what doesn&#39;t.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Eventually the child masters riding the bicycle.&lt;/p&gt;&lt;p&gt;This process is exactly how &lt;strong&gt;Reinforcement Learning works&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Core Components of Reinforcement Learning&lt;/h1&gt;&lt;p&gt;A Reinforcement Learning system contains &lt;strong&gt;five main elements&lt;/strong&gt;.&lt;/p&gt;&lt;h2&gt;1. Agent&lt;/h2&gt;&lt;p&gt;The &lt;strong&gt;agent&lt;/strong&gt; is the learner or decision maker.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;A robot learning to walk&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;A chess AI learning moves&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;A recommendation engine selecting movies&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The agent performs actions and learns from the results.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;2. Environment&lt;/h2&gt;&lt;p&gt;The &lt;strong&gt;environment&lt;/strong&gt; is the world in which the agent operates.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;A chess board&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;A video game&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;A stock market&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;A driving simulation&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The agent interacts with the environment and observes changes.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;3. State&lt;/h2&gt;&lt;p&gt;A &lt;strong&gt;state&lt;/strong&gt; represents the current situation of the environment.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;p&gt;Chess:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Position of all pieces on the board&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Self-driving car:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Speed&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Traffic&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Road conditions&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Game AI:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Player position&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Enemy locations&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The state tells the agent &lt;strong&gt;what the situation looks like right now&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;4. Action&lt;/h2&gt;&lt;p&gt;An &lt;strong&gt;action&lt;/strong&gt; is a decision made by the agent.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;p&gt;Chess AI:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Move pawn&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Move knight&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Robot:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Move forward&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Turn left&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Pick object&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Self-driving car:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Accelerate&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Brake&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Turn&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;5. Reward&lt;/h2&gt;&lt;p&gt;A &lt;strong&gt;reward&lt;/strong&gt; is feedback from the environment that tells the agent how good or bad an action was.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;p&gt;Game:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;+10 points for winning&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;-10 points for losing&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Robot:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;+1 for reaching target&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;-1 for collision&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Rewards guide the learning process.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;How Reinforcement Learning Works&lt;/h1&gt;&lt;p&gt;The Reinforcement Learning process happens in &lt;strong&gt;a continuous loop&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Step 1: The agent observes the &lt;strong&gt;current state&lt;/strong&gt;.&lt;br /&gt;Step 2: The agent chooses an &lt;strong&gt;action&lt;/strong&gt;.&lt;br /&gt;Step 3: The action affects the &lt;strong&gt;environment&lt;/strong&gt;.&lt;br /&gt;Step 4: The agent receives a &lt;strong&gt;reward or penalty&lt;/strong&gt;.&lt;br /&gt;Step 5: The agent updates its strategy.&lt;/p&gt;&lt;p&gt;Over many iterations, the agent learns which actions produce the &lt;strong&gt;highest rewards&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Reinforcement Learning Workflow&lt;/h1&gt;&lt;p&gt;The RL learning loop looks like this:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Agent → Action → Environment → Reward → Updated Knowledge → Next Action
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This cycle repeats thousands or millions of times.&lt;/p&gt;&lt;p&gt;Eventually the agent learns an &lt;strong&gt;optimal strategy&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Key Terms in Reinforcement Learning&lt;/h1&gt;&lt;p&gt;Understanding Reinforcement Learning requires familiarity with several important terms.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Policy&lt;/h2&gt;&lt;p&gt;A &lt;strong&gt;policy&lt;/strong&gt; is the strategy used by the agent to choose actions.&lt;/p&gt;&lt;p&gt;It answers the question:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&quot;What action should I take in this situation?&quot;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Policies can be:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Deterministic&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Probabilistic&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;Value Function&lt;/h2&gt;&lt;p&gt;The &lt;strong&gt;value function&lt;/strong&gt; measures how good a particular state is.&lt;/p&gt;&lt;p&gt;It estimates:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How much reward the agent can expect in the future.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This helps the agent choose better actions.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Q-Value (Quality Value)&lt;/h2&gt;&lt;p&gt;The &lt;strong&gt;Q-value&lt;/strong&gt; represents the expected reward for taking a specific action in a specific state.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;State: Traffic signal
Action: Accelerate
Q-value: Expected reward
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Algorithms like &lt;strong&gt;Q-Learning&lt;/strong&gt; use this concept.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Exploration vs Exploitation&lt;/h2&gt;&lt;p&gt;One of the biggest challenges in RL is deciding between:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Exploration&lt;/strong&gt;&lt;br /&gt;Trying new actions to discover better strategies.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Exploitation&lt;/strong&gt;&lt;br /&gt;Using the best known strategy.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;A restaurant recommendation system:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Explore new restaurants&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Exploit already liked restaurants&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Balancing both is critical.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;How Reward and Punishment Work in RL&lt;/h1&gt;&lt;p&gt;Reward and punishment guide the agent toward better behavior.&lt;/p&gt;&lt;p&gt;Think of them as &lt;strong&gt;numerical feedback signals&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Positive Reward&lt;/h2&gt;&lt;p&gt;Encourages desired actions.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Robot reaches destination → +10&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Game AI wins level → +50&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The agent learns that these actions are good.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Negative Reward (Punishment)&lt;/h2&gt;&lt;p&gt;Discourages bad actions.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Robot hits obstacle → -10&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Game character dies → -50&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The agent learns to avoid these actions.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Simple Example&lt;/h2&gt;&lt;p&gt;Imagine training a &lt;strong&gt;robot to exit a maze&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Actions:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Move forward&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Move left&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Move right&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Reward system:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Reaching exit → +100&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Hitting wall → -5&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Each step → -1&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Eventually the robot learns the &lt;strong&gt;shortest path to the exit&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Real-World Applications of Reinforcement Learning&lt;/h1&gt;&lt;p&gt;Reinforcement Learning powers many technologies we use today.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;1. Game AI&lt;/h2&gt;&lt;p&gt;RL achieved major breakthroughs in gaming.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Chess engines&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Go playing AI&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Video game agents&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Some systems have defeated world champions.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;2. Robotics&lt;/h2&gt;&lt;p&gt;Robots learn tasks through repeated interaction.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Walking robots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Warehouse automation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Robotic arms&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;3. Self-Driving Cars&lt;/h2&gt;&lt;p&gt;Autonomous vehicles learn how to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Navigate traffic&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Avoid obstacles&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Optimize driving behavior&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;4. Recommendation Systems&lt;/h2&gt;&lt;p&gt;Streaming platforms use RL to recommend:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Movies&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Music&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Videos&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The system learns what users prefer.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;5. Healthcare&lt;/h2&gt;&lt;p&gt;RL helps optimize:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Treatment strategies&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Drug dosage&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Patient monitoring systems&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;6. Finance&lt;/h2&gt;&lt;p&gt;Financial institutions use RL for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Portfolio optimization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Trading strategies&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Fraud detection&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;When Should You Use Reinforcement Learning?&lt;/h1&gt;&lt;p&gt;Reinforcement Learning is useful when:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;The system must make &lt;strong&gt;sequential decisions&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;There is &lt;strong&gt;no labeled dataset&lt;/strong&gt; available.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The system can &lt;strong&gt;interact with an environment&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Learning happens through &lt;strong&gt;feedback over time&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The goal is to &lt;strong&gt;maximize long-term reward&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Robotics&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Games&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Navigation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Resource allocation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Control systems&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;When Reinforcement Learning Is NOT Ideal&lt;/h1&gt;&lt;p&gt;RL may not be suitable when:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Immediate labeled data is available&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Training environments are expensive&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Real-world mistakes are dangerous&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The problem does not involve sequential decisions&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In such cases &lt;strong&gt;supervised learning may be better&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Reinforcement Learning vs Supervised Learning&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;/th&gt;&lt;th&gt;Reinforcement Learning&lt;/th&gt;&lt;th&gt;Supervised Learning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Training Data&lt;/td&gt;&lt;td&gt;No labeled data&lt;/td&gt;&lt;td&gt;Requires labeled data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Learning Style&lt;/td&gt;&lt;td&gt;Trial and error&lt;/td&gt;&lt;td&gt;Learning from examples&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Feedback&lt;/td&gt;&lt;td&gt;Reward or punishment&lt;/td&gt;&lt;td&gt;Correct labels&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Goal&lt;/td&gt;&lt;td&gt;Maximize long-term reward&lt;/td&gt;&lt;td&gt;Minimize prediction error&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Example&lt;/td&gt;&lt;td&gt;Game playing AI&lt;/td&gt;&lt;td&gt;Image classification&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Supervised Learning:&lt;br /&gt;Predict house price from past data.&lt;/p&gt;&lt;p&gt;Reinforcement Learning:&lt;br /&gt;Learn best strategy to play chess.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Reinforcement Learning vs Unsupervised Learning&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;/th&gt;&lt;th&gt;Reinforcement Learning&lt;/th&gt;&lt;th&gt;Unsupervised Learning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Feedback&lt;/td&gt;&lt;td&gt;Reward signals&lt;/td&gt;&lt;td&gt;No feedback&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Goal&lt;/td&gt;&lt;td&gt;Learn optimal actions&lt;/td&gt;&lt;td&gt;Discover patterns&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Data&lt;/td&gt;&lt;td&gt;Interaction based&lt;/td&gt;&lt;td&gt;Static dataset&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Examples&lt;/td&gt;&lt;td&gt;Robotics, games&lt;/td&gt;&lt;td&gt;Clustering, dimensionality reduction&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Unsupervised Learning:&lt;br /&gt;Group customers based on behavior.&lt;/p&gt;&lt;p&gt;Reinforcement Learning:&lt;br /&gt;Choose best advertisement to show each user.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Key Characteristics of Reinforcement Learning&lt;/h1&gt;&lt;p&gt;Reinforcement Learning has several distinctive properties.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;1. Learning by Interaction&lt;/h2&gt;&lt;p&gt;The agent learns by interacting with its environment.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;2. Sequential Decision Making&lt;/h2&gt;&lt;p&gt;Each action affects future states.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;3. Delayed Rewards&lt;/h2&gt;&lt;p&gt;Rewards may not be immediate.&lt;/p&gt;&lt;p&gt;Example:&lt;br /&gt;Winning a game after many moves.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;4. Exploration of Unknown Situations&lt;/h2&gt;&lt;p&gt;Agents must try new actions to discover better strategies.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;5. Long-Term Optimization&lt;/h2&gt;&lt;p&gt;The objective is to maximize &lt;strong&gt;cumulative reward over time&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Types of Reinforcement Learning Algorithms&lt;/h1&gt;&lt;p&gt;Some popular RL algorithms include:&lt;/p&gt;&lt;h3&gt;Q-Learning&lt;/h3&gt;&lt;p&gt;One of the most famous RL algorithms.&lt;/p&gt;&lt;p&gt;Learns the &lt;strong&gt;value of actions in states&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Deep Q Networks (DQN)&lt;/h3&gt;&lt;p&gt;Combines RL with &lt;strong&gt;deep neural networks&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Used for complex environments like games.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Policy Gradient Methods&lt;/h3&gt;&lt;p&gt;Directly optimize the policy.&lt;/p&gt;&lt;p&gt;Often used in &lt;strong&gt;robotics and control systems&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Actor-Critic Methods&lt;/h3&gt;&lt;p&gt;Combine value functions and policies.&lt;/p&gt;&lt;p&gt;Used in advanced RL systems.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Challenges in Reinforcement Learning&lt;/h1&gt;&lt;p&gt;Despite its power, RL has several challenges.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;1. High Training Time&lt;/h2&gt;&lt;p&gt;RL may require &lt;strong&gt;millions of interactions&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;2. Reward Design&lt;/h2&gt;&lt;p&gt;Poor reward design can lead to unexpected behavior.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;3. Exploration Problems&lt;/h2&gt;&lt;p&gt;Agents may struggle to discover optimal strategies.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;4. Real-World Safety&lt;/h2&gt;&lt;p&gt;Testing RL systems in real environments can be risky.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Future of Reinforcement Learning&lt;/h1&gt;&lt;p&gt;Reinforcement Learning is expected to play a major role in future AI systems.&lt;/p&gt;&lt;p&gt;Areas of rapid development include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Autonomous robotics&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Smart cities&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Industrial automation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Personalized medicine&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;AI assistants&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;As computing power increases, RL will become even more powerful.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Conclusion&lt;/h1&gt;&lt;p&gt;Reinforcement Learning represents one of the most exciting areas of Artificial Intelligence.&lt;/p&gt;&lt;p&gt;Unlike traditional machine learning approaches, RL allows systems to &lt;strong&gt;learn from experience&lt;/strong&gt;, much like humans and animals do.&lt;/p&gt;&lt;p&gt;By interacting with environments, receiving rewards, and adjusting strategies, RL agents gradually learn how to make optimal decisions.&lt;/p&gt;&lt;p&gt;From &lt;strong&gt;robotics and self-driving cars to recommendation engines and game AI&lt;/strong&gt;, Reinforcement Learning is shaping the future of intelligent machines.&lt;/p&gt;&lt;p&gt;Understanding this concept is essential for anyone exploring the world of &lt;strong&gt;machine learning, deep learning, and artificial intelligence&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/reinforcement-learning-explained-what.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-2052459544184217775</guid><pubDate>Sat, 14 Mar 2026 06:06:00 +0000</pubDate><atom:updated>2026-03-13T23:06:30.994-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AI Tutorial</category><category domain="http://www.blogger.com/atom/ns#">Deep Learning</category><category domain="http://www.blogger.com/atom/ns#">Forget Gate</category><category domain="http://www.blogger.com/atom/ns#">Input Gate</category><category domain="http://www.blogger.com/atom/ns#">Long Short-Term Memory</category><category domain="http://www.blogger.com/atom/ns#">LSTM Architecture</category><category domain="http://www.blogger.com/atom/ns#">LSTM Gates</category><category domain="http://www.blogger.com/atom/ns#">LSTM Tutorial</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks</category><category domain="http://www.blogger.com/atom/ns#">NLP</category><category domain="http://www.blogger.com/atom/ns#">Output Gate</category><category domain="http://www.blogger.com/atom/ns#">RNN vs LSTM</category><category domain="http://www.blogger.com/atom/ns#">Sequence Models</category><category domain="http://www.blogger.com/atom/ns#">Time Series</category><title>Long Short-Term Memory (LSTM): A Complete Beginner-Friendly Guide</title><description>&lt;p&gt;&lt;/p&gt;&lt;h1&gt;&lt;br /&gt;&lt;/h1&gt;&lt;p&gt;&lt;em&gt;A deep explanation of LSTM architecture, gates, memory cells, and sequence learning&lt;/em&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. Introduction&lt;/h1&gt;&lt;p&gt;When dealing with &lt;strong&gt;sequential data&lt;/strong&gt;, traditional neural networks struggle because they cannot remember previous information.&lt;/p&gt;&lt;p&gt;To solve this problem, researchers introduced &lt;strong&gt;Recurrent Neural Networks (RNNs)&lt;/strong&gt;, which allow information to flow from one time step to the next.&lt;/p&gt;&lt;p&gt;However, simple RNNs suffer from a major issue called the &lt;strong&gt;vanishing gradient problem&lt;/strong&gt;, which makes it difficult to learn &lt;strong&gt;long-term dependencies&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;To overcome this limitation, a more advanced architecture called &lt;strong&gt;Long Short-Term Memory (LSTM)&lt;/strong&gt; was developed.&lt;/p&gt;&lt;p&gt;LSTM networks are designed to &lt;strong&gt;remember important information for long periods of time&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;They are widely used in:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;language translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;speech recognition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;chatbots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;text generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;stock prediction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;music generation&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;LSTMs became the &lt;strong&gt;dominant sequence learning model&lt;/strong&gt; before modern &lt;strong&gt;Transformer&lt;/strong&gt; architectures emerged.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. Why Do We Need LSTM?&lt;/h1&gt;&lt;p&gt;To understand why LSTM is important, consider this sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“I grew up in France… I speak fluent French.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;To understand the final word &lt;strong&gt;“French”&lt;/strong&gt;, the model must remember &lt;strong&gt;“France”&lt;/strong&gt; from earlier in the sentence.&lt;/p&gt;&lt;p&gt;A simple RNN often &lt;strong&gt;forgets long-term context&lt;/strong&gt;, especially in long sequences.&lt;/p&gt;&lt;p&gt;LSTM solves this by introducing a &lt;strong&gt;memory cell that can store information for long periods&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. Intuition Behind LSTM&lt;/h1&gt;&lt;p&gt;Think of LSTM like a &lt;strong&gt;smart memory system&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;It decides:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;what information to &lt;strong&gt;store&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;what information to &lt;strong&gt;forget&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;what information to &lt;strong&gt;output&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This decision-making is done using special components called &lt;strong&gt;gates&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;These gates control how information flows through the network.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;4. Basic LSTM Architecture&lt;/h1&gt;&lt;p&gt;An LSTM cell consists of:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Cell State (memory)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Hidden State&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Three Gates&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Main components:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input → LSTM Cell → Output
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Inside each cell:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Forget Gate
Input Gate
Cell State
Output Gate
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;These gates help the network &lt;strong&gt;control memory flow&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;5. Key Components of LSTM&lt;/h1&gt;&lt;p&gt;Let’s understand the main components.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. Cell State (The Long-Term Memory)&lt;/h1&gt;&lt;p&gt;The &lt;strong&gt;cell state&lt;/strong&gt; is the main memory of the LSTM.&lt;/p&gt;&lt;p&gt;It carries information across many time steps.&lt;/p&gt;&lt;p&gt;Think of it as a &lt;strong&gt;highway where information flows continuously&lt;/strong&gt;.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Past Memory → Current Memory → Future Memory
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The gates regulate what information enters or leaves this memory.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. Hidden State&lt;/h1&gt;&lt;p&gt;The &lt;strong&gt;hidden state&lt;/strong&gt; is the output of the LSTM at each time step.&lt;/p&gt;&lt;p&gt;It represents the &lt;strong&gt;current understanding of the sequence&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;It is passed to the next step along with the cell state.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;6. The Three Gates of LSTM&lt;/h1&gt;&lt;p&gt;LSTM uses &lt;strong&gt;three gates&lt;/strong&gt; to control memory.&lt;/p&gt;&lt;p&gt;1️⃣ Forget Gate&lt;br /&gt;2️⃣ Input Gate&lt;br /&gt;3️⃣ Output Gate&lt;/p&gt;&lt;p&gt;These gates use &lt;strong&gt;sigmoid activation&lt;/strong&gt;, producing values between &lt;strong&gt;0 and 1&lt;/strong&gt;.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;0 → forget completely
1 → keep completely
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;7. Forget Gate&lt;/h1&gt;&lt;p&gt;The &lt;strong&gt;forget gate&lt;/strong&gt; decides what information should be removed from memory.&lt;/p&gt;&lt;p&gt;Formula:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;ft = σ(Wf · [ht-1 , xt] + bf)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;xt = current input&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;ht-1 = previous hidden state&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;σ = sigmoid function&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The movie was great but the ending was terrible
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When processing &lt;strong&gt;“ending”&lt;/strong&gt;, the model may forget earlier irrelevant details.&lt;/p&gt;&lt;p&gt;Thus the forget gate removes unnecessary memory.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;8. Input Gate&lt;/h1&gt;&lt;p&gt;The &lt;strong&gt;input gate&lt;/strong&gt; decides what new information should be added to memory.&lt;/p&gt;&lt;p&gt;Two operations occur:&lt;/p&gt;&lt;p&gt;Step 1: Determine what information to update.&lt;/p&gt;&lt;p&gt;Step 2: Create candidate memory values.&lt;/p&gt;&lt;p&gt;Formula:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;it = σ(Wi · [ht-1 , xt] + bi)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Candidate memory:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;C̃t = tanh(Wc · [ht-1 , xt] + bc)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The cell state is then updated.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;9. Updating Cell State&lt;/h1&gt;&lt;p&gt;The cell state is updated using both forget and input gates.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Ct = ft * Ct-1 + it * C̃t
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Meaning:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;forget irrelevant information&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;add useful new information&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This mechanism allows LSTM to &lt;strong&gt;maintain long-term memory&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;10. Output Gate&lt;/h1&gt;&lt;p&gt;The &lt;strong&gt;output gate&lt;/strong&gt; decides what information should be sent as output.&lt;/p&gt;&lt;p&gt;Formula:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;ot = σ(Wo · [ht-1 , xt] + bo)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Hidden state output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;ht = ot * tanh(Ct)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This hidden state becomes the input for the &lt;strong&gt;next time step&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;11. Complete LSTM Flow&lt;/h1&gt;&lt;p&gt;At each time step, the following steps occur:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input (xt)
      ↓
Forget Gate
      ↓
Input Gate
      ↓
Update Cell State
      ↓
Output Gate
      ↓
Hidden State (ht)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This sequence repeats for each element in the input sequence.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;12. Example: Sentence Processing&lt;/h1&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The food at this restaurant is amazing
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Processing step-by-step:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Step&lt;/th&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Memory&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;The&lt;/td&gt;&lt;td&gt;neutral&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;food&lt;/td&gt;&lt;td&gt;context&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;restaurant&lt;/td&gt;&lt;td&gt;topic&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;amazing&lt;/td&gt;&lt;td&gt;positive sentiment&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Final output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Positive sentiment
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The LSTM remembers important words across the sentence.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;13. Example: Predicting Next Word&lt;/h1&gt;&lt;p&gt;Training sequence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I love machine learning
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Input-output pairs:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Input&lt;/th&gt;&lt;th&gt;Target&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;I&lt;/td&gt;&lt;td&gt;love&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;love&lt;/td&gt;&lt;td&gt;machine&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;machine&lt;/td&gt;&lt;td&gt;learning&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;The LSTM learns to &lt;strong&gt;predict the next word&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example prediction:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I love → machine
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;14. Visual Understanding of LSTM&lt;/h1&gt;&lt;p&gt;Conceptually an LSTM cell looks like this:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;           Previous Memory
                ↓
         ┌───────────────┐
Input →  │  LSTM CELL    │ → Output
         └───────────────┘
                ↓
           Updated Memory
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Inside the cell:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Forget Gate
Input Gate
Output Gate
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each gate decides how memory changes.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;15. Why LSTM Solves the Vanishing Gradient Problem&lt;/h1&gt;&lt;p&gt;Simple RNN repeatedly multiplies gradients during training.&lt;/p&gt;&lt;p&gt;Over long sequences:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Gradient → very small
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So earlier words stop influencing the result.&lt;/p&gt;&lt;p&gt;LSTM avoids this problem because:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;cell state provides &lt;strong&gt;direct gradient flow&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;gates regulate information carefully&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Thus long dependencies are preserved.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;16. Real-Life Analogy&lt;/h1&gt;&lt;p&gt;Imagine writing notes in a notebook while studying.&lt;/p&gt;&lt;p&gt;You:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;erase irrelevant notes (forget gate)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;write important points (input gate)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;read relevant notes when answering questions (output gate)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This is exactly how LSTM manages information.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;17. Applications of LSTM&lt;/h1&gt;&lt;p&gt;LSTMs are used in many real-world AI systems.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Natural Language Processing&lt;/h2&gt;&lt;p&gt;Used for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;language translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;chatbots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;text generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;summarization&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;Speech Recognition&lt;/h2&gt;&lt;p&gt;Used in voice assistants to convert speech to text.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Time Series Forecasting&lt;/h2&gt;&lt;p&gt;Used for predicting:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;stock prices&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;weather patterns&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;electricity demand&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;Music Generation&lt;/h2&gt;&lt;p&gt;LSTM models can learn musical sequences and generate melodies.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Video Analysis&lt;/h2&gt;&lt;p&gt;Used for analyzing sequences of frames in videos.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;18. Example: Machine Translation&lt;/h1&gt;&lt;p&gt;Input sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I love AI
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;LSTM translation:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Je aime IA
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Sequence-to-sequence models use:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Encoder LSTM
Decoder LSTM
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This architecture powers early translation systems.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;19. LSTM vs RNN&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;/th&gt;&lt;th&gt;RNN&lt;/th&gt;&lt;th&gt;LSTM&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Memory&lt;/td&gt;&lt;td&gt;short-term&lt;/td&gt;&lt;td&gt;long-term&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Vanishing gradient&lt;/td&gt;&lt;td&gt;severe&lt;/td&gt;&lt;td&gt;reduced&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Complexity&lt;/td&gt;&lt;td&gt;simple&lt;/td&gt;&lt;td&gt;more complex&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Performance&lt;/td&gt;&lt;td&gt;limited&lt;/td&gt;&lt;td&gt;better&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Thus LSTM is an &lt;strong&gt;improved version of RNN&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;20. Limitations of LSTM&lt;/h1&gt;&lt;p&gt;Despite its strengths, LSTM has limitations.&lt;/p&gt;&lt;h3&gt;Slow Training&lt;/h3&gt;&lt;p&gt;Sequential computation prevents parallel processing.&lt;/p&gt;&lt;h3&gt;Complex Architecture&lt;/h3&gt;&lt;p&gt;Multiple gates increase computational cost.&lt;/p&gt;&lt;h3&gt;Replaced by Transformers&lt;/h3&gt;&lt;p&gt;Modern NLP models prefer **Transformer architectures.&lt;/p&gt;&lt;p&gt;However LSTM is still widely used in &lt;strong&gt;time series forecasting&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;21. Workflow of an LSTM Model&lt;/h1&gt;&lt;p&gt;Complete flow:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input Sequence
      ↓
Embedding Layer
      ↓
LSTM Layer
      ↓
Hidden States
      ↓
Dense Layer
      ↓
Softmax Output
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Sentence → Sentiment Prediction
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;22. Practical Example&lt;/h1&gt;&lt;p&gt;Input sequence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The movie was absolutely fantastic
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Processing:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The → LSTM
movie → LSTM
was → LSTM
fantastic → LSTM
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Positive sentiment
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The model remembers context across the sentence.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;23. Modern Relevance&lt;/h1&gt;&lt;p&gt;Even though **Transformer models dominate NLP today, LSTM remains important for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;time series prediction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;sequential sensor data&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;embedded AI systems&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Understanding LSTM helps learners grasp &lt;strong&gt;how neural networks manage memory&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;24. Summary&lt;/h1&gt;&lt;p&gt;The **Long Short-Term Memory network is an advanced sequence model that improves upon RNN by introducing gated memory mechanisms.&lt;/p&gt;&lt;p&gt;Key ideas:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;memory cell stores long-term information&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;gates regulate information flow&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;prevents vanishing gradient problem&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Workflow:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input
 ↓
Forget Gate
 ↓
Input Gate
 ↓
Cell State Update
 ↓
Output Gate
 ↓
Prediction
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;Final Takeaway&lt;/h1&gt;&lt;p&gt;LSTM networks revolutionized sequence modeling by allowing neural networks to &lt;strong&gt;remember important information across long sequences&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;They form the conceptual bridge between early sequence models like **Recurrent Neural Networks and modern architectures like &lt;strong&gt;Transformer&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/long-short-term-memory-lstm-complete.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-4901372568168653203</guid><pubDate>Sat, 14 Mar 2026 05:55:25 +0000</pubDate><atom:updated>2026-03-13T22:55:25.447-07:00</atom:updated><title>Recurrent Neural Networks (RNN): A Complete Beginner-Friendly Guide</title><description>&lt;p&gt;&lt;em&gt;A detailed explanation of RNN architecture, working, layers, hidden states, training, and real-world examples&lt;/em&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. Introduction to Recurrent Neural Networks&lt;/h1&gt;&lt;p&gt;In many machine learning problems, &lt;strong&gt;data is sequential&lt;/strong&gt; rather than independent.&lt;/p&gt;&lt;p&gt;Examples of sequential data:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Sentences in language&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Words in a paragraph&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Stock market prices over time&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Audio signals in speech&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Video frames&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Traditional neural networks treat every input &lt;strong&gt;independently&lt;/strong&gt;, which means they cannot understand &lt;strong&gt;context or order&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;To solve this problem, researchers developed &lt;strong&gt;Recurrent Neural Networks (RNNs)&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;RNNs are neural networks designed specifically for &lt;strong&gt;sequence learning&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;They are widely used in:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;language translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;speech recognition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;text generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;sentiment analysis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;chatbots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;handwriting recognition&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Before modern transformer models became popular, RNNs were the backbone of many natural language processing systems.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. Why Traditional Neural Networks Cannot Handle Sequences&lt;/h1&gt;&lt;p&gt;Imagine the sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“The movie was not good.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;If a model analyzes each word independently, it might interpret:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;“good” → positive sentiment&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;But the real sentiment is &lt;strong&gt;negative&lt;/strong&gt; because of the word &lt;strong&gt;“not”&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Understanding language requires &lt;strong&gt;context from previous words&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Traditional neural networks cannot remember previous inputs.&lt;/p&gt;&lt;p&gt;RNNs solve this by introducing &lt;strong&gt;memory&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. Key Idea Behind RNN&lt;/h1&gt;&lt;p&gt;The core idea of an RNN is &lt;strong&gt;recurrence&lt;/strong&gt;, meaning the output from a previous step is fed back into the network.&lt;/p&gt;&lt;p&gt;In other words:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Previous Information + Current Input → Current Output
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This allows the network to &lt;strong&gt;remember past information&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;For example, while reading a sentence:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;The cat sat on the mat
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When the model reaches &lt;strong&gt;“mat”&lt;/strong&gt;, it still remembers &lt;strong&gt;“cat”&lt;/strong&gt; and &lt;strong&gt;“sat”&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;4. Basic Architecture of RNN&lt;/h1&gt;&lt;p&gt;A simple RNN architecture looks like this:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input (xₜ)
     ↓
Hidden State (hₜ)
     ↓
Output (yₜ)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;xₜ&lt;/strong&gt; = input at time step t&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;hₜ&lt;/strong&gt; = hidden state (memory)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;yₜ&lt;/strong&gt; = output&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The hidden state carries information from &lt;strong&gt;previous steps&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;5. Unfolded View of RNN&lt;/h1&gt;&lt;p&gt;Although RNN is drawn as a loop, it actually operates across time steps.&lt;/p&gt;&lt;h3&gt;RNN Unrolled Over Time&lt;/h3&gt;&lt;pre&gt;&lt;code&gt;x1 → [RNN] → y1
       ↓
x2 → [RNN] → y2
       ↓
x3 → [RNN] → y3
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each step shares the &lt;strong&gt;same weights&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;This process is called &lt;strong&gt;parameter sharing&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;6. Hidden State (The Memory of RNN)&lt;/h1&gt;&lt;p&gt;The hidden state stores information from previous inputs.&lt;/p&gt;&lt;p&gt;Mathematically:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;h_t = f(W_x x_t + W_h h_{t-1} + b)&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;(h_t) = current hidden state&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;(h_{t-1}) = previous hidden state&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;(x_t) = current input&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;(W_x, W_h) = weights&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;(b) = bias&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Function (f) is usually &lt;strong&gt;tanh&lt;/strong&gt; or &lt;strong&gt;ReLU&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;This formula shows that the current state depends on:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;current input&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;previous memory&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;7. Simple Example: Sentence Processing&lt;/h1&gt;&lt;p&gt;Suppose we process the sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I love machine learning
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Step-by-step RNN processing:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Time Step&lt;/th&gt;&lt;th&gt;Input&lt;/th&gt;&lt;th&gt;Memory&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;t1&lt;/td&gt;&lt;td&gt;I&lt;/td&gt;&lt;td&gt;remembers subject&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;t2&lt;/td&gt;&lt;td&gt;love&lt;/td&gt;&lt;td&gt;remembers action&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;t3&lt;/td&gt;&lt;td&gt;machine&lt;/td&gt;&lt;td&gt;context builds&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;t4&lt;/td&gt;&lt;td&gt;learning&lt;/td&gt;&lt;td&gt;final meaning&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;RNN gradually builds &lt;strong&gt;context&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;8. Example: Predicting Next Word&lt;/h1&gt;&lt;p&gt;RNNs are commonly used for &lt;strong&gt;language modeling&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example training data:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I love machine learning
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Input-output pairs:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Input&lt;/th&gt;&lt;th&gt;Target&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;I&lt;/td&gt;&lt;td&gt;love&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;love&lt;/td&gt;&lt;td&gt;machine&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;machine&lt;/td&gt;&lt;td&gt;learning&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;The model learns to &lt;strong&gt;predict the next word&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;9. Types of RNN Architectures&lt;/h1&gt;&lt;p&gt;RNNs support different input-output structures.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;1. One-to-One&lt;/h2&gt;&lt;p&gt;Traditional neural network.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Image → Label
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;2. One-to-Many&lt;/h2&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Image → Caption
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Used in &lt;strong&gt;image captioning&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;3. Many-to-One&lt;/h2&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Sentence → Sentiment
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Used in &lt;strong&gt;sentiment analysis&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;4. Many-to-Many&lt;/h2&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;English sentence → French sentence
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Used in &lt;strong&gt;machine translation&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;10. Example Diagram of RNN Processing&lt;/h1&gt;&lt;p&gt;Imagine predicting sentiment:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;This movie is fantastic
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Processing:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;This → RNN
movie → RNN
is → RNN
fantastic → RNN
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Final output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Positive sentiment
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;11. Activation Functions in RNN&lt;/h1&gt;&lt;p&gt;RNN commonly uses:&lt;/p&gt;&lt;h3&gt;Tanh&lt;/h3&gt;&lt;p&gt;[&lt;br /&gt;tanh(x)&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Output range:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;-1 to 1
&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Sigmoid&lt;/h3&gt;&lt;p&gt;[&lt;br /&gt;σ(x)&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Output range:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;0 to 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;These functions help control &lt;strong&gt;information flow&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;12. Training RNN: Backpropagation Through Time&lt;/h1&gt;&lt;p&gt;RNN is trained using a technique called &lt;strong&gt;Backpropagation Through Time (BPTT)&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Idea:&lt;/p&gt;&lt;p&gt;Instead of backpropagating through layers, we backpropagate &lt;strong&gt;through time steps&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;x1 → x2 → x3 → x4
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Errors propagate backward:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;x4 ← x3 ← x2 ← x1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This allows earlier steps to receive learning signals.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;13. Problem: Vanishing Gradient&lt;/h1&gt;&lt;p&gt;A major issue in RNN training is the &lt;strong&gt;vanishing gradient problem&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;During training:&lt;/p&gt;&lt;p&gt;Gradients become extremely small.&lt;/p&gt;&lt;p&gt;As a result:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;early inputs stop influencing output&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;long-term memory is lost&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The movie that I watched last week with my friends was amazing
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The word &lt;strong&gt;“movie”&lt;/strong&gt; is far from &lt;strong&gt;“amazing”&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Simple RNN struggles to remember it.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;14. Solution: LSTM Networks&lt;/h1&gt;&lt;p&gt;To solve this, researchers introduced **Long Short-Term Memory networks.&lt;/p&gt;&lt;p&gt;LSTM introduces &lt;strong&gt;gates&lt;/strong&gt; to control memory.&lt;/p&gt;&lt;p&gt;Types of gates:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Forget gate&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Input gate&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Output gate&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These allow the network to remember &lt;strong&gt;important information for long periods&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;15. Gated Recurrent Unit (GRU)&lt;/h1&gt;&lt;p&gt;Another improvement is &lt;strong&gt;Gated Recurrent Unit (GRU)&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;GRU simplifies LSTM while retaining performance.&lt;/p&gt;&lt;p&gt;Advantages:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;fewer parameters&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;faster training&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;comparable accuracy&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;16. Real-Life Analogy of RNN&lt;/h1&gt;&lt;p&gt;Imagine reading a book.&lt;/p&gt;&lt;p&gt;When you read chapter 10, you still remember events from chapter 1.&lt;/p&gt;&lt;p&gt;Your brain maintains &lt;strong&gt;context&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;RNN works similarly.&lt;/p&gt;&lt;p&gt;It maintains &lt;strong&gt;memory across sequence steps&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;17. Example: Sentiment Analysis&lt;/h1&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The product is not good
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;RNN processes:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Memory&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;The&lt;/td&gt;&lt;td&gt;neutral&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;product&lt;/td&gt;&lt;td&gt;context&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;is&lt;/td&gt;&lt;td&gt;structure&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;not&lt;/td&gt;&lt;td&gt;negative signal&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;good&lt;/td&gt;&lt;td&gt;final sentiment&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Final prediction:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Negative
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;18. Example: Language Translation&lt;/h1&gt;&lt;p&gt;Input:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I love AI
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;RNN translation:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I → Je
love → aime
AI → IA
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Je aime IA
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Sequence-to-sequence models use &lt;strong&gt;two RNNs&lt;/strong&gt;:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Encoder&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Decoder&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h1&gt;19. Applications of RNN&lt;/h1&gt;&lt;p&gt;RNNs are widely used in many domains.&lt;/p&gt;&lt;h3&gt;Natural Language Processing&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;chatbots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;summarization&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Speech Recognition&lt;/h3&gt;&lt;p&gt;Converting speech into text.&lt;/p&gt;&lt;p&gt;Used in voice assistants.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Time Series Prediction&lt;/h3&gt;&lt;p&gt;Predicting:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;stock prices&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;weather&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;demand forecasting&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Video Processing&lt;/h3&gt;&lt;p&gt;Analyzing video frames sequentially.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;20. Comparison: CNN vs RNN&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;/th&gt;&lt;th&gt;CNN&lt;/th&gt;&lt;th&gt;RNN&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Data Type&lt;/td&gt;&lt;td&gt;images&lt;/td&gt;&lt;td&gt;sequences&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Memory&lt;/td&gt;&lt;td&gt;none&lt;/td&gt;&lt;td&gt;remembers past&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Architecture&lt;/td&gt;&lt;td&gt;convolution&lt;/td&gt;&lt;td&gt;recurrent&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Applications&lt;/td&gt;&lt;td&gt;vision&lt;/td&gt;&lt;td&gt;language&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;CNN extracts &lt;strong&gt;spatial features&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;RNN extracts &lt;strong&gt;temporal features&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;21. Example Workflow: Text Prediction&lt;/h1&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I want to eat
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;RNN predicts:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;pizza
food
dinner
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This capability enabled early &lt;strong&gt;text generation systems&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;22. Limitations of RNN&lt;/h1&gt;&lt;p&gt;Despite their usefulness, RNNs have limitations.&lt;/p&gt;&lt;h3&gt;Slow Training&lt;/h3&gt;&lt;p&gt;Sequential nature prevents parallel computation.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Difficulty with Long Context&lt;/h3&gt;&lt;p&gt;Simple RNN struggles with long dependencies.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Vanishing Gradient&lt;/h3&gt;&lt;p&gt;Gradients shrink during training.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;23. Evolution Beyond RNN&lt;/h1&gt;&lt;p&gt;Modern NLP systems now use **Transformer architectures.&lt;/p&gt;&lt;p&gt;Transformers handle long-range dependencies better and train faster.&lt;/p&gt;&lt;p&gt;Models like &lt;strong&gt;ChatGPT&lt;/strong&gt; and &lt;strong&gt;BERT&lt;/strong&gt; are based on transformers.&lt;/p&gt;&lt;p&gt;However, understanding RNN remains important because it introduced key ideas about &lt;strong&gt;sequence learning&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;24. Summary of RNN Workflow&lt;/h1&gt;&lt;p&gt;Complete process:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input Sequence
      ↓
Embedding
      ↓
RNN Layer
      ↓
Hidden States
      ↓
Dense Layer
      ↓
Softmax Output
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Prediction example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Word → next word probability
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;25. Final Intuition&lt;/h1&gt;&lt;p&gt;A **Recurrent Neural Networks model works like a system with memory.&lt;/p&gt;&lt;p&gt;It processes data &lt;strong&gt;step-by-step&lt;/strong&gt; while remembering previous inputs.&lt;/p&gt;&lt;p&gt;In essence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Current Input + Past Memory → Current Prediction
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This ability to remember past information makes RNN ideal for &lt;strong&gt;sequential data problems&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Final Takeaway&lt;/h1&gt;&lt;p&gt;RNNs revolutionized sequence modeling by introducing &lt;strong&gt;memory into neural networks&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;They laid the foundation for modern NLP and inspired advanced architectures like **Long Short-Term Memory, Gated Recurrent Unit, and eventually the &lt;strong&gt;Transformer&lt;/strong&gt; models that power today&#39;s large language systems.&lt;/p&gt;&lt;br /&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/recurrent-neural-networks-rnn-complete.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-2934679657422544034</guid><pubDate>Fri, 13 Mar 2026 11:36:00 +0000</pubDate><atom:updated>2026-03-13T04:36:04.201-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AI Language Models</category><category domain="http://www.blogger.com/atom/ns#">BERT Explained</category><category domain="http://www.blogger.com/atom/ns#">ChatGPT Architecture</category><category domain="http://www.blogger.com/atom/ns#">Generative AI Guide</category><category domain="http://www.blogger.com/atom/ns#">GPT Explained</category><category domain="http://www.blogger.com/atom/ns#">Large Language Models</category><category domain="http://www.blogger.com/atom/ns#">Natural Language Processing</category><category domain="http://www.blogger.com/atom/ns#">NLP Deep Learning</category><category domain="http://www.blogger.com/atom/ns#">Self Attention Mechanism</category><category domain="http://www.blogger.com/atom/ns#">Transformer Models</category><title>How ChatGPT Actually Works: From Tokens to Transformers to Large Language Models</title><description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1&gt;&lt;br /&gt;&lt;/h1&gt;&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p&gt;Artificial intelligence has entered a new era with the emergence of conversational systems capable of understanding and generating human-like language. One of the most widely known systems in this category is ChatGPT, which is powered by the GPT family of large language models.&lt;/p&gt;&lt;p&gt;While millions of people interact with ChatGPT daily for writing, coding, learning, and problem-solving, many still wonder how such systems actually work. How does an AI system read a question, understand the context, and generate meaningful responses that often feel intelligent?&lt;/p&gt;&lt;p&gt;The answer lies in a combination of breakthroughs in &lt;strong&gt;Natural Language Processing (NLP)&lt;/strong&gt;, deep learning, and the transformer architecture. ChatGPT is not a simple chatbot with predefined responses; instead, it is a sophisticated neural network trained on massive datasets to model patterns in human language.&lt;/p&gt;&lt;p&gt;This article explains the inner workings of ChatGPT in a clear and structured way, starting from the fundamental building blocks of text processing and moving toward advanced concepts such as transformers and large language models.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Understanding Natural Language Processing&lt;/h1&gt;&lt;p&gt;At its core, ChatGPT is built on the principles of &lt;strong&gt;Natural Language Processing&lt;/strong&gt;, a branch of artificial intelligence focused on enabling computers to understand and generate human language.&lt;/p&gt;&lt;p&gt;Natural language is complex and ambiguous. Words often have multiple meanings depending on context. Sentence structures vary widely, and grammar rules are not always consistent. For computers, interpreting language requires converting raw text into structured numerical representations that machine learning models can process.&lt;/p&gt;&lt;p&gt;Traditional NLP systems relied on rule-based methods and statistical models. Techniques like Bag-of-Words and TF-IDF represented text using word frequency counts, but these methods lacked the ability to capture deeper meaning and context.&lt;/p&gt;&lt;p&gt;The rise of deep learning transformed NLP by allowing neural networks to learn complex relationships between words and sentences. Instead of relying solely on handcrafted features, models began learning representations directly from large text datasets.&lt;/p&gt;&lt;p&gt;This shift paved the way for modern architectures such as transformers and large language models.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;The First Step: Tokenization&lt;/h1&gt;&lt;p&gt;Before any machine learning model can process text, the text must be converted into smaller units known as &lt;strong&gt;tokens&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Tokenization is the process of breaking text into pieces that a model can analyze. Depending on the system, tokens may represent words, subwords, or even individual characters.&lt;/p&gt;&lt;p&gt;For example, the sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Artificial intelligence is transforming technology.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;may be tokenized as:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[&quot;Artificial&quot;, &quot;intelligence&quot;, &quot;is&quot;, &quot;transforming&quot;, &quot;technology&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;However, modern language models often use &lt;strong&gt;subword tokenization&lt;/strong&gt;, where words are split into smaller components. This allows models to handle rare or unseen words effectively.&lt;/p&gt;&lt;p&gt;Once tokenized, each token is mapped to a unique numerical identifier from the model’s vocabulary.&lt;/p&gt;&lt;p&gt;This numerical representation becomes the input to the neural network.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Turning Words into Numbers: Word Embeddings&lt;/h1&gt;&lt;p&gt;Machines cannot understand raw text. They require numerical representations that capture semantic relationships between words. This is where &lt;strong&gt;word embeddings&lt;/strong&gt; come into play.&lt;/p&gt;&lt;p&gt;Word embeddings convert tokens into vectors — lists of numbers representing a word in a high-dimensional space.&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&quot;king&quot; → [0.21, -0.34, 0.76, ...]
&quot;queen&quot; → [0.19, -0.31, 0.80, ...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Words with similar meanings tend to have similar vector representations. In many embedding models, mathematical relationships emerge naturally:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;king - man + woman ≈ queen
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This property allows models to capture semantic meaning rather than simply memorizing word frequencies.&lt;/p&gt;&lt;p&gt;Early embedding models such as Word2Vec and GloVe laid the foundation for deeper language understanding, but they had limitations. Each word had a single vector regardless of context. For instance, the word &quot;bank&quot; would have the same representation whether referring to a financial institution or a riverbank.&lt;/p&gt;&lt;p&gt;Modern transformer models solve this limitation by generating &lt;strong&gt;contextual embeddings&lt;/strong&gt;, meaning the vector representation of a word changes depending on the surrounding text.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;The Rise of Neural Networks for Language&lt;/h1&gt;&lt;p&gt;As NLP evolved, researchers began using neural networks to model language sequences.&lt;/p&gt;&lt;p&gt;One of the earliest architectures used for sequential data was the &lt;strong&gt;Recurrent Neural Network (RNN)&lt;/strong&gt;. RNNs process text one word at a time while maintaining a hidden state that carries information from previous words.&lt;/p&gt;&lt;p&gt;For example, in the sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The cat sat on the mat
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;the model processes words sequentially:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The → cat → sat → on → the → mat
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;While RNNs allowed models to capture sequential dependencies, they struggled with long sentences because earlier information could gradually fade away during processing.&lt;/p&gt;&lt;p&gt;Variants such as Long Short-Term Memory (LSTM) networks improved the ability to retain long-term dependencies, but they still processed sequences sequentially, which limited training efficiency.&lt;/p&gt;&lt;p&gt;The need for a more scalable architecture led to a major breakthrough.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;The Transformer Revolution&lt;/h1&gt;&lt;p&gt;In 2017, researchers introduced a new neural architecture known as the &lt;strong&gt;transformer&lt;/strong&gt;, described in the influential paper &quot;Attention Is All You Need.&quot;&lt;/p&gt;&lt;p&gt;Transformers changed the way language models process text by eliminating sequential processing entirely. Instead of reading words one at a time, transformers analyze the entire sentence simultaneously using a mechanism called &lt;strong&gt;self-attention&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;This design enables models to capture relationships between all words in a sentence regardless of their distance.&lt;/p&gt;&lt;p&gt;For example, consider the sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The animal didn&#39;t cross the road because it was tired.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To interpret the sentence correctly, the model must understand that &quot;it&quot; refers to &quot;animal.&quot; Self-attention allows the model to connect these related words even though they appear far apart in the sentence.&lt;/p&gt;&lt;p&gt;The transformer architecture consists of two main components:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;an &lt;strong&gt;encoder&lt;/strong&gt;, which processes input text&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;a &lt;strong&gt;decoder&lt;/strong&gt;, which generates output text&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Different models use these components in different ways.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Self-Attention: The Core Idea&lt;/h1&gt;&lt;p&gt;Self-attention is the mechanism that allows transformers to determine which words in a sentence are most relevant to one another.&lt;/p&gt;&lt;p&gt;Each word in the input sequence generates three vectors:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Query&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Key&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Value&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These vectors are used to calculate attention scores between words.&lt;/p&gt;&lt;p&gt;In simple terms, the model asks:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&quot;How much attention should this word pay to other words in the sentence?&quot;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;If two words are strongly related, their attention score becomes higher.&lt;/p&gt;&lt;p&gt;The attention scores are then normalized using the softmax function and used to compute new contextual representations of each word.&lt;/p&gt;&lt;p&gt;This process allows the model to understand complex relationships in language, such as grammatical dependencies and semantic connections.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Multi-Head Attention&lt;/h1&gt;&lt;p&gt;Transformers extend the attention mechanism through &lt;strong&gt;multi-head attention&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Instead of computing a single attention distribution, the model calculates multiple attention patterns simultaneously. Each attention head focuses on different aspects of the sentence.&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;one head may capture grammatical structure&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;another may focus on semantic similarity&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;another may track subject–verb relationships&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;By combining multiple perspectives, the model forms richer contextual representations.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Positional Encoding&lt;/h1&gt;&lt;p&gt;Since transformers process words in parallel rather than sequentially, they require an additional mechanism to capture word order.&lt;/p&gt;&lt;p&gt;This is achieved through &lt;strong&gt;positional encoding&lt;/strong&gt;, which injects information about the position of each token within the sequence.&lt;/p&gt;&lt;p&gt;Without positional encoding, the model would treat sentences like:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Dogs chase cats
Cats chase dogs
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;as identical because they contain the same words.&lt;/p&gt;&lt;p&gt;Positional encoding ensures that the model understands the difference in structure and meaning.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Pretraining Large Language Models&lt;/h1&gt;&lt;p&gt;Modern language models such as GPT are trained through a two-step process:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pretraining&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fine-tuning&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;During pretraining, the model learns general language patterns from massive text datasets containing books, articles, websites, and other sources.&lt;/p&gt;&lt;p&gt;The primary objective during training is usually &lt;strong&gt;next-token prediction&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Given a sequence of words, the model learns to predict the most probable next token.&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Artificial intelligence is transforming ______
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Possible predictions might include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;technology&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;industries&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;society&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Over billions of training examples, the model gradually learns grammar, factual knowledge, and reasoning patterns embedded in text.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;The GPT Architecture&lt;/h1&gt;&lt;p&gt;The models powering ChatGPT are based on the GPT architecture developed by OpenAI.&lt;/p&gt;&lt;p&gt;GPT models use a &lt;strong&gt;decoder-only transformer architecture&lt;/strong&gt;, meaning they focus primarily on generating text rather than encoding it for classification tasks.&lt;/p&gt;&lt;p&gt;The key capabilities of GPT models include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;predicting the next word in a sequence&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;generating coherent paragraphs&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;maintaining conversation context&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;performing reasoning tasks&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;As the model size increases — measured in billions of parameters — its ability to generalize and perform complex tasks improves significantly.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Fine-Tuning with Human Feedback&lt;/h1&gt;&lt;p&gt;While pretraining teaches the model language patterns, it does not guarantee that the model will produce helpful or safe responses.&lt;/p&gt;&lt;p&gt;To address this, models like ChatGPT undergo additional training using a technique called &lt;strong&gt;Reinforcement Learning from Human Feedback (RLHF)&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;In this process:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Human reviewers rank model responses.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;A reward model learns which responses are preferred.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The language model is optimized to produce higher-ranked answers.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;This training stage improves the quality, usefulness, and safety of responses generated by the model.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;How ChatGPT Generates a Response&lt;/h1&gt;&lt;p&gt;When a user submits a prompt to ChatGPT, the system follows a series of steps.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;The input text is tokenized into tokens.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Tokens are converted into embeddings.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The transformer processes the tokens using multiple attention layers.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The model predicts probabilities for possible next tokens.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The most likely token is selected.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The process repeats until a full response is generated.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;This iterative token-by-token generation produces coherent sentences and paragraphs.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Applications of Large Language Models&lt;/h1&gt;&lt;p&gt;Large language models have enabled numerous real-world applications across industries.&lt;/p&gt;&lt;p&gt;These include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;conversational assistants&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;automated customer support&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;content generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;code generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;document summarization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;language translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;research assistance&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Organizations across technology, healthcare, finance, and education increasingly rely on LLMs to automate complex language tasks.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;The Future of Large Language Models&lt;/h1&gt;&lt;p&gt;The development of large language models continues to accelerate rapidly.&lt;/p&gt;&lt;p&gt;Future advancements are likely to focus on:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;improved reasoning capabilities&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;multimodal models combining text, images, and audio&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;smaller, more efficient models&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;enhanced safety and reliability&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;better integration with external knowledge sources&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Researchers are also exploring new architectures and training techniques that could further expand the capabilities of AI systems.&lt;/p&gt;&lt;h1&gt;Conclusion&lt;/h1&gt;&lt;p&gt;ChatGPT represents the culmination of decades of research in natural language processing, machine learning, and neural networks. From early statistical methods to transformer-based architectures, each breakthrough has contributed to the development of modern conversational AI.&lt;/p&gt;&lt;p&gt;By combining tokenization, word embeddings, self-attention, and large-scale training, ChatGPT can analyze and generate language with remarkable fluency.&lt;/p&gt;&lt;p&gt;Although these systems do not truly understand language in the same way humans do, they are powerful tools capable of assisting with a wide range of tasks.&lt;/p&gt;&lt;p&gt;As research continues, large language models will likely become even more capable, shaping the future of human–computer interaction and redefining how we interact with information.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/how-chatgpt-actually-works-from-tokens.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-7600807093300657901</guid><pubDate>Fri, 13 Mar 2026 11:27:36 +0000</pubDate><atom:updated>2026-03-13T04:27:36.957-07:00</atom:updated><title>Complete NLP Roadmap 2026: From TF-IDF to Transformers and Large Language Models</title><description>&lt;p&gt;&amp;nbsp;Excellent idea, Syed. A &lt;strong&gt;clear NLP roadmap&lt;/strong&gt; is one of the most useful resources for learners and also &lt;strong&gt;very strong for SEO traffic&lt;/strong&gt; because people often search &lt;em&gt;“How to learn NLP from scratch”&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;Below is a &lt;strong&gt;structured roadmap from beginner to LLM engineer&lt;/strong&gt; that you can directly use in your blog.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Complete NLP Roadmap: Beginner → LLM Engineer&lt;/h1&gt;&lt;h2&gt;Stage 1 — Foundations (Mathematics &amp;amp; Programming)&lt;/h2&gt;&lt;p&gt;Before diving into NLP, learners should understand the basic technical foundation.&lt;/p&gt;&lt;h3&gt;Key Skills&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Python programming&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Linear algebra&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Probability and statistics&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Basic machine learning&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Data structures&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Important Python Libraries&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;NumPy&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Pandas&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Matplotlib&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Scikit-learn&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;What You Should Be Able To Do&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Load datasets&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Clean and preprocess data&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Train simple ML models&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Stage 2 — Traditional NLP Techniques&lt;/h1&gt;&lt;p&gt;Before deep learning, NLP relied on statistical methods.&lt;/p&gt;&lt;h3&gt;Key Concepts&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Tokenization&lt;/strong&gt;&lt;br /&gt;Splitting sentences into words or tokens.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Sentence: I love AI
Tokens: [&quot;I&quot;, &quot;love&quot;, &quot;AI&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Stop Word Removal&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Removing common words like:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;the&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;is&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;and&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;of&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Stemming&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Reducing words to root form.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;running → run
playing → play
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Lemmatization&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Converting words into their dictionary form.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;better → good
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;Text Representation Techniques&lt;/h2&gt;&lt;h3&gt;Bag of Words (BoW)&lt;/h3&gt;&lt;p&gt;Represents text by counting word frequency.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Count&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;AI&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;model&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h3&gt;TF-IDF (Term Frequency–Inverse Document Frequency)&lt;/h3&gt;&lt;p&gt;TF-IDF gives importance to words that appear frequently in a document but not across all documents.&lt;/p&gt;&lt;p&gt;Key idea:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Common words get &lt;strong&gt;low weight&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Rare but important words get &lt;strong&gt;high weight&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This technique was widely used in:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;document search&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;information retrieval&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;early NLP classifiers&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Stage 3 — Word Embeddings&lt;/h1&gt;&lt;p&gt;Traditional NLP methods lost semantic meaning. Word embeddings solved this.&lt;/p&gt;&lt;h3&gt;Word Embedding&lt;/h3&gt;&lt;p&gt;Words are represented as &lt;strong&gt;dense vectors&lt;/strong&gt; in numerical space.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;king → [0.25, -0.61, 0.89, ...]
queen → [0.23, -0.59, 0.91, ...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Semantically similar words have &lt;strong&gt;similar vectors&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;Popular Embedding Models&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Word2Vec&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;GloVe&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;FastText&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These embeddings capture relationships like:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;king − man + woman ≈ queen
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;Stage 4 — Deep Learning for NLP&lt;/h1&gt;&lt;p&gt;Deep learning introduced neural architectures capable of learning complex language patterns.&lt;/p&gt;&lt;h2&gt;Recurrent Neural Networks (RNN)&lt;/h2&gt;&lt;p&gt;RNNs process sequences step by step.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input → word1 → word2 → word3
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each step remembers previous information.&lt;/p&gt;&lt;p&gt;Used for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;language modeling&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;text generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;translation&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;Long Short-Term Memory (LSTM)&lt;/h2&gt;&lt;p&gt;LSTM solved the &lt;strong&gt;vanishing gradient problem&lt;/strong&gt; in RNNs.&lt;/p&gt;&lt;p&gt;Advantages:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;remembers long context&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;better sequence modeling&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Applications:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;speech recognition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;text generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;sentiment analysis&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;Sequence-to-Sequence Models (Seq2Seq)&lt;/h2&gt;&lt;p&gt;Seq2Seq models convert one sequence into another.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;English → French translation&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input:  I love AI
Output: J’aime l’IA
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Architecture:&lt;/p&gt;&lt;p&gt;Encoder → Decoder&lt;/p&gt;&lt;p&gt;Limitations:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;long sentences caused information loss&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This led to the &lt;strong&gt;attention mechanism&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Stage 5 — Attention Mechanism&lt;/h1&gt;&lt;p&gt;Attention allows the model to focus on the most relevant words.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The animal didn’t cross the road because it was tired.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Attention helps identify:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;it → animal
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This solved many problems in Seq2Seq models.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Stage 6 — Transformer Architecture&lt;/h1&gt;&lt;p&gt;In 2017 researchers introduced the transformer architecture in the paper:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;“Attention Is All You Need.”&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Transformers removed recurrence and relied entirely on attention.&lt;/p&gt;&lt;h3&gt;Core Components&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Self-attention&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Multi-head attention&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Positional encoding&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Feed-forward networks&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Self-attention formula used in transformers:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;Attention(Q,K,V) = softmax\left(\frac{QK^T}{\sqrt{d_k}}\right)V&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Advantages:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;parallel computation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;better context understanding&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;scalable training&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Stage 7 — Transformer-Based Models&lt;/h1&gt;&lt;p&gt;Transformers led to powerful pretrained language models.&lt;/p&gt;&lt;h3&gt;BERT&lt;/h3&gt;&lt;p&gt;Encoder-only model used for language understanding tasks.&lt;/p&gt;&lt;p&gt;Applications:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;sentiment analysis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;question answering&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;text classification&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;GPT&lt;/h3&gt;&lt;p&gt;Decoder-only model designed for &lt;strong&gt;text generation&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Applications:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;chatbots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;code generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;content writing&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;T5&lt;/h3&gt;&lt;p&gt;Unified model that converts every NLP task into text-to-text format.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;translate English to French: Hello
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;LLaMA&lt;/h3&gt;&lt;p&gt;Open large language models developed by Meta.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Gemini&lt;/h3&gt;&lt;p&gt;Multimodal AI model capable of understanding text, images, and more.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Stage 8 — Large Language Models (LLMs)&lt;/h1&gt;&lt;p&gt;LLMs are extremely large transformer models trained on massive datasets.&lt;/p&gt;&lt;p&gt;Characteristics:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;billions of parameters&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;trained on internet-scale data&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;capable of general reasoning&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;GPT series&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;LLaMA&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Gemini&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Capabilities:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;summarization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;coding&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;reasoning&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Stage 9 — Modern NLP Systems&lt;/h1&gt;&lt;p&gt;Modern NLP applications use LLM-based architectures.&lt;/p&gt;&lt;h3&gt;Common Systems&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Chatbots&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Conversational AI assistants.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Machine Translation&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Language translation systems.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Text Summarization&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Automatic document summarization.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Question Answering&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Answering questions from text sources.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Stage 10 — Advanced LLM Engineering&lt;/h1&gt;&lt;p&gt;Modern NLP engineers also work with:&lt;/p&gt;&lt;h3&gt;Retrieval-Augmented Generation (RAG)&lt;/h3&gt;&lt;p&gt;Combines LLMs with external knowledge databases.&lt;/p&gt;&lt;h3&gt;Vector Databases&lt;/h3&gt;&lt;p&gt;Used for semantic search.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;embeddings stored as vectors&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;similarity search&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Prompt Engineering&lt;/h3&gt;&lt;p&gt;Crafting prompts to improve LLM output.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Stage 11 — NLP Tools and Frameworks&lt;/h1&gt;&lt;p&gt;Important tools include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;PyTorch&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;TensorFlow&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Hugging Face Transformers&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;spaCy&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;NLTK&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Stage 12 — Skills of an LLM Engineer&lt;/h1&gt;&lt;p&gt;To become an NLP/LLM engineer, one should master:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;deep learning&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;transformer architecture&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;prompt engineering&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;vector databases&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;model fine-tuning&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;retrieval-augmented generation&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Final Learning Path Summary&lt;/h1&gt;&lt;pre&gt;&lt;code&gt;Programming &amp;amp; Math
        ↓
Traditional NLP (BoW, TF-IDF)
        ↓
Word Embeddings
        ↓
RNN / LSTM
        ↓
Seq2Seq Models
        ↓
Attention Mechanism
        ↓
Transformer Architecture
        ↓
BERT / GPT / T5
        ↓
Large Language Models
        ↓
RAG &amp;amp; LLM Engineering
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;&lt;/h1&gt;&lt;h1&gt;Suggested SEO Labels (Single Line)&lt;/h1&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/complete-nlp-roadmap-2026-from-tf-idf.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-2730321063648106917</guid><pubDate>Fri, 13 Mar 2026 11:23:35 +0000</pubDate><atom:updated>2026-03-13T04:23:35.361-07:00</atom:updated><title>100+ NLP, Transformer, GPT and BERT Terms Explained: Complete AI Glossary for Beginners and Professionals</title><description>&lt;p&gt;&amp;nbsp;Below is a &lt;strong&gt;comprehensive glossary of important terms related to Natural Language Processing (NLP), Transformers, GPT, and BERT&lt;/strong&gt;. These definitions are written in a &lt;strong&gt;clear, professional, SEO-friendly style&lt;/strong&gt;, so you can directly use them in a &lt;strong&gt;blog post, study notes, or documentation&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Glossary of Terms in Natural Language Processing, Transformers, GPT, and BERT&lt;/h1&gt;&lt;h2&gt;A&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Artificial Intelligence (AI)&lt;/strong&gt;&lt;br /&gt;A field of computer science focused on building systems that can perform tasks normally requiring human intelligence, such as language understanding, vision, and reasoning.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Attention Mechanism&lt;/strong&gt;&lt;br /&gt;A neural network technique that allows a model to focus on the most relevant parts of the input when generating an output. It helps models understand relationships between words in a sentence.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Auto-regressive Model&lt;/strong&gt;&lt;br /&gt;A model that generates text one token at a time by predicting the next token based on previously generated tokens. GPT models are auto-regressive.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;B&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;BERT (Bidirectional Encoder Representations from Transformers)&lt;/strong&gt;&lt;br /&gt;A transformer-based language model developed by Google that reads text in both directions (left and right context) to generate deep contextual understanding of language.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Bidirectional Context&lt;/strong&gt;&lt;br /&gt;A property of models like BERT that analyze words using both preceding and following words in a sentence.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Bag of Words (BoW)&lt;/strong&gt;&lt;br /&gt;A traditional NLP technique where text is represented as a collection of words without considering grammar or word order.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;C&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Corpus&lt;/strong&gt;&lt;br /&gt;A large collection of text used to train or evaluate NLP models.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Contextual Embeddings&lt;/strong&gt;&lt;br /&gt;Word representations that change depending on the context in which the word appears. Models like BERT generate contextual embeddings.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Cross-Attention&lt;/strong&gt;&lt;br /&gt;An attention mechanism used in encoder–decoder models where the decoder attends to the encoder’s output.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;D&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Decoder&lt;/strong&gt;&lt;br /&gt;The component of a transformer responsible for generating output sequences, such as translated text or generated sentences.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Deep Learning&lt;/strong&gt;&lt;br /&gt;A subset of machine learning that uses multi-layer neural networks to learn complex patterns in data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Dimensionality&lt;/strong&gt;&lt;br /&gt;The number of numerical features used to represent a word or token in vector space.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;E&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Embedding&lt;/strong&gt;&lt;br /&gt;A dense numerical representation of words or tokens in vector space that captures semantic meaning.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Encoder&lt;/strong&gt;&lt;br /&gt;The part of a transformer architecture responsible for processing input sequences and producing contextual representations.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Epoch&lt;/strong&gt;&lt;br /&gt;One complete pass of the training dataset through a machine learning model during training.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;F&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Feed Forward Neural Network (FFN)&lt;/strong&gt;&lt;br /&gt;A neural network layer used inside transformer blocks to transform representations after attention is computed.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Fine-Tuning&lt;/strong&gt;&lt;br /&gt;The process of adapting a pretrained language model to a specific task using additional training data.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;G&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Generative AI&lt;/strong&gt;&lt;br /&gt;Artificial intelligence systems capable of generating new content such as text, images, or audio.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;GPT (Generative Pre-trained Transformer)&lt;/strong&gt;&lt;br /&gt;A family of transformer-based language models developed by OpenAI that generate text using a decoder-only architecture.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Gradient Descent&lt;/strong&gt;&lt;br /&gt;An optimization algorithm used to adjust model parameters in order to minimize prediction error.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;H&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Hidden Layer&lt;/strong&gt;&lt;br /&gt;Intermediate layers in neural networks that transform inputs into meaningful representations.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Hidden State&lt;/strong&gt;&lt;br /&gt;The internal representation of tokens produced by neural network layers.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;I&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Inference&lt;/strong&gt;&lt;br /&gt;The stage where a trained model is used to make predictions on new data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Input Sequence&lt;/strong&gt;&lt;br /&gt;The sequence of tokens or words provided to a language model for processing.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;L&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Language Model&lt;/strong&gt;&lt;br /&gt;A model that predicts the probability distribution of words or tokens in a language.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Large Language Model (LLM)&lt;/strong&gt;&lt;br /&gt;A language model trained on massive datasets with billions of parameters to perform advanced language understanding and generation tasks.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Layer Normalization&lt;/strong&gt;&lt;br /&gt;A technique used in neural networks to stabilize and accelerate training by normalizing inputs across features.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;M&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Masked Language Modeling (MLM)&lt;/strong&gt;&lt;br /&gt;A training objective used in BERT where some tokens are masked and the model learns to predict the masked words.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Machine Learning (ML)&lt;/strong&gt;&lt;br /&gt;A branch of AI focused on creating algorithms that improve through experience and data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Multi-Head Attention&lt;/strong&gt;&lt;br /&gt;An extension of self-attention where multiple attention mechanisms run in parallel to capture different relationships between words.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;N&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Natural Language Processing (NLP)&lt;/strong&gt;&lt;br /&gt;A field of AI focused on enabling computers to understand, interpret, and generate human language.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Neural Network&lt;/strong&gt;&lt;br /&gt;A computational model inspired by biological neurons that learns patterns from data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Next Token Prediction&lt;/strong&gt;&lt;br /&gt;A task where a language model predicts the most likely next word in a sequence.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;O&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Optimization&lt;/strong&gt;&lt;br /&gt;The process of adjusting model parameters to minimize training loss.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Overfitting&lt;/strong&gt;&lt;br /&gt;When a model performs well on training data but poorly on unseen data.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;P&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Parameter&lt;/strong&gt;&lt;br /&gt;A learnable variable in a machine learning model that determines how the model processes inputs.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Positional Encoding&lt;/strong&gt;&lt;br /&gt;A method used in transformers to provide information about the order of tokens in a sequence.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Pretraining&lt;/strong&gt;&lt;br /&gt;Training a model on large general datasets before fine-tuning it for specific tasks.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Prompt&lt;/strong&gt;&lt;br /&gt;The input text provided to a language model to generate a response.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Q&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Query (Q)&lt;/strong&gt;&lt;br /&gt;A vector used in the attention mechanism to determine which tokens should be attended to.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;R&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Recurrent Neural Network (RNN)&lt;/strong&gt;&lt;br /&gt;A neural network architecture designed for sequential data that processes inputs one step at a time.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Retrieval-Augmented Generation (RAG)&lt;/strong&gt;&lt;br /&gt;A technique that combines language models with external knowledge retrieval systems to improve responses.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;S&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Self-Attention&lt;/strong&gt;&lt;br /&gt;A mechanism that allows each token in a sequence to attend to all other tokens to capture contextual relationships.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Sequence-to-Sequence (Seq2Seq)&lt;/strong&gt;&lt;br /&gt;A model architecture that converts an input sequence into an output sequence, commonly used in translation.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Softmax Function&lt;/strong&gt;&lt;br /&gt;A mathematical function that converts raw scores into probability distributions.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Subword Tokenization&lt;/strong&gt;&lt;br /&gt;Breaking words into smaller units to efficiently represent rare or unknown words.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;T&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Token&lt;/strong&gt;&lt;br /&gt;A unit of text processed by a language model, which may represent a word, subword, or character.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Tokenization&lt;/strong&gt;&lt;br /&gt;The process of splitting text into tokens.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Transformer&lt;/strong&gt;&lt;br /&gt;A deep learning architecture based on self-attention that processes sequences in parallel.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Training Data&lt;/strong&gt;&lt;br /&gt;The dataset used to train a machine learning model.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;V&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Vector Representation&lt;/strong&gt;&lt;br /&gt;A numerical representation of words or tokens used in machine learning models.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Vocabulary&lt;/strong&gt;&lt;br /&gt;The set of all tokens recognized by a language model.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;W&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Word Embedding&lt;/strong&gt;&lt;br /&gt;A technique that maps words into continuous vector space where semantically similar words have similar representations.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Z&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Zero-Shot Learning&lt;/strong&gt;&lt;br /&gt;The ability of a model to perform tasks it was not explicitly trained on by leveraging general knowledge learned during training.&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;✅ &lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This glossary covers key terminology across:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Natural Language Processing&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Deep Learning for Language&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Transformer Architecture&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;GPT and BERT Models&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Modern Large Language Models&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These concepts form the &lt;strong&gt;technical foundation of modern AI language systems&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Great idea, Syed. A &lt;strong&gt;strong glossary post&lt;/strong&gt; can bring long-term SEO traffic to your AI blog because many people search for definitions of NLP and LLM terms. Below I’ve prepared &lt;strong&gt;three useful resources&lt;/strong&gt; you can directly use or adapt.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. 100-Term NLP &amp;amp; LLM Glossary (SEO-Focused)&lt;/h1&gt;&lt;h3&gt;A–C&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Artificial Intelligence (AI)&lt;/strong&gt; – The field of building machines that can perform tasks requiring human intelligence.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Attention Mechanism&lt;/strong&gt; – A neural network technique that helps models focus on the most relevant parts of a sequence.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Auto-Regressive Model&lt;/strong&gt; – A model that predicts the next token based on previously generated tokens.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Autoencoder&lt;/strong&gt; – A neural network used for representation learning and dimensionality reduction.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Activation Function&lt;/strong&gt; – Mathematical function determining how neural network outputs are produced.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Annotation&lt;/strong&gt; – Manual labeling of text data for NLP training.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Augmented Data&lt;/strong&gt; – Artificially expanded datasets used to improve model performance.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bag of Words (BoW)&lt;/strong&gt; – A method representing text as a frequency of words without considering order.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Batch Size&lt;/strong&gt; – Number of samples processed before updating model weights.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;BERT&lt;/strong&gt; – A bidirectional transformer model developed by Google for language understanding.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;BLEU Score&lt;/strong&gt; – Metric used to evaluate machine translation quality.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Byte Pair Encoding (BPE)&lt;/strong&gt; – Subword tokenization technique used in many language models.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backpropagation&lt;/strong&gt; – Algorithm used to train neural networks by minimizing error.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bidirectional Context&lt;/strong&gt; – Processing text using both past and future words.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Corpus&lt;/strong&gt; – Large collection of texts used to train NLP models.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h3&gt;D–F&lt;/h3&gt;&lt;ol start=&quot;16&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Decoder&lt;/strong&gt; – Transformer component responsible for generating output sequences.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deep Learning&lt;/strong&gt; – Machine learning using multi-layer neural networks.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dimensionality Reduction&lt;/strong&gt; – Techniques to reduce feature space size.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Embedding&lt;/strong&gt; – Vector representation of words capturing semantic meaning.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Encoder&lt;/strong&gt; – Transformer module that processes input sequences.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Epoch&lt;/strong&gt; – One complete training pass through the dataset.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fine-Tuning&lt;/strong&gt; – Adapting a pretrained model for a specific task.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Feed Forward Network (FFN)&lt;/strong&gt; – Neural network layer inside transformer blocks.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Feature Extraction&lt;/strong&gt; – Identifying useful patterns in data.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;FastText&lt;/strong&gt; – Word embedding model developed by Facebook.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h3&gt;G–I&lt;/h3&gt;&lt;ol start=&quot;26&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generative AI&lt;/strong&gt; – AI systems capable of generating new content.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;GPT (Generative Pre-trained Transformer)&lt;/strong&gt; – Decoder-based transformer model designed for text generation.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gradient Descent&lt;/strong&gt; – Optimization algorithm used in training neural networks.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;GloVe&lt;/strong&gt; – Word embedding technique based on global word co-occurrence.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hidden Layer&lt;/strong&gt; – Intermediate layer in neural networks.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hidden State&lt;/strong&gt; – Internal representation of tokens during processing.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Inference&lt;/strong&gt; – Stage where trained models make predictions.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Input Embedding&lt;/strong&gt; – Numerical representation of tokens entering the model.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Intent Detection&lt;/strong&gt; – Identifying user intention in conversational systems.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h3&gt;J–L&lt;/h3&gt;&lt;ol start=&quot;35&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Joint Training&lt;/strong&gt; – Training multiple components simultaneously.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;JSON Dataset&lt;/strong&gt; – Structured format often used for NLP datasets.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Jaccard Similarity&lt;/strong&gt; – Measure used for comparing similarity between sets.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Knowledge Graph&lt;/strong&gt; – Structured representation of knowledge relationships.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Knowledge Distillation&lt;/strong&gt; – Compressing large models into smaller ones.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Language Model&lt;/strong&gt; – Model predicting the probability of word sequences.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Large Language Model (LLM)&lt;/strong&gt; – AI models trained on massive datasets to understand and generate language.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layer Normalization&lt;/strong&gt; – Stabilization technique used in transformers.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Latent Representation&lt;/strong&gt; – Hidden features learned by neural networks.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h3&gt;M–O&lt;/h3&gt;&lt;ol start=&quot;44&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Machine Learning&lt;/strong&gt; – Algorithms enabling systems to learn from data.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Masked Language Modeling (MLM)&lt;/strong&gt; – BERT training technique predicting masked words.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-Head Attention&lt;/strong&gt; – Multiple attention layers capturing different relationships.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Machine Translation&lt;/strong&gt; – Automatic translation of languages.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Natural Language Processing (NLP)&lt;/strong&gt; – AI field focused on language understanding.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Neural Network&lt;/strong&gt; – Computing system inspired by biological neurons.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Named Entity Recognition (NER)&lt;/strong&gt; – Identifying names, places, and organizations in text.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Next Token Prediction&lt;/strong&gt; – Predicting the most probable next word in a sequence.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimization&lt;/strong&gt; – Adjusting model parameters to reduce errors.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Overfitting&lt;/strong&gt; – When models perform well on training data but poorly on new data.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h3&gt;P–R&lt;/h3&gt;&lt;ol start=&quot;54&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Parameter&lt;/strong&gt; – Learnable variables in machine learning models.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Perplexity&lt;/strong&gt; – Metric evaluating language model performance.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Positional Encoding&lt;/strong&gt; – Technique giving transformers word order information.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pretraining&lt;/strong&gt; – Training models on large datasets before specialization.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prompt&lt;/strong&gt; – Input text used to guide LLM output.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prompt Engineering&lt;/strong&gt; – Crafting prompts to improve LLM responses.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Query Vector&lt;/strong&gt; – Vector used to calculate attention scores.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Question Answering&lt;/strong&gt; – NLP task of answering questions from text.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;RAG (Retrieval-Augmented Generation)&lt;/strong&gt; – Combining retrieval systems with LLMs.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Recurrent Neural Network (RNN)&lt;/strong&gt; – Neural network designed for sequential data.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;ROUGE Score&lt;/strong&gt; – Evaluation metric for text summarization.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h3&gt;S–Z&lt;/h3&gt;&lt;ol start=&quot;65&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Self-Attention&lt;/strong&gt; – Mechanism allowing tokens to interact with all others in a sequence.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sentence Embedding&lt;/strong&gt; – Vector representing entire sentences.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Semantic Similarity&lt;/strong&gt; – Measuring meaning similarity between texts.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sequence-to-Sequence Model (Seq2Seq)&lt;/strong&gt; – Model converting one sequence into another.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Softmax Function&lt;/strong&gt; – Converts scores into probabilities.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Subword Tokenization&lt;/strong&gt; – Splitting words into smaller meaningful units.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Text Classification&lt;/strong&gt; – Assigning labels to text.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Token&lt;/strong&gt; – Basic text unit processed by models.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tokenization&lt;/strong&gt; – Splitting text into tokens.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transformer&lt;/strong&gt; – Neural architecture based on self-attention.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Training Data&lt;/strong&gt; – Data used to train models.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transfer Learning&lt;/strong&gt; – Applying knowledge from one task to another.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Vector Representation&lt;/strong&gt; – Numerical encoding of text.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Vocabulary&lt;/strong&gt; – Set of tokens recognized by a model.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Word Embedding&lt;/strong&gt; – Dense representation of words capturing semantic meaning.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Word2Vec&lt;/strong&gt; – Neural model producing word embeddings.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Zero-Shot Learning&lt;/strong&gt; – Performing tasks without task-specific training.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Z-Score Normalization&lt;/strong&gt; – Standardizing feature distributions.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;(You can expand this to 100+ terms by adding task-specific definitions like sentiment analysis, summarization, etc.)&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. A-Z AI Dictionary for Blog SEO&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;A — Attention Mechanism&lt;/strong&gt;&lt;br /&gt;Technique allowing models to focus on important words.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;B — BERT&lt;/strong&gt;&lt;br /&gt;Bidirectional transformer model used for language understanding.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;C — Corpus&lt;/strong&gt;&lt;br /&gt;Large dataset of text used for NLP training.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;D — Decoder&lt;/strong&gt;&lt;br /&gt;Transformer component responsible for generating output.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;E — Embedding&lt;/strong&gt;&lt;br /&gt;Vector representation of words.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;F — Fine-Tuning&lt;/strong&gt;&lt;br /&gt;Adapting pretrained models for specific tasks.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;G — GPT&lt;/strong&gt;&lt;br /&gt;Generative transformer model used for text generation.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;H — Hidden Layer&lt;/strong&gt;&lt;br /&gt;Intermediate neural network layer.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;I — Inference&lt;/strong&gt;&lt;br /&gt;Using a trained model to make predictions.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;J — Jaccard Similarity&lt;/strong&gt;&lt;br /&gt;Metric measuring similarity between datasets.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;K — Knowledge Graph&lt;/strong&gt;&lt;br /&gt;Graph structure representing relationships between entities.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;L — Large Language Model&lt;/strong&gt;&lt;br /&gt;Massive neural networks trained on huge text datasets.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;M — Masked Language Modeling&lt;/strong&gt;&lt;br /&gt;BERT training objective.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;N — NLP&lt;/strong&gt;&lt;br /&gt;AI field focused on language processing.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;O — Overfitting&lt;/strong&gt;&lt;br /&gt;When models memorize training data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;P — Positional Encoding&lt;/strong&gt;&lt;br /&gt;Technique giving transformers token order information.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q — Query Vector&lt;/strong&gt;&lt;br /&gt;Attention component used to compute relevance.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;R — RNN&lt;/strong&gt;&lt;br /&gt;Neural architecture for sequential data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;S — Self-Attention&lt;/strong&gt;&lt;br /&gt;Mechanism allowing tokens to attend to each other.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;T — Transformer&lt;/strong&gt;&lt;br /&gt;Deep learning architecture behind modern LLMs.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;U — Unsupervised Learning&lt;/strong&gt;&lt;br /&gt;Training without labeled data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;V — Vector Representation&lt;/strong&gt;&lt;br /&gt;Numeric encoding of words.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;W — Word Embedding&lt;/strong&gt;&lt;br /&gt;Mapping words into semantic vectors.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;X — XML Dataset&lt;/strong&gt;&lt;br /&gt;Structured format for storing training data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Y — Yield Training Strategy&lt;/strong&gt;&lt;br /&gt;Optimization techniques improving training efficiency.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Z — Zero-Shot Learning&lt;/strong&gt;&lt;br /&gt;Model solving tasks without direct training examples.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. Visual Infographic Structure for NLP Concepts&lt;/h1&gt;&lt;p&gt;You can convert your glossary into an &lt;strong&gt;infographic with these sections&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;Section 1 — Traditional NLP&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Bag of Words&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;TF-IDF&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;N-grams&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Word2Vec&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;GloVe&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Section 2 — Deep Learning NLP&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;RNN&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;LSTM&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;GRU&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Seq2Seq&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Section 3 — Transformer Era&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Self-Attention&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Multi-Head Attention&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Positional Encoding&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Encoder–Decoder Architecture&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Section 4 — Modern LLMs&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;GPT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;BERT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;T5&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;LLaMA&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Gemini&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Section 5 — Applications&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Chatbots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Machine Translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Text Summarization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Question Answering&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Sentiment Analysis&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Natural Language Processing Glossary, NLP Dictionary, Transformer Architecture Terms, GPT and BERT Glossary, AI Terminology Guide, Large Language Model Glossary, Machine Learning Terms, NLP Concepts Explained, AI Vocabulary List, Generative AI Glossary&lt;/p&gt;&lt;br /&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/100-nlp-transformer-gpt-and-bert-terms.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-9037949936976359357</guid><pubDate>Fri, 13 Mar 2026 11:17:32 +0000</pubDate><atom:updated>2026-03-13T04:17:32.238-07:00</atom:updated><title>4 most important concepts behind modern NLP and Large Language Models.</title><description>&lt;p&gt;&amp;nbsp;Great! Let’s go deeper into the &lt;strong&gt;four most important concepts behind modern NLP and Large Language Models&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;We will cover:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-Head Attention (visual and conceptual explanation)&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Complete Transformer Architecture step-by-step&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;How GPT generates text mathematically&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Differences between BERT, GPT, T5, and LLaMA&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h1&gt;1. Multi-Head Attention (Concept and Intuition)&lt;/h1&gt;&lt;p&gt;Self-attention allows a model to determine &lt;strong&gt;which words in a sentence are important for understanding another word&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;However, language relationships are complex. A single attention mechanism may not capture all patterns. This is why transformers use &lt;strong&gt;Multi-Head Attention&lt;/strong&gt;.&lt;/p&gt;&lt;h2&gt;Idea Behind Multi-Head Attention&lt;/h2&gt;&lt;p&gt;Instead of computing attention once, the model computes it &lt;strong&gt;multiple times in parallel&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Each attention head learns &lt;strong&gt;different linguistic relationships&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The boy who was playing football kicked the ball.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Different attention heads might focus on:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Attention Head&lt;/th&gt;&lt;th&gt;What it learns&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Head 1&lt;/td&gt;&lt;td&gt;grammatical subject relationships&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Head 2&lt;/td&gt;&lt;td&gt;verb-object relationships&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Head 3&lt;/td&gt;&lt;td&gt;long-distance dependencies&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Head 4&lt;/td&gt;&lt;td&gt;semantic meaning&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;This allows the model to &lt;strong&gt;understand language from multiple perspectives simultaneously&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Mathematical Representation&lt;/h2&gt;&lt;p&gt;The attention function used inside transformers is &lt;strong&gt;scaled dot-product attention&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Attention(Q,K,V) = softmax\left(\frac{QK^T}{\sqrt{d_k}}\right)V&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt; = Query matrix&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;K&lt;/strong&gt; = Key matrix&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;V&lt;/strong&gt; = Value matrix&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;dₖ&lt;/strong&gt; = dimensionality of keys&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The attention score measures &lt;strong&gt;how strongly one word should attend to another word&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Multi-Head Attention Process&lt;/h2&gt;&lt;p&gt;The process happens in four steps.&lt;/p&gt;&lt;h3&gt;Step 1 — Linear Projections&lt;/h3&gt;&lt;p&gt;Input embeddings are projected into three matrices:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Query (Q)
Key (K)
Value (V)
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;Step 2 — Parallel Attention Heads&lt;/h3&gt;&lt;p&gt;Multiple attention heads compute attention simultaneously.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Head1(Q,K,V)
Head2(Q,K,V)
Head3(Q,K,V)
Head4(Q,K,V)
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;Step 3 — Concatenation&lt;/h3&gt;&lt;p&gt;Outputs from all heads are combined:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Concat(head1, head2, head3, head4)
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;Step 4 — Linear Transformation&lt;/h3&gt;&lt;p&gt;The concatenated vector is passed through another linear layer.&lt;/p&gt;&lt;p&gt;This produces the &lt;strong&gt;final contextual representation&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. Complete Transformer Architecture&lt;/h1&gt;&lt;p&gt;The &lt;strong&gt;Transformer&lt;/strong&gt; architecture revolutionized NLP because it eliminated recurrence and allowed &lt;strong&gt;parallel processing of sequences&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;A standard transformer model consists of two main parts:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Encoder&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Decoder&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h2&gt;Transformer Encoder&lt;/h2&gt;&lt;p&gt;The encoder processes the &lt;strong&gt;input sequence&lt;/strong&gt; and produces contextual representations.&lt;/p&gt;&lt;p&gt;Each encoder layer contains:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Multi-Head Attention&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Feedforward Neural Network&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Residual Connection&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Layer Normalization&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Architecture flow:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input Tokens
↓
Word Embeddings
↓
Positional Encoding
↓
Multi-Head Attention
↓
Add &amp;amp; Normalize
↓
Feedforward Network
↓
Add &amp;amp; Normalize
↓
Output Representation
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This process is repeated &lt;strong&gt;N times&lt;/strong&gt; (often 12–96 layers).&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Transformer Decoder&lt;/h2&gt;&lt;p&gt;The decoder generates the &lt;strong&gt;output sequence&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;It contains three major components:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Masked Multi-Head Attention&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Encoder-Decoder Attention&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Feedforward Network&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The &lt;strong&gt;masking&lt;/strong&gt; ensures that the decoder cannot see future words during generation.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input: The capital of France is
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The decoder predicts:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Paris
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;Why Transformers Are Powerful&lt;/h2&gt;&lt;p&gt;Transformers offer major advantages over earlier architectures.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Advantage&lt;/th&gt;&lt;th&gt;Explanation&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Parallel processing&lt;/td&gt;&lt;td&gt;entire sequence processed simultaneously&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Long-range dependencies&lt;/td&gt;&lt;td&gt;attention connects distant words&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Scalability&lt;/td&gt;&lt;td&gt;architecture scales well to billions of parameters&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;These properties made transformers the foundation of modern &lt;strong&gt;LLMs&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. How GPT Generates Text&lt;/h1&gt;&lt;p&gt;Generative models like GPT use &lt;strong&gt;autoregressive language modeling&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;The model predicts &lt;strong&gt;the next token given previous tokens&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Autoregressive Language Modeling&lt;/h2&gt;&lt;p&gt;GPT learns the probability of a word sequence.&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The sun rises in the
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The model predicts probabilities for possible next words.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Probability&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;east&lt;/td&gt;&lt;td&gt;0.65&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;sky&lt;/td&gt;&lt;td&gt;0.18&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;morning&lt;/td&gt;&lt;td&gt;0.07&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;The highest-probability token is selected.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Probability Factorization&lt;/h2&gt;&lt;p&gt;The probability of a sequence is decomposed into conditional probabilities.&lt;/p&gt;&lt;p&gt;P(w_1,w_2,...,w_n)=\prod_{t=1}^{n} P(w_t|w_1,...,w_{t-1})&lt;/p&gt;&lt;p&gt;This means:&lt;/p&gt;&lt;p&gt;Each word is predicted based on &lt;strong&gt;all previous words&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Generation Process&lt;/h2&gt;&lt;p&gt;GPT text generation follows these steps.&lt;/p&gt;&lt;h3&gt;Step 1 — Input Tokenization&lt;/h3&gt;&lt;p&gt;Example input:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Explain artificial intelligence
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Tokens are created.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 2 — Embedding + Positional Encoding&lt;/h3&gt;&lt;p&gt;Tokens are converted into vectors.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 3 — Transformer Layers&lt;/h3&gt;&lt;p&gt;The input passes through multiple decoder layers with self-attention.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 4 — Probability Distribution&lt;/h3&gt;&lt;p&gt;The model predicts probabilities for the next token.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 5 — Sampling Strategy&lt;/h3&gt;&lt;p&gt;Different strategies determine the output.&lt;/p&gt;&lt;p&gt;Common methods include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Greedy decoding&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Beam search&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Top-k sampling&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Top-p sampling (nucleus sampling)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 6 — Iterative Generation&lt;/h3&gt;&lt;p&gt;The predicted token is appended to the sequence and the process repeats.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Artificial intelligence is transforming
→ the
→ world
→ by
→ enabling
→ machines
→ to
→ learn
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;4. Differences Between BERT, GPT, T5, and LLaMA&lt;/h1&gt;&lt;p&gt;Different LLM architectures are designed for different purposes.&lt;/p&gt;&lt;p&gt;Below is a clear comparison.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;Architecture&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;BERT&lt;/td&gt;&lt;td&gt;Encoder-only&lt;/td&gt;&lt;td&gt;language understanding&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT&lt;/td&gt;&lt;td&gt;Decoder-only&lt;/td&gt;&lt;td&gt;text generation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;T5&lt;/td&gt;&lt;td&gt;Encoder-decoder&lt;/td&gt;&lt;td&gt;text-to-text tasks&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;LLaMA&lt;/td&gt;&lt;td&gt;Decoder-only&lt;/td&gt;&lt;td&gt;efficient generative models&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h2&gt;BERT&lt;/h2&gt;&lt;p&gt;BERT stands for &lt;strong&gt;Bidirectional Encoder Representations from Transformers&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Key idea:&lt;/p&gt;&lt;p&gt;BERT reads text &lt;strong&gt;in both directions simultaneously&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The bank of the river
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;BERT uses context from both sides to understand the word &lt;strong&gt;bank&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Best suited for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;classification&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;question answering&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;sentiment analysis&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;GPT&lt;/h2&gt;&lt;p&gt;GPT stands for &lt;strong&gt;Generative Pre-trained Transformer&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Key characteristics:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;decoder-only architecture&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;autoregressive generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;trained to predict next token&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;GPT is excellent for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;chatbots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;content generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;coding assistants&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;T5&lt;/h2&gt;&lt;p&gt;T5 stands for &lt;strong&gt;Text-to-Text Transfer Transformer&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;It converts every NLP task into a &lt;strong&gt;text input → text output&lt;/strong&gt; format.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;translate English to French:
I love AI
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;J&#39;aime l&#39;IA
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;T5 is extremely flexible for multiple NLP tasks.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;LLaMA&lt;/h2&gt;&lt;p&gt;LLaMA (Large Language Model Meta AI) is a family of efficient open-weight models designed for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;research&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;scalable deployment&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;lower computational cost&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;LLaMA models focus on achieving &lt;strong&gt;high performance with fewer parameters&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;5. Why Self-Attention Improved Seq2Seq Models&lt;/h1&gt;&lt;p&gt;Earlier &lt;strong&gt;seq2seq models based on RNNs&lt;/strong&gt; had limitations.&lt;/p&gt;&lt;p&gt;The encoder compressed an entire sentence into &lt;strong&gt;one context vector&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;For long sentences, important information could be lost.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The professor who wrote many books about physics visited the university yesterday.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Compressing this sentence into one vector is difficult.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Attention Solved This Problem&lt;/h2&gt;&lt;p&gt;Attention allows the decoder to access &lt;strong&gt;all encoder states&lt;/strong&gt; rather than a single vector.&lt;/p&gt;&lt;p&gt;Example during translation:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;English: I love machine learning
French: J&#39;aime l&#39;apprentissage automatique
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;While generating &lt;strong&gt;apprentissage&lt;/strong&gt;, the model attends strongly to &lt;strong&gt;machine learning&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Self-Attention Benefits&lt;/h2&gt;&lt;p&gt;Self-attention improved seq2seq models by enabling:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Benefit&lt;/th&gt;&lt;th&gt;Explanation&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;long-distance dependencies&lt;/td&gt;&lt;td&gt;words far apart can interact&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;parallel computation&lt;/td&gt;&lt;td&gt;faster training&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;richer context representation&lt;/td&gt;&lt;td&gt;each word attends to all others&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;6. Why Self-Attention Changed NLP&lt;/h1&gt;&lt;p&gt;Self-attention is considered one of the &lt;strong&gt;most important breakthroughs in modern AI&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Because it allows models to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;understand long documents&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;scale to billions of parameters&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;process sequences efficiently&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;capture complex linguistic relationships&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Without self-attention, modern &lt;strong&gt;LLMs like GPT, Gemini, and LLaMA would not exist&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Final Summary&lt;/h1&gt;&lt;p&gt;Modern Natural Language Processing has evolved through several stages, from early statistical models like &lt;strong&gt;TF-IDF&lt;/strong&gt; to deep learning architectures such as &lt;strong&gt;RNNs and seq2seq models&lt;/strong&gt;. The introduction of &lt;strong&gt;self-attention and transformer architectures&lt;/strong&gt; revolutionized NLP by enabling models to capture long-range dependencies and process language more efficiently.&lt;/p&gt;&lt;p&gt;Large Language Models such as &lt;strong&gt;BERT, GPT, T5, and LLaMA&lt;/strong&gt; are built on these transformer principles and are capable of performing complex language tasks including &lt;strong&gt;translation, summarization, conversation, and knowledge generation&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;With continuous advancements in model architecture, training techniques, and computational resources, LLMs are expected to become even more powerful, efficient, and integrated into real-world applications across industries.&lt;/p&gt;&lt;br /&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/4-most-important-concepts-behind-modern.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-4063226579855775297</guid><pubDate>Fri, 13 Mar 2026 10:00:30 +0000</pubDate><atom:updated>2026-03-13T03:00:30.028-07:00</atom:updated><title>BERT Grammar Checker</title><description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;1. Text Preprocessing Techniques&lt;/h2&gt;&lt;p&gt;These prepare raw text so a model can process it.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tokenization&lt;/strong&gt; – breaking sentences into tokens (words/subwords).&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Subword Tokenization (WordPiece)&lt;/strong&gt; – splitting rare words into meaningful pieces.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Special Tokens&lt;/strong&gt; – &lt;code inline=&quot;&quot;&gt;[CLS]&lt;/code&gt;, &lt;code inline=&quot;&quot;&gt;[SEP]&lt;/code&gt;, &lt;code inline=&quot;&quot;&gt;[MASK]&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Input Encoding&lt;/strong&gt; – converting tokens into numerical IDs.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Attention Masks&lt;/strong&gt; – indicating which tokens are real vs padding.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Sentence: I am going school
Tokens: [CLS] I am going school [SEP]
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;2. Embedding Layer&lt;/h2&gt;&lt;p&gt;Converts tokens into vectors that neural networks can process.&lt;/p&gt;&lt;p&gt;Technical embeddings used in BERT:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Token Embeddings&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Positional Embeddings&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Segment Embeddings&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Final embedding:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Embedding = Token + Position + Segment
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;These embeddings capture &lt;strong&gt;semantic and positional meaning of words&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;3. Transformer Architecture&lt;/h2&gt;&lt;p&gt;The script relies on the &lt;strong&gt;Transformer encoder architecture&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Core components include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Multi-head self-attention&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Feed-forward neural networks&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Residual connections&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Layer normalization&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This allows the model to &lt;strong&gt;understand sentence context simultaneously&lt;/strong&gt; rather than sequentially.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;4. Self-Attention Mechanism&lt;/h2&gt;&lt;p&gt;Self-attention helps the model determine &lt;strong&gt;which words influence each other&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;She go to school yesterday
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The model learns that &lt;strong&gt;&quot;go&quot; should relate to &quot;yesterday&quot;&lt;/strong&gt;, indicating a tense issue.&lt;/p&gt;&lt;p&gt;Self-attention calculates relationships using:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Query vectors&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Key vectors&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Value vectors&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;5. Contextual Word Representations&lt;/h2&gt;&lt;p&gt;Unlike traditional embeddings, BERT generates &lt;strong&gt;context-aware embeddings&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;bank (river bank)
bank (financial bank)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The model assigns &lt;strong&gt;different embeddings depending on context&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;6. Masked Language Modeling (MLM)&lt;/h2&gt;&lt;p&gt;The grammar checker works using &lt;strong&gt;Masked Language Modeling&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Process:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Mask a word in the sentence.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Predict the most probable word.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;He go to school
He [MASK] to school
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Model predicts:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;go → goes
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;7. Probability Prediction (Softmax Layer)&lt;/h2&gt;&lt;p&gt;BERT outputs probabilities for possible tokens.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[MASK] → goes (0.72)
[MASK] → went (0.18)
[MASK] → go (0.06)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Highest probability is chosen as the correction.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;8. Language Modeling&lt;/h2&gt;&lt;p&gt;The model relies on &lt;strong&gt;bidirectional language modeling&lt;/strong&gt;, meaning:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;It reads &lt;strong&gt;left context&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;It reads &lt;strong&gt;right context&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;He ___ to school yesterday
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The model sees both &lt;strong&gt;He&lt;/strong&gt; and &lt;strong&gt;yesterday&lt;/strong&gt; before predicting the verb.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;9. Transformer Encoder Layers&lt;/h2&gt;&lt;p&gt;BERT typically uses multiple encoder layers.&lt;/p&gt;&lt;p&gt;Example configuration:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;Layers&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;BERT Base&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;BERT Large&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Each layer improves contextual understanding.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;10. Attention Mechanism for Error Detection&lt;/h2&gt;&lt;p&gt;Attention identifies dependencies like:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;subject–verb agreement&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;tense consistency&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;grammatical structure&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;She eat apples
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Attention links:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;She → eat
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;and predicts correction:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;eat → eats
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;11. Decoding Predicted Tokens&lt;/h2&gt;&lt;p&gt;After prediction:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Token IDs are converted back to tokens.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Tokens are converted to &lt;strong&gt;human-readable text&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[CLS] She eats apples [SEP]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;She eats apples
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;12. NLP Tasks Involved&lt;/h2&gt;&lt;p&gt;The script touches several NLP tasks:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Grammar correction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Language modeling&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Token classification&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Contextual word prediction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Sentence understanding&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;13. Libraries and Frameworks Used&lt;/h2&gt;&lt;p&gt;Common technical tools used in such scripts:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;PyTorch&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Hugging Face Transformers&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Tokenizers&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Pretrained BERT models&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;p&gt;✅ &lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The grammar checker uses these main NLP technologies:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Tokenization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;WordPiece subword modeling&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Embeddings&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Transformer encoder architecture&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Self-attention mechanism&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Masked Language Modeling&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Contextual embeddings&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Softmax probability prediction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Language modeling&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/bert-grammar-checker.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-7766644100053358519</guid><pubDate>Fri, 13 Mar 2026 07:10:35 +0000</pubDate><atom:updated>2026-03-13T00:10:35.989-07:00</atom:updated><title>Word Embedding and Positional Encoding in Natural Language Processing</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;Modern &lt;strong&gt;Natural Language Processing (NLP)&lt;/strong&gt; systems cannot work directly with text because neural networks operate on &lt;strong&gt;numerical vectors&lt;/strong&gt;. Two crucial techniques that enable language models to process text effectively are &lt;strong&gt;word embeddings&lt;/strong&gt; and &lt;strong&gt;positional encoding&lt;/strong&gt;. Word embeddings convert words into meaningful numerical vectors, while positional encoding preserves the &lt;strong&gt;order of words in a sentence&lt;/strong&gt;, which is especially important in transformer-based models.&lt;/p&gt;&lt;p&gt;Below is a clear and technically grounded explanation of both concepts.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. Word Embedding&lt;/h1&gt;&lt;h2&gt;What is Word Embedding?&lt;/h2&gt;&lt;p&gt;A &lt;strong&gt;word embedding&lt;/strong&gt; is a method of representing words as &lt;strong&gt;dense numerical vectors in a continuous vector space&lt;/strong&gt;. Unlike earlier approaches such as &lt;strong&gt;Bag of Words&lt;/strong&gt; or &lt;strong&gt;TF-IDF&lt;/strong&gt;, word embeddings capture &lt;strong&gt;semantic relationships between words&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;In simple terms:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Word embeddings convert words into vectors so that words with similar meanings have similar vector representations.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;king → [0.23, -0.11, 0.76, 0.45, ...]
queen → [0.21, -0.09, 0.79, 0.41, ...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The vectors for &lt;strong&gt;king&lt;/strong&gt; and &lt;strong&gt;queen&lt;/strong&gt; are close in the vector space because they have similar meanings.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Why Word Embeddings Are Important&lt;/h2&gt;&lt;p&gt;Earlier NLP techniques had several problems:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Problem&lt;/th&gt;&lt;th&gt;Explanation&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Sparse representation&lt;/td&gt;&lt;td&gt;Bag-of-Words vectors are mostly zeros&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;No semantic understanding&lt;/td&gt;&lt;td&gt;“car” and “automobile” appear unrelated&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;High dimensionality&lt;/td&gt;&lt;td&gt;Vocabulary size could be tens of thousands&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Word embeddings solve these problems by creating &lt;strong&gt;dense, low-dimensional vectors&lt;/strong&gt; that encode semantic meaning.&lt;/p&gt;&lt;p&gt;Typical embedding sizes include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;100 dimensions&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;300 dimensions&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;768 dimensions (used in some transformer models)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;Semantic Relationships in Word Embeddings&lt;/h2&gt;&lt;p&gt;One of the most famous properties of word embeddings is that &lt;strong&gt;vector arithmetic captures relationships between words&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example relationship:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;king − man + woman ≈ queen
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This means the embedding space has learned the concept of &lt;strong&gt;gender relationships between words&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Other examples:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Paris − France + Italy ≈ Rome
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This shows the model understands &lt;strong&gt;geographical relationships&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;How Word Embeddings Are Learned&lt;/h2&gt;&lt;p&gt;Word embeddings are typically learned by analyzing &lt;strong&gt;word co-occurrence patterns&lt;/strong&gt; in large text corpora.&lt;/p&gt;&lt;p&gt;The central idea is called the &lt;strong&gt;distributional hypothesis&lt;/strong&gt;:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Words that appear in similar contexts tend to have similar meanings.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Example sentences:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The cat sits on the mat
The dog sits on the sofa
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The words &lt;strong&gt;cat&lt;/strong&gt; and &lt;strong&gt;dog&lt;/strong&gt; appear in similar contexts, so their embeddings become similar.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Popular Word Embedding Models&lt;/h2&gt;&lt;h3&gt;Word2Vec&lt;/h3&gt;&lt;p&gt;Word2Vec was introduced by Google researchers in 2013.&lt;/p&gt;&lt;p&gt;It has two main architectures:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Continuous Bag of Words (CBOW)&lt;/strong&gt;&lt;br /&gt;Predicts a word from surrounding context.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Skip-Gram&lt;/strong&gt;&lt;br /&gt;Predicts surrounding words from the current word.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Example Skip-Gram task:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input: dog
Predict: bark, pet, animal
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;GloVe (Global Vectors)&lt;/h3&gt;&lt;p&gt;GloVe combines:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;global word co-occurrence statistics&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;matrix factorization techniques&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;It captures relationships between words by analyzing how often words appear together across the entire corpus.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;FastText&lt;/h3&gt;&lt;p&gt;FastText improves embeddings by considering &lt;strong&gt;subword information&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;unbelievable → un + believe + able
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This helps models handle:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;rare words&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;misspellings&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;morphologically rich languages&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;Static vs Contextual Embeddings&lt;/h2&gt;&lt;p&gt;Traditional embeddings like Word2Vec are &lt;strong&gt;static&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;This means a word always has the &lt;strong&gt;same vector representation&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;bank → same vector
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But the word &lt;em&gt;bank&lt;/em&gt; can mean:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;financial institution&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;river bank&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Modern transformer models use &lt;strong&gt;contextual embeddings&lt;/strong&gt;, where the meaning changes depending on the sentence.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence 1&lt;/p&gt;&lt;pre&gt;&lt;code&gt;He deposited money in the bank
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Sentence 2&lt;/p&gt;&lt;pre&gt;&lt;code&gt;They sat on the river bank
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The word &lt;strong&gt;bank&lt;/strong&gt; receives different vector representations in each sentence.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. Positional Encoding&lt;/h1&gt;&lt;h2&gt;Why Positional Encoding Is Needed&lt;/h2&gt;&lt;p&gt;Traditional sequence models like &lt;strong&gt;Recurrent Neural Networks (RNNs)&lt;/strong&gt; process words sequentially, so they naturally understand word order.&lt;/p&gt;&lt;p&gt;However, &lt;strong&gt;transformer models process all tokens simultaneously&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;This creates a problem.&lt;/p&gt;&lt;p&gt;Without additional information, the transformer cannot distinguish between these sentences:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Dog bites man
Man bites dog
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Even though the meaning is completely different.&lt;/p&gt;&lt;p&gt;To solve this issue, transformers use &lt;strong&gt;positional encoding&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;What is Positional Encoding?&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Positional encoding&lt;/strong&gt; is a technique that adds information about the &lt;strong&gt;position of each word in a sequence&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Instead of relying on sequential processing, the transformer adds positional information to the word embeddings.&lt;/p&gt;&lt;p&gt;Basic idea:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input Representation = Word Embedding + Positional Encoding
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each word vector is combined with a positional vector indicating its position in the sentence.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Position&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;The&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;cat&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;sat&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;here&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h2&gt;Sinusoidal Positional Encoding&lt;/h2&gt;&lt;p&gt;The original transformer paper introduced &lt;strong&gt;sinusoidal positional encoding&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;The encoding uses sine and cosine functions to generate position vectors.&lt;/p&gt;&lt;p&gt;PE(pos,2i) = \sin\left(\frac{pos}{10000^{2i/d}}\right)&lt;/p&gt;&lt;p&gt;PE(pos,2i+1) = \cos\left(\frac{pos}{10000^{2i/d}}\right)&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;pos&lt;/strong&gt; = position in the sequence&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;i&lt;/strong&gt; = dimension index&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;d&lt;/strong&gt; = embedding dimension&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These sinusoidal functions allow the model to represent positions smoothly across dimensions.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Why Sinusoidal Encoding Works&lt;/h2&gt;&lt;p&gt;Sinusoidal positional encoding has several advantages:&lt;/p&gt;&lt;h3&gt;1. Captures Relative Positions&lt;/h3&gt;&lt;p&gt;Because sine and cosine are periodic functions, the model can infer relationships such as:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;position 10 is close to position 11
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;2. Works for Long Sequences&lt;/h3&gt;&lt;p&gt;The encoding generalizes well to sequences longer than those seen during training.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;3. No Additional Parameters&lt;/h3&gt;&lt;p&gt;Unlike learned positional embeddings, sinusoidal encodings do not require extra training parameters.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Learned Positional Embeddings&lt;/h2&gt;&lt;p&gt;Some modern models use &lt;strong&gt;learned positional embeddings&lt;/strong&gt; instead of sinusoidal functions.&lt;/p&gt;&lt;p&gt;In this approach:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;each position has a trainable vector&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;the model learns positional patterns during training&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Many transformer architectures now use this method.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. How Word Embeddings and Positional Encoding Work Together&lt;/h1&gt;&lt;p&gt;In transformer-based models, the final input representation is created by combining both components.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Final Input Vector = Word Embedding + Positional Encoding
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This ensures the model knows:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;What the word means&lt;/strong&gt; (embedding)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Where the word appears&lt;/strong&gt; (position)&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Example sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I love natural language processing
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Process:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Convert each word into embeddings.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Add positional encoding.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Feed into transformer layers.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h1&gt;4. Importance in Large Language Models&lt;/h1&gt;&lt;p&gt;Both techniques are fundamental to modern LLMs.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Component&lt;/th&gt;&lt;th&gt;Role&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Word Embedding&lt;/td&gt;&lt;td&gt;captures semantic meaning of words&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Positional Encoding&lt;/td&gt;&lt;td&gt;preserves word order&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Self-Attention&lt;/td&gt;&lt;td&gt;captures relationships between words&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Together they allow models like:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;GPT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;BERT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;T5&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;LLaMA&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;to process language effectively.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;5. Summary&lt;/h1&gt;&lt;p&gt;Word embeddings and positional encoding are foundational building blocks in modern NLP systems.&lt;/p&gt;&lt;p&gt;Word embeddings transform words into &lt;strong&gt;dense semantic vectors&lt;/strong&gt;, enabling models to understand relationships between words. Positional encoding complements embeddings by introducing &lt;strong&gt;information about word order&lt;/strong&gt;, which is essential for transformer architectures that process tokens in parallel.&lt;/p&gt;&lt;p&gt;By combining these techniques with &lt;strong&gt;self-attention mechanisms&lt;/strong&gt;, modern transformer models can capture both &lt;strong&gt;semantic meaning and contextual structure&lt;/strong&gt;, making them capable of performing complex tasks such as translation, summarization, and conversational AI.&lt;/p&gt;&lt;br /&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/word-embedding-and-positional-encoding.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-4548128309524554297</guid><pubDate>Fri, 13 Mar 2026 06:37:36 +0000</pubDate><atom:updated>2026-03-16T01:10:21.151-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AI</category><category domain="http://www.blogger.com/atom/ns#">AI Applications</category><category domain="http://www.blogger.com/atom/ns#">AI Models</category><category domain="http://www.blogger.com/atom/ns#">ChatGPT</category><category domain="http://www.blogger.com/atom/ns#">Deep Learning</category><category domain="http://www.blogger.com/atom/ns#">Generative AI</category><category domain="http://www.blogger.com/atom/ns#">Language Models</category><category domain="http://www.blogger.com/atom/ns#">LLM</category><category domain="http://www.blogger.com/atom/ns#">Machine Learning</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks</category><category domain="http://www.blogger.com/atom/ns#">NLP</category><category domain="http://www.blogger.com/atom/ns#">Prompt Engineering</category><category domain="http://www.blogger.com/atom/ns#">Text Generation</category><category domain="http://www.blogger.com/atom/ns#">Tokenization</category><category domain="http://www.blogger.com/atom/ns#">Transformers</category><title>Large Language Models (LLMs): A Comprehensive Guide to Architecture, Evolution, and Applications in NLP</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p&gt;In recent years, &lt;strong&gt;Large Language Models (LLMs)&lt;/strong&gt; have transformed the field of &lt;strong&gt;Natural Language Processing (NLP)&lt;/strong&gt; and artificial intelligence. Systems capable of generating human-like text, answering questions, translating languages, summarizing documents, and assisting in programming are now widely available. These systems are powered by deep learning architectures that can learn complex patterns from vast amounts of text data.&lt;/p&gt;&lt;p&gt;The emergence of LLMs represents a major shift in how machines interact with human language. Earlier NLP systems relied heavily on manually crafted rules or relatively simple statistical models. Today’s language models are trained on billions or even trillions of words and use advanced neural network architectures such as &lt;strong&gt;Transformers&lt;/strong&gt; to learn contextual representations of language.&lt;/p&gt;&lt;p&gt;This guide provides a &lt;strong&gt;comprehensive overview of Large Language Models&lt;/strong&gt;, including their history, foundational NLP techniques such as &lt;strong&gt;TF-IDF and word embeddings&lt;/strong&gt;, deep learning architectures like &lt;strong&gt;Recurrent Neural Networks (RNNs)&lt;/strong&gt; and &lt;strong&gt;sequence-to-sequence (seq2seq) models&lt;/strong&gt;, and the breakthrough &lt;strong&gt;transformer architecture&lt;/strong&gt; that powers modern LLMs. We will also explore &lt;strong&gt;encoder-only models, decoder-only models, and encoder-decoder architectures&lt;/strong&gt;, and discuss how &lt;strong&gt;self-attention mechanisms&lt;/strong&gt; improved earlier seq2seq models.&lt;/p&gt;&lt;p&gt;Finally, we will examine the &lt;strong&gt;future of LLMs&lt;/strong&gt;, including emerging trends in generative AI and the challenges that researchers and engineers must overcome.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. What Are Large Language Models (LLMs)?&lt;/h1&gt;&lt;p&gt;A &lt;strong&gt;Large Language Model (LLM)&lt;/strong&gt; is a deep learning model designed to &lt;strong&gt;understand, generate, and manipulate natural language&lt;/strong&gt;. LLMs are typically trained on extremely large text datasets using neural networks containing &lt;strong&gt;millions to trillions of parameters&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;Key Characteristics of LLMs&lt;/h3&gt;&lt;p&gt;Large language models generally have the following characteristics:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Massive training datasets&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deep neural network architectures&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Contextual language understanding&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generative capabilities&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transfer learning capabilities&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These models learn language patterns by predicting the &lt;strong&gt;next word or token in a sequence&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;For example, given the sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&quot;Artificial intelligence is transforming the ____&quot;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;A trained LLM can predict words like:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;world&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;industry&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;economy&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;By learning these patterns across billions of examples, the model develops a sophisticated understanding of language.&lt;/p&gt;&lt;h3&gt;Core Capabilities of LLMs&lt;/h3&gt;&lt;p&gt;LLMs can perform a wide range of NLP tasks:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Text generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Question answering&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Language translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Text summarization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Sentiment analysis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Code generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Conversational AI&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These capabilities make LLMs useful in applications such as:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;chatbots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;search engines&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;digital assistants&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;knowledge management systems&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;programming assistants&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;2. History and Evolution of Language Models&lt;/h1&gt;&lt;p&gt;The development of large language models is the result of decades of research in linguistics, statistics, and machine learning.&lt;/p&gt;&lt;h2&gt;Rule-Based NLP (1950s–1980s)&lt;/h2&gt;&lt;p&gt;Early NLP systems relied on &lt;strong&gt;manually written linguistic rules&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;grammar rules&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;syntactic parsing rules&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;dictionaries&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Although rule-based systems could perform simple tasks, they struggled with the complexity and variability of human language.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Statistical NLP (1990s–2010)&lt;/h2&gt;&lt;p&gt;In the 1990s, NLP began adopting &lt;strong&gt;probabilistic models&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Some important approaches included:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;N-gram language models&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Hidden Markov Models (HMM)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Naive Bayes classifiers&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These models used statistical methods to estimate probabilities of word sequences.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Probability of sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“The cat sat on the mat”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Computed using conditional probabilities.&lt;/p&gt;&lt;p&gt;However, statistical models had limitations:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;poor context understanding&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;limited vocabulary representation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;sparse data problems&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;Neural Network NLP (2010–2017)&lt;/h2&gt;&lt;p&gt;The next breakthrough came with &lt;strong&gt;neural networks&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Important developments included:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Word embeddings (Word2Vec, GloVe)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Recurrent Neural Networks&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Long Short-Term Memory (LSTM)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These models could learn &lt;strong&gt;distributed representations of words&lt;/strong&gt; and capture sequential dependencies.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Transformer Era (2017–Present)&lt;/h2&gt;&lt;p&gt;In 2017, the paper &lt;strong&gt;“Attention Is All You Need”&lt;/strong&gt; introduced the &lt;strong&gt;Transformer architecture&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Transformers replaced recurrent architectures and allowed models to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;process sequences in parallel&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;capture long-range dependencies&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;scale to very large datasets&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This innovation led to the development of modern LLMs such as:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;GPT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;BERT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;T5&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;LLaMA&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Gemini&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;3. TF-IDF: One of the Foundations of NLP&lt;/h1&gt;&lt;p&gt;Before neural language models became dominant, one of the most widely used text representation techniques was &lt;strong&gt;Term Frequency–Inverse Document Frequency (TF-IDF)&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;TF-IDF measures the importance of a word in a document relative to a corpus.&lt;/p&gt;&lt;p&gt;The idea is simple:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;words that occur frequently in a document are important&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;words that occur in many documents are less informative&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The TF-IDF score is calculated using the following formula.&lt;/p&gt;&lt;p&gt;TFIDF(t,d) = TF(t,d) \times \log\left(\frac{N}{DF(t)}\right)&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;TF(t,d)&lt;/strong&gt; is the frequency of term &lt;em&gt;t&lt;/em&gt; in document &lt;em&gt;d&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;DF(t)&lt;/strong&gt; is the number of documents containing the term&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;N&lt;/strong&gt; is the total number of documents&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Applications of TF-IDF&lt;/h3&gt;&lt;p&gt;TF-IDF is widely used for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;search engines&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;document ranking&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;keyword extraction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;text classification&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Although modern deep learning models rely on embeddings, TF-IDF remains an important foundational concept in NLP.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;4. Word Embeddings&lt;/h1&gt;&lt;p&gt;Traditional NLP methods represented words using &lt;strong&gt;sparse vectors&lt;/strong&gt; such as Bag-of-Words or TF-IDF.&lt;/p&gt;&lt;p&gt;However, these methods ignore &lt;strong&gt;semantic relationships between words&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Word embeddings solved this problem.&lt;/p&gt;&lt;p&gt;A &lt;strong&gt;word embedding&lt;/strong&gt; represents each word as a dense vector in a continuous vector space.&lt;/p&gt;&lt;p&gt;Example representation:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;king → [0.42, -0.12, 0.91, ...]
queen → [0.39, -0.10, 0.89, ...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;These vectors capture semantic relationships.&lt;/p&gt;&lt;p&gt;A famous example is:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;king − man + woman ≈ queen
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Popular word embedding techniques include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Word2Vec&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;GloVe&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;FastText&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These models learn word representations by analyzing &lt;strong&gt;contextual co-occurrence patterns&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Word embeddings became a critical building block for neural NLP systems.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;5. Recurrent Neural Networks (RNN)&lt;/h1&gt;&lt;p&gt;Natural language is inherently sequential. Words appear in a specific order, and meaning depends on previous words.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Recurrent Neural Networks (RNNs)&lt;/strong&gt; were designed to process sequential data.&lt;/p&gt;&lt;p&gt;In an RNN, the hidden state is updated at every time step:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;h_t = f(Wx_t + Uh_{t-1})
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;( x_t ) is the input at time t&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;( h_t ) is the hidden state&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;( h_{t-1} ) is the previous hidden state&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Advantages of RNNs&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;capture sequential dependencies&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;handle variable-length input&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Limitations&lt;/h3&gt;&lt;p&gt;RNNs suffer from:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;vanishing gradients&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;difficulty learning long-range dependencies&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;slow sequential processing&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;To overcome these issues, variants such as &lt;strong&gt;LSTM and GRU&lt;/strong&gt; were developed.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;6. Sequence-to-Sequence (Seq2Seq) Models&lt;/h1&gt;&lt;p&gt;Seq2Seq models were developed for tasks where the input and output are both sequences.&lt;/p&gt;&lt;p&gt;Examples include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;machine translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;text summarization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;speech recognition&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A seq2seq model consists of two main components:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Encoder&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Decoder&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;Encoder&lt;/h3&gt;&lt;p&gt;The encoder reads the input sequence and compresses it into a &lt;strong&gt;context vector&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;Decoder&lt;/h3&gt;&lt;p&gt;The decoder generates the output sequence based on the context vector.&lt;/p&gt;&lt;p&gt;Example translation task:&lt;/p&gt;&lt;p&gt;Input:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&quot;I love artificial intelligence&quot;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Output:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&quot;J&#39;aime l&#39;intelligence artificielle&quot;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Seq2Seq models were widely used before the transformer architecture.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;7. Limitations of Early Seq2Seq Models&lt;/h1&gt;&lt;p&gt;Traditional seq2seq models had a major limitation.&lt;/p&gt;&lt;p&gt;The entire input sequence was compressed into &lt;strong&gt;a single context vector&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;This caused problems when dealing with &lt;strong&gt;long sentences&lt;/strong&gt;, because important information could be lost.&lt;/p&gt;&lt;p&gt;Researchers introduced &lt;strong&gt;attention mechanisms&lt;/strong&gt; to solve this problem.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;8. Self-Attention Mechanism&lt;/h1&gt;&lt;p&gt;Self-attention allows a model to focus on different parts of a sentence when processing each word.&lt;/p&gt;&lt;p&gt;For example, in the sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&quot;The animal didn&#39;t cross the road because it was tired&quot;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Self-attention helps the model determine that &lt;strong&gt;“it” refers to “animal.”&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Instead of compressing everything into one vector, attention enables the model to look at &lt;strong&gt;all relevant words in the sequence&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Simple Attention&lt;/h2&gt;&lt;p&gt;The basic idea is to compute a weighted combination of hidden states.&lt;/p&gt;&lt;p&gt;Each word receives an &lt;strong&gt;attention score&lt;/strong&gt; indicating how important it is for the current prediction.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Scaled Dot-Product Attention&lt;/h2&gt;&lt;p&gt;Modern transformer models use &lt;strong&gt;scaled dot-product attention&lt;/strong&gt;, defined by the following formula.&lt;/p&gt;&lt;p&gt;Attention(Q,K,V) = softmax\left(\frac{QK^T}{\sqrt{d_k}}\right)V&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt; = Query matrix&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;K&lt;/strong&gt; = Key matrix&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;V&lt;/strong&gt; = Value matrix&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;dₖ&lt;/strong&gt; = dimensionality scaling factor&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This mechanism allows models to efficiently compute relationships between all words in a sequence.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;9. Transformer Architecture&lt;/h1&gt;&lt;p&gt;The &lt;strong&gt;transformer architecture&lt;/strong&gt; revolutionized NLP.&lt;/p&gt;&lt;p&gt;Instead of processing tokens sequentially like RNNs, transformers process entire sequences &lt;strong&gt;in parallel&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;A transformer model consists of stacked layers containing:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;multi-head attention&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;feedforward neural networks&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;residual connections&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;layer normalization&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Basic architecture:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input Embeddings
↓
Positional Encoding
↓
Transformer Layers
↓
Output Layer
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;10. Encoder-Only Models&lt;/h1&gt;&lt;p&gt;Encoder-only architectures focus on &lt;strong&gt;understanding language&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;These models read input text and produce contextual representations.&lt;/p&gt;&lt;p&gt;Typical tasks include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;text classification&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;sentiment analysis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;named entity recognition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;question answering&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Example: BERT&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;BERT (Bidirectional Encoder Representations from Transformers) is an encoder-only transformer model that learns deep contextual representations by analyzing text &lt;strong&gt;bidirectionally&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;11. Decoder-Only Models&lt;/h1&gt;&lt;p&gt;Decoder-only models specialize in &lt;strong&gt;text generation&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;They predict the &lt;strong&gt;next token in a sequence&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;These models power most conversational AI systems.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example: GPT&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;GPT (Generative Pre-trained Transformer) is a decoder-only architecture designed for autoregressive language modeling and large-scale text generation.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;12. Encoder-Decoder Models&lt;/h1&gt;&lt;p&gt;Encoder-decoder models combine both architectures.&lt;/p&gt;&lt;p&gt;The encoder processes input text, and the decoder generates the output.&lt;/p&gt;&lt;p&gt;These models are commonly used for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;machine translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;summarization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;question answering&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Example: T5&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;T5 (Text-to-Text Transfer Transformer) treats every NLP task as a &lt;strong&gt;text-to-text problem&lt;/strong&gt;, making it highly versatile.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;13. Summary Generation&lt;/h1&gt;&lt;p&gt;Text summarization is an important NLP application.&lt;/p&gt;&lt;p&gt;There are two main approaches:&lt;/p&gt;&lt;h3&gt;Extractive Summarization&lt;/h3&gt;&lt;p&gt;Selects important sentences directly from the document.&lt;/p&gt;&lt;h3&gt;Abstractive Summarization&lt;/h3&gt;&lt;p&gt;Generates new sentences that capture the core meaning.&lt;/p&gt;&lt;p&gt;Modern summarization systems rely on &lt;strong&gt;transformer-based LLMs&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;14. Machine Translation&lt;/h1&gt;&lt;p&gt;Machine translation converts text from one language to another.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;English → Hindi
English → French
English → Arabic
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Early translation systems used statistical models.&lt;/p&gt;&lt;p&gt;Modern systems use &lt;strong&gt;transformer-based seq2seq architectures&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;15. Important LLM Families&lt;/h1&gt;&lt;h3&gt;BERT&lt;/h3&gt;&lt;p&gt;BERT is an encoder-based transformer model designed for deep bidirectional language understanding tasks.&lt;/p&gt;&lt;h3&gt;GPT&lt;/h3&gt;&lt;p&gt;GPT is a decoder-only autoregressive transformer model capable of generating human-like text.&lt;/p&gt;&lt;h3&gt;T5&lt;/h3&gt;&lt;p&gt;T5 is a flexible encoder-decoder architecture that treats every NLP task as a text-to-text problem.&lt;/p&gt;&lt;h3&gt;LLaMA&lt;/h3&gt;&lt;p&gt;LLaMA is a family of efficient open-weight large language models designed for research and scalable deployment.&lt;/p&gt;&lt;h3&gt;Gemini&lt;/h3&gt;&lt;p&gt;Gemini is a multimodal AI model designed to process and generate text, images, and other data modalities.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;16. The Future of Large Language Models&lt;/h1&gt;&lt;p&gt;The future of LLMs is extremely promising, but several research challenges remain.&lt;/p&gt;&lt;h2&gt;Multimodal AI&lt;/h2&gt;&lt;p&gt;Future models will integrate multiple data types:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;text&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;images&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;video&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;audio&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This will enable systems capable of richer understanding.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Retrieval-Augmented Generation&lt;/h2&gt;&lt;p&gt;Instead of relying only on training data, models will retrieve &lt;strong&gt;external knowledge sources&lt;/strong&gt; during inference.&lt;/p&gt;&lt;p&gt;This improves accuracy and reduces hallucinations.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Efficient Models&lt;/h2&gt;&lt;p&gt;Researchers are focusing on building:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;smaller models&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;energy-efficient architectures&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;on-device AI systems&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;Responsible AI&lt;/h2&gt;&lt;p&gt;Ethical considerations include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;bias in training data&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;misinformation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;privacy concerns&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Developing &lt;strong&gt;safe and responsible AI systems&lt;/strong&gt; will be a critical focus area.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Conclusion&lt;/h1&gt;&lt;p&gt;Large Language Models have revolutionized natural language processing and artificial intelligence. By combining massive datasets, powerful neural architectures, and sophisticated attention mechanisms, LLMs can understand and generate human language with unprecedented accuracy.&lt;/p&gt;&lt;p&gt;The evolution from &lt;strong&gt;TF-IDF and word embeddings&lt;/strong&gt; to &lt;strong&gt;RNNs, seq2seq models, and transformer architectures&lt;/strong&gt; represents decades of innovation in computational linguistics and machine learning.&lt;/p&gt;&lt;p&gt;Today’s models such as &lt;strong&gt;BERT, GPT, T5, LLaMA, and Gemini&lt;/strong&gt; demonstrate the immense potential of large-scale language modeling. As research continues to advance, LLMs will likely become even more capable, efficient, and integrated into everyday technology.&lt;/p&gt;&lt;p&gt;The future of NLP will be shaped by breakthroughs in &lt;strong&gt;multimodal learning, retrieval-augmented systems, and responsible AI development&lt;/strong&gt;, paving the way for more intelligent and trustworthy language technologies.&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/large-language-models-llms.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-6397604018918793247</guid><pubDate>Fri, 13 Mar 2026 05:57:36 +0000</pubDate><atom:updated>2026-03-12T22:57:36.237-07:00</atom:updated><title></title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;How NLP Works 🚀&lt;/h1&gt;&lt;hr /&gt;&lt;h1&gt;1. How NLP Works Inside ChatGPT (Step-by-Step)&lt;/h1&gt;&lt;p&gt;ChatGPT is built on a &lt;strong&gt;Transformer-based Large Language Model (LLM)&lt;/strong&gt;. The process of generating an answer goes through several stages.&lt;/p&gt;&lt;h2&gt;Step 1 — User Input&lt;/h2&gt;&lt;p&gt;Example prompt:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Explain machine learning in simple words
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The model &lt;strong&gt;cannot understand text directly&lt;/strong&gt;. It first converts the text into &lt;strong&gt;tokens&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Step 2 — Tokenization&lt;/h2&gt;&lt;p&gt;Text is split into &lt;strong&gt;subword tokens&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Explain machine learning in simple words
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Tokens might look like:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[&quot;Explain&quot;, &quot; machine&quot;, &quot; learning&quot;, &quot; in&quot;, &quot; simple&quot;, &quot; words&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each token is mapped to a &lt;strong&gt;token ID&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Token&lt;/th&gt;&lt;th&gt;Token ID&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Explain&lt;/td&gt;&lt;td&gt;10483&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;machine&lt;/td&gt;&lt;td&gt;4021&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;learning&lt;/td&gt;&lt;td&gt;6398&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h2&gt;Step 3 — Embedding Layer&lt;/h2&gt;&lt;p&gt;Each token is converted into a &lt;strong&gt;vector representation&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Explain → [0.21, -0.44, 0.91, ...]
machine → [0.67, 0.13, -0.29, ...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Typical embedding sizes:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;Vector size&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;BERT&lt;/td&gt;&lt;td&gt;768&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-3&lt;/td&gt;&lt;td&gt;12288&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;These vectors capture &lt;strong&gt;semantic meaning&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example relationship:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Paris - France + Italy ≈ Rome
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;Step 4 — Positional Encoding&lt;/h2&gt;&lt;p&gt;Transformers process tokens &lt;strong&gt;in parallel&lt;/strong&gt;, so they must know word order.&lt;/p&gt;&lt;p&gt;Position information is added to embeddings.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Position&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Explain&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;machine&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;learning&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;This ensures the model knows:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Dog bites man ≠ Man bites dog
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;Step 5 — Transformer Layers&lt;/h2&gt;&lt;p&gt;The vectors pass through &lt;strong&gt;many transformer layers&lt;/strong&gt; (sometimes 100+).&lt;/p&gt;&lt;p&gt;Each layer contains:&lt;/p&gt;&lt;p&gt;1️⃣ Self-Attention&lt;br /&gt;2️⃣ Feedforward Neural Network&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Step 6 — Self Attention&lt;/h2&gt;&lt;p&gt;Self-attention lets the model decide &lt;strong&gt;which words matter most&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The animal didn&#39;t cross the road because it was tired
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The model determines:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;it → animal
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each word attends to others.&lt;/p&gt;&lt;p&gt;Example attention weights:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Attends to&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;it&lt;/td&gt;&lt;td&gt;animal&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;cross&lt;/td&gt;&lt;td&gt;road&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;This allows &lt;strong&gt;long-range understanding&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Step 7 — Prediction of Next Token&lt;/h2&gt;&lt;p&gt;The model predicts the &lt;strong&gt;next word probability&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Artificial intelligence is transforming the _____
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Possible predictions:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Probability&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;world&lt;/td&gt;&lt;td&gt;0.42&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;industry&lt;/td&gt;&lt;td&gt;0.23&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;economy&lt;/td&gt;&lt;td&gt;0.11&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;The selected token is appended.&lt;/p&gt;&lt;p&gt;This repeats until the response is complete.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Step 8 — Text Generation&lt;/h2&gt;&lt;p&gt;Tokens are converted back into text.&lt;/p&gt;&lt;p&gt;Example output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Artificial intelligence is transforming the world by enabling machines to learn from data.
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;2. How Transformers Process a Sentence (Technical View)&lt;/h1&gt;&lt;p&gt;Transformers are built from &lt;strong&gt;stacked attention blocks&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;A simplified architecture:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input Tokens
      ↓
Embedding Layer
      ↓
Positional Encoding
      ↓
Transformer Block × N
      ↓
Output Probabilities
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;The Core Attention Formula&lt;/h2&gt;&lt;p&gt;The heart of transformers is the &lt;strong&gt;Scaled Dot Product Attention&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Attention(Q,K,V) = softmax\left(\frac{QK^T}{\sqrt{d_k}}\right)V&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Symbol&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Q&lt;/td&gt;&lt;td&gt;Query matrix&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;K&lt;/td&gt;&lt;td&gt;Key matrix&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;V&lt;/td&gt;&lt;td&gt;Value matrix&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dk&lt;/td&gt;&lt;td&gt;dimension scaling factor&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Interpretation:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Compute similarity between words&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Normalize using softmax&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Combine contextual information&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h2&gt;Multi-Head Attention&lt;/h2&gt;&lt;p&gt;Instead of one attention calculation, transformers run &lt;strong&gt;multiple attention heads&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Head&lt;/th&gt;&lt;th&gt;Focus&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Head 1&lt;/td&gt;&lt;td&gt;syntax&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Head 2&lt;/td&gt;&lt;td&gt;subject-object relations&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Head 3&lt;/td&gt;&lt;td&gt;semantic meaning&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;This allows &lt;strong&gt;parallel understanding of language patterns&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. Complete NLP Technology Stack&lt;/h1&gt;&lt;p&gt;Here is the &lt;strong&gt;real-world ecosystem used by NLP engineers&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Programming Language&lt;/h2&gt;&lt;p&gt;Most NLP work uses:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Python
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Because of rich libraries.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Core NLP Libraries&lt;/h2&gt;&lt;h3&gt;NLTK&lt;/h3&gt;&lt;p&gt;Best for &lt;strong&gt;learning NLP fundamentals&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Capabilities:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;tokenization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;stemming&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;parsing&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;corpus datasets&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;from nltk.tokenize import word_tokenize
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;spaCy&lt;/h3&gt;&lt;p&gt;Industrial NLP library.&lt;/p&gt;&lt;p&gt;Faster than NLTK.&lt;/p&gt;&lt;p&gt;Capabilities:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;POS tagging&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;named entity recognition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;dependency parsing&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import spacy
nlp = spacy.load(&quot;en_core_web_sm&quot;)
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;Hugging Face Transformers&lt;/h3&gt;&lt;p&gt;Most popular deep learning NLP library.&lt;/p&gt;&lt;p&gt;Provides pretrained models:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;BERT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;GPT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;T5&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;RoBERTa&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;from transformers import pipeline

classifier = pipeline(&quot;sentiment-analysis&quot;)
classifier(&quot;I love NLP&quot;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Positive (0.99)
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;Deep Learning Frameworks&lt;/h2&gt;&lt;p&gt;NLP models are trained using:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Framework&lt;/th&gt;&lt;th&gt;Use&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;PyTorch&lt;/td&gt;&lt;td&gt;research + production&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;TensorFlow&lt;/td&gt;&lt;td&gt;production pipelines&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;JAX&lt;/td&gt;&lt;td&gt;high-performance research&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h2&gt;Vector Databases (Modern NLP)&lt;/h2&gt;&lt;p&gt;Used in &lt;strong&gt;RAG systems&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Database&lt;/th&gt;&lt;th&gt;Use&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Pinecone&lt;/td&gt;&lt;td&gt;vector search&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Weaviate&lt;/td&gt;&lt;td&gt;semantic search&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;FAISS&lt;/td&gt;&lt;td&gt;fast similarity search&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;4. Practical NLP Roadmap for Beginners&lt;/h1&gt;&lt;p&gt;If someone wants to &lt;strong&gt;master NLP&lt;/strong&gt;, here is a practical roadmap.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Stage 1 — Foundations&lt;/h1&gt;&lt;p&gt;Learn basics:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Python&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;probability&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;linear algebra&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;machine learning&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Essential ML algorithms:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;logistic regression&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;naive bayes&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;SVM&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;decision trees&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Stage 2 — Classical NLP&lt;/h1&gt;&lt;p&gt;Learn core techniques:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;tokenization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;TF-IDF&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;bag of words&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;n-grams&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Projects:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;spam classifier&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;sentiment analysis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;document classifier&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Libraries:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;NLTK&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;scikit-learn&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Stage 3 — Word Embeddings&lt;/h1&gt;&lt;p&gt;Learn representation learning.&lt;/p&gt;&lt;p&gt;Important models:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Word2Vec&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;GloVe&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;FastText&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Project:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Word similarity detection
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;Stage 4 — Deep Learning NLP&lt;/h1&gt;&lt;p&gt;Learn sequence models:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;RNN&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;LSTM&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;GRU&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Project:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Language model
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Frameworks:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;PyTorch&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;TensorFlow&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Stage 5 — Transformers&lt;/h1&gt;&lt;p&gt;Learn modern architectures:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;attention mechanism&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;BERT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;GPT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;T5&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Projects:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;chatbot&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;summarizer&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;translation system&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Library:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;HuggingFace Transformers
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;Stage 6 — Advanced NLP&lt;/h1&gt;&lt;p&gt;Topics include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Retrieval Augmented Generation (RAG)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;knowledge graphs&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;multimodal models&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;prompt engineering&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Projects:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;question answering system&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;AI assistant&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;document search engine&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;5. Real-World NLP Applications&lt;/h1&gt;&lt;p&gt;Some of the biggest systems powered by NLP:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Application&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Search engines&lt;/td&gt;&lt;td&gt;Google&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Chatbots&lt;/td&gt;&lt;td&gt;ChatGPT&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Translation&lt;/td&gt;&lt;td&gt;Google Translate&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Voice assistants&lt;/td&gt;&lt;td&gt;Alexa, Siri&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Spam detection&lt;/td&gt;&lt;td&gt;Gmail&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Document summarization&lt;/td&gt;&lt;td&gt;legal AI&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;6. Key Insight About NLP Evolution&lt;/h1&gt;&lt;p&gt;The field has evolved in &lt;strong&gt;three major eras&lt;/strong&gt;:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Era&lt;/th&gt;&lt;th&gt;Approach&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Rule-based (1980s)&lt;/td&gt;&lt;td&gt;handcrafted linguistic rules&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Statistical NLP (2000s)&lt;/td&gt;&lt;td&gt;probabilistic models&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Deep Learning NLP (2015+)&lt;/td&gt;&lt;td&gt;neural networks + transformers&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Today we are in the &lt;strong&gt;LLM era&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;7. One Powerful Mental Model&lt;/h1&gt;&lt;p&gt;You can think of NLP as &lt;strong&gt;three layers&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Language Understanding
        ↓
Mathematical Representation
        ↓
Neural Network Learning
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Text → vectors → predictions.&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;✅ &lt;strong&gt;Final takeaway&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Natural Language Processing is a &lt;strong&gt;combination of linguistics, statistics, and deep learning&lt;/strong&gt; that converts human language into numerical representations so machines can &lt;strong&gt;understand, analyze, and generate text intelligently&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/how-nlp-works-1.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-6603846408020907639</guid><pubDate>Fri, 13 Mar 2026 04:52:00 +0000</pubDate><atom:updated>2026-03-12T21:52:20.167-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Applications of Deep Learning</category><category domain="http://www.blogger.com/atom/ns#">Large Language Models</category><category domain="http://www.blogger.com/atom/ns#">LLM</category><category domain="http://www.blogger.com/atom/ns#">Natural Language Processing</category><category domain="http://www.blogger.com/atom/ns#">NLP</category><category domain="http://www.blogger.com/atom/ns#">RAG</category><category domain="http://www.blogger.com/atom/ns#">Retrieval Augmented Generation</category><category domain="http://www.blogger.com/atom/ns#">Transformers</category><category domain="http://www.blogger.com/atom/ns#">Word Embeddings</category><category domain="http://www.blogger.com/atom/ns#">Word2Vec</category><title>Natural Language Processing (NLP): Overview and Challenges</title><description>&lt;p&gt;&amp;nbsp;Natural Language Processing (&lt;strong&gt;NLP&lt;/strong&gt;) is one of the most fascinating areas of &lt;strong&gt;Artificial Intelligence (AI)&lt;/strong&gt; because it enables computers to understand, interpret, and generate &lt;strong&gt;human language&lt;/strong&gt;. If you have used tools like &lt;strong&gt;chatbots, voice assistants, machine translation, or search engines&lt;/strong&gt;, you have already interacted with NLP systems.&lt;/p&gt;&lt;p&gt;Below is a &lt;strong&gt;structured, detailed overview&lt;/strong&gt; covering fundamentals, architecture, technical methods, challenges, and modern developments.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. What is Natural Language Processing (NLP)?&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Natural Language Processing (NLP)&lt;/strong&gt; is a field that combines:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Computer Science&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Artificial Intelligence&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Linguistics&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Machine Learning&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Its goal is to enable computers to &lt;strong&gt;process, understand, and generate human language&lt;/strong&gt; (text or speech).&lt;/p&gt;&lt;h3&gt;Simple Definition&lt;/h3&gt;&lt;p&gt;NLP allows machines to &lt;strong&gt;convert human language into structured data&lt;/strong&gt; so that algorithms can process it.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Input sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“The movie was surprisingly good.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;NLP system may convert it into:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Part of Speech&lt;/th&gt;&lt;th&gt;Sentiment&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;The&lt;/td&gt;&lt;td&gt;Determiner&lt;/td&gt;&lt;td&gt;Neutral&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;movie&lt;/td&gt;&lt;td&gt;Noun&lt;/td&gt;&lt;td&gt;Neutral&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;surprisingly&lt;/td&gt;&lt;td&gt;Adverb&lt;/td&gt;&lt;td&gt;Neutral&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;good&lt;/td&gt;&lt;td&gt;Adjective&lt;/td&gt;&lt;td&gt;Positive&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;From this representation, a machine may infer &lt;strong&gt;positive sentiment&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. Why NLP is Difficult (Core Challenges)&lt;/h1&gt;&lt;p&gt;Human language is &lt;strong&gt;extremely complex and ambiguous&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;1. Ambiguity&lt;/h3&gt;&lt;p&gt;A sentence can have multiple meanings.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“I saw the man with a telescope.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Possible meanings:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;You used a telescope.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;The man had the telescope.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Types of ambiguity:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Lexical ambiguity&lt;/td&gt;&lt;td&gt;bank (river bank / financial bank)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Syntactic ambiguity&lt;/td&gt;&lt;td&gt;flying planes can be dangerous&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Semantic ambiguity&lt;/td&gt;&lt;td&gt;visiting relatives can be boring&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Pragmatic ambiguity&lt;/td&gt;&lt;td&gt;context-dependent meaning&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h3&gt;2. Context Understanding&lt;/h3&gt;&lt;p&gt;Humans easily use context.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“The trophy doesn&#39;t fit into the suitcase because &lt;strong&gt;it&lt;/strong&gt; is too big.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;What is &lt;strong&gt;it&lt;/strong&gt;?&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;trophy?&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;suitcase?&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Understanding requires &lt;strong&gt;common sense reasoning&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;3. Idioms and Figurative Language&lt;/h3&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“Kick the bucket”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Literal meaning:&lt;br /&gt;kick + bucket&lt;/p&gt;&lt;p&gt;Actual meaning:&lt;br /&gt;&lt;strong&gt;to die&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Machines struggle with idioms, sarcasm, and metaphors.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;4. Language Variability&lt;/h3&gt;&lt;p&gt;People express the same meaning differently.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;“Close the door.”&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;“Shut the door.”&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;“Could you please close the door?”&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Same intent, different forms.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;5. Multilingual Complexity&lt;/h3&gt;&lt;p&gt;Languages vary widely.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Language&lt;/th&gt;&lt;th&gt;Word order&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;English&lt;/td&gt;&lt;td&gt;Subject Verb Object&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Hindi&lt;/td&gt;&lt;td&gt;Subject Object Verb&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Arabic&lt;/td&gt;&lt;td&gt;Verb Subject Object&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Models must handle grammar differences.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. NLP Processing Pipeline&lt;/h1&gt;&lt;p&gt;Traditional NLP follows a &lt;strong&gt;multi-stage pipeline&lt;/strong&gt;.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Text Input
   ↓
Tokenization
   ↓
Normalization
   ↓
Syntactic Analysis
   ↓
Semantic Analysis
   ↓
Task-specific Model
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Let&#39;s explore each stage.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;4. Core NLP Preprocessing Steps&lt;/h1&gt;&lt;h2&gt;4.1 Tokenization&lt;/h2&gt;&lt;p&gt;Tokenization splits text into &lt;strong&gt;smaller units&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“NLP is transforming technology.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Tokens:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[&quot;NLP&quot;, &quot;is&quot;, &quot;transforming&quot;, &quot;technology&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Types:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Word tokenization&lt;/td&gt;&lt;td&gt;split by words&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Sentence tokenization&lt;/td&gt;&lt;td&gt;split by sentences&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Subword tokenization&lt;/td&gt;&lt;td&gt;BPE, WordPiece&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Subword tokenization is widely used in &lt;strong&gt;modern transformers&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;unbelievable → un + believe + able
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;4.2 Text Normalization&lt;/h2&gt;&lt;p&gt;Cleaning text to standard format.&lt;/p&gt;&lt;p&gt;Steps may include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Lowercasing&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Removing punctuation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Removing stopwords&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Expanding contractions&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&quot;I can&#39;t believe it!&quot; → &quot;i cannot believe it&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;4.3 Stopword Removal&lt;/h2&gt;&lt;p&gt;Stopwords are very common words.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;the&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;is&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;a&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;and&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Removing them reduces noise.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&quot;The cat is on the mat&quot;
→ [&quot;cat&quot;, &quot;mat&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But in &lt;strong&gt;modern deep learning models&lt;/strong&gt;, stopwords are often &lt;strong&gt;kept&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;4.4 Stemming&lt;/h2&gt;&lt;p&gt;Stemming reduces words to their &lt;strong&gt;root form&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Stem&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;running&lt;/td&gt;&lt;td&gt;run&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;played&lt;/td&gt;&lt;td&gt;play&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;happiness&lt;/td&gt;&lt;td&gt;happi&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Algorithms:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Porter Stemmer&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Snowball Stemmer&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;4.5 Lemmatization&lt;/h2&gt;&lt;p&gt;More advanced than stemming.&lt;/p&gt;&lt;p&gt;It converts words into &lt;strong&gt;dictionary form (lemma)&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Lemma&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;running&lt;/td&gt;&lt;td&gt;run&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;better&lt;/td&gt;&lt;td&gt;good&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;was&lt;/td&gt;&lt;td&gt;be&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Requires &lt;strong&gt;linguistic knowledge&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;5. Syntactic Analysis&lt;/h1&gt;&lt;p&gt;This stage analyzes &lt;strong&gt;grammatical structure&lt;/strong&gt;.&lt;/p&gt;&lt;h2&gt;5.1 Part-of-Speech (POS) Tagging&lt;/h2&gt;&lt;p&gt;Assign grammatical labels.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“The dog barked loudly.”&lt;/p&gt;&lt;/blockquote&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;POS&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;The&lt;/td&gt;&lt;td&gt;Determiner&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dog&lt;/td&gt;&lt;td&gt;Noun&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;barked&lt;/td&gt;&lt;td&gt;Verb&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;loudly&lt;/td&gt;&lt;td&gt;Adverb&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Used in:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;parsing&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;grammar checking&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;information extraction&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;5.2 Parsing&lt;/h2&gt;&lt;p&gt;Parsing determines &lt;strong&gt;sentence structure&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“The boy ate the apple.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Parse tree:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;       Sentence
       /     \
     NP       VP
    /         / \
  The boy   ate  apple
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Two main types:&lt;/p&gt;&lt;h3&gt;Constituency Parsing&lt;/h3&gt;&lt;p&gt;Groups words into phrases.&lt;/p&gt;&lt;h3&gt;Dependency Parsing&lt;/h3&gt;&lt;p&gt;Shows relationships between words.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;ate → subject → boy
ate → object → apple
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;6. Semantic Analysis&lt;/h1&gt;&lt;p&gt;Semantic analysis determines &lt;strong&gt;meaning&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;6.1 Named Entity Recognition (NER)&lt;/h2&gt;&lt;p&gt;NER identifies &lt;strong&gt;important entities&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“Elon Musk founded SpaceX in California.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Entities:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Word&lt;/th&gt;&lt;th&gt;Entity&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Elon Musk&lt;/td&gt;&lt;td&gt;Person&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;SpaceX&lt;/td&gt;&lt;td&gt;Organization&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;California&lt;/td&gt;&lt;td&gt;Location&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Applications:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;search engines&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;knowledge graphs&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;news analysis&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;6.2 Word Sense Disambiguation&lt;/h2&gt;&lt;p&gt;Resolve multiple meanings.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“He deposited money in the bank.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Meaning:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;financial institution&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;vs&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“He sat on the river bank.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Meaning:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;river edge&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;6.3 Coreference Resolution&lt;/h2&gt;&lt;p&gt;Determines what pronouns refer to.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“John went to the store. He bought milk.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;“He” → John&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;7. NLP Representation Methods&lt;/h1&gt;&lt;p&gt;Machines cannot understand text directly. It must be converted into &lt;strong&gt;numbers&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;7.1 Bag of Words (BoW)&lt;/h1&gt;&lt;p&gt;Simplest representation.&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&quot;I love NLP&quot;
&quot;I love AI&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Vocabulary:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[I, love, NLP, AI]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Vector representation:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Sentence&lt;/th&gt;&lt;th&gt;I&lt;/th&gt;&lt;th&gt;love&lt;/th&gt;&lt;th&gt;NLP&lt;/th&gt;&lt;th&gt;AI&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;I love NLP&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;I love AI&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Problems:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;ignores word order&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;loses context&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;7.2 TF-IDF&lt;/h1&gt;&lt;p&gt;Improves Bag of Words.&lt;/p&gt;&lt;p&gt;Measures importance of words.&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;TF-IDF = TF \times \log(\frac{N}{DF})&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;TF = term frequency&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;DF = document frequency&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;N = number of documents&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Advantage:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;rare but meaningful words get higher weight.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;7.3 Word Embeddings&lt;/h1&gt;&lt;p&gt;Modern NLP uses &lt;strong&gt;dense vector representations&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Words become vectors.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;king → [0.25, -0.91, 0.78 ...]
queen → [0.28, -0.88, 0.80 ...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Embeddings capture &lt;strong&gt;semantic relationships&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example famous property:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;king − man + woman ≈ queen
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Popular methods:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;Year&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Word2Vec&lt;/td&gt;&lt;td&gt;2013&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GloVe&lt;/td&gt;&lt;td&gt;2014&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;FastText&lt;/td&gt;&lt;td&gt;2016&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;8. Deep Learning for NLP&lt;/h1&gt;&lt;p&gt;Modern NLP relies heavily on &lt;strong&gt;neural networks&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;8.1 Recurrent Neural Networks (RNN)&lt;/h2&gt;&lt;p&gt;Designed for &lt;strong&gt;sequential data&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;They process words one by one.&lt;/p&gt;&lt;p&gt;Example sequence:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;I → love → natural → language → processing
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each word updates the hidden state.&lt;/p&gt;&lt;p&gt;Problem:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;vanishing gradients&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;difficult to learn long context&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;8.2 LSTM and GRU&lt;/h2&gt;&lt;p&gt;Improved RNNs.&lt;/p&gt;&lt;p&gt;LSTM introduces &lt;strong&gt;memory cells&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Key components:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;forget gate&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;input gate&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;output gate&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;They allow networks to remember &lt;strong&gt;long-term dependencies&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;9. Transformers (Modern NLP Revolution)&lt;/h1&gt;&lt;p&gt;In 2017, the paper:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;“Attention Is All You Need”&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;introduced the &lt;strong&gt;Transformer architecture&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Transformers replaced RNNs.&lt;/p&gt;&lt;p&gt;Key innovation:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Self-Attention Mechanism&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Instead of processing sequentially, the model &lt;strong&gt;looks at all words simultaneously&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Sentence:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“The animal didn’t cross the road because it was tired.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Attention helps determine:&lt;/p&gt;&lt;p&gt;“it” → animal&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Self Attention Concept&lt;/h2&gt;&lt;p&gt;Each word attends to other words.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;dog attends to → barked
dog attends to → loudly
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This allows capturing &lt;strong&gt;long-distance relationships&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;10. Large Language Models (LLMs)&lt;/h1&gt;&lt;p&gt;Modern NLP systems like &lt;strong&gt;ChatGPT&lt;/strong&gt; are based on &lt;strong&gt;Large Language Models&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Characteristics:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;billions of parameters&lt;/td&gt;&lt;td&gt;massive neural networks&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;trained on huge text corpora&lt;/td&gt;&lt;td&gt;internet scale data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;self-supervised learning&lt;/td&gt;&lt;td&gt;predict next word&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Training objective:&lt;/p&gt;&lt;p&gt;Predict next token:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;The capital of France is → Paris
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;GPT models&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;BERT&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;T5&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;PaLM&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;LLaMA&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;11. Major NLP Tasks&lt;/h1&gt;&lt;p&gt;NLP powers many applications.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Task&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Sentiment analysis&lt;/td&gt;&lt;td&gt;movie review classification&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Machine translation&lt;/td&gt;&lt;td&gt;English → Hindi&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Question answering&lt;/td&gt;&lt;td&gt;search engines&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Text summarization&lt;/td&gt;&lt;td&gt;news summaries&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Chatbots&lt;/td&gt;&lt;td&gt;customer support&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Speech recognition&lt;/td&gt;&lt;td&gt;voice assistants&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Named entity recognition&lt;/td&gt;&lt;td&gt;information extraction&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Topic modeling&lt;/td&gt;&lt;td&gt;document clustering&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;12. Evaluation Metrics in NLP&lt;/h1&gt;&lt;p&gt;Different tasks use different metrics.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Task&lt;/th&gt;&lt;th&gt;Metric&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Classification&lt;/td&gt;&lt;td&gt;accuracy, F1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Machine translation&lt;/td&gt;&lt;td&gt;BLEU score&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Summarization&lt;/td&gt;&lt;td&gt;ROUGE&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Language modeling&lt;/td&gt;&lt;td&gt;perplexity&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Perplexity&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Measures how well a model predicts text.&lt;/p&gt;&lt;p&gt;Lower perplexity → better model.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;13. Key Technical Challenges in NLP&lt;/h1&gt;&lt;p&gt;Despite progress, NLP still faces major problems.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;13.1 Common Sense Reasoning&lt;/h2&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“The glass fell off the table and broke. Why?”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Humans know:&lt;/p&gt;&lt;p&gt;Glass is fragile.&lt;/p&gt;&lt;p&gt;Machines struggle with such reasoning.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;13.2 Bias in Training Data&lt;/h2&gt;&lt;p&gt;Models trained on internet data may learn biases.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Gender stereotypes.&lt;/p&gt;&lt;p&gt;This is a major ethical concern.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;13.3 Hallucinations&lt;/h2&gt;&lt;p&gt;LLMs sometimes generate &lt;strong&gt;confident but incorrect answers&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Invented citations.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;13.4 Data Scarcity for Many Languages&lt;/h2&gt;&lt;p&gt;Most NLP models focus on:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;English&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Chinese&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Spanish&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Many languages lack large datasets.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;13.5 Long Context Understanding&lt;/h2&gt;&lt;p&gt;Even large models struggle with &lt;strong&gt;very long documents&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;14. Future Directions in NLP&lt;/h1&gt;&lt;p&gt;The field is evolving rapidly.&lt;/p&gt;&lt;p&gt;Key research areas:&lt;/p&gt;&lt;h3&gt;Multimodal AI&lt;/h3&gt;&lt;p&gt;Combining:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;text&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;images&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;video&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;audio&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Image captioning.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Retrieval Augmented Generation (RAG)&lt;/h3&gt;&lt;p&gt;Instead of relying only on training data, models &lt;strong&gt;retrieve external information&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Benefits:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;more accurate answers&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;updated knowledge&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Smaller Efficient Models&lt;/h3&gt;&lt;p&gt;Goal:&lt;/p&gt;&lt;p&gt;Run powerful NLP models on &lt;strong&gt;mobile devices&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Explainable NLP&lt;/h3&gt;&lt;p&gt;Understanding &lt;strong&gt;why a model made a decision&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Important for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;healthcare&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;law&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;finance&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;15. Summary (Quick Mental Map)&lt;/h1&gt;&lt;pre&gt;&lt;code&gt;NLP
 │
 ├─ Text Preprocessing
 │    ├ tokenization
 │    ├ stemming
 │    └ lemmatization
 │
 ├─ Linguistic Analysis
 │    ├ POS tagging
 │    ├ parsing
 │    └ semantics
 │
 ├─ Representation
 │    ├ Bag of Words
 │    ├ TF-IDF
 │    └ Embeddings
 │
 ├─ Models
 │    ├ RNN / LSTM
 │    └ Transformers
 │
 └─ Applications
      ├ chatbots
      ├ translation
      ├ summarization
      └ sentiment analysis
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;p&gt;✅ &lt;strong&gt;One sentence takeaway&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Natural Language Processing converts human language into structured representations so machines can understand, reason, and generate text using statistical, linguistic, and deep learning methods.&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/natural-language-processing-nlp.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-5809898768082615738</guid><pubDate>Thu, 12 Mar 2026 10:05:00 +0000</pubDate><atom:updated>2026-03-12T03:05:04.181-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Artificial Intelligence</category><category domain="http://www.blogger.com/atom/ns#">Deep Learning</category><category domain="http://www.blogger.com/atom/ns#">Machine Learning</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks</category><category domain="http://www.blogger.com/atom/ns#">OR Gate</category><title>Implementing OR Gate using Neural Networks</title><description>&lt;p&gt;&amp;nbsp;Implementing an &lt;strong&gt;OR gate using a neural network&lt;/strong&gt; is one of the simplest ways to understand how neurons compute outputs. Let’s go step-by-step with the &lt;strong&gt;actual calculations&lt;/strong&gt;, so you can clearly see how a neural network produces the OR logic. 🧠&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. OR Gate Logic&lt;/h1&gt;&lt;p&gt;The OR gate outputs &lt;strong&gt;1 if at least one input is 1&lt;/strong&gt;.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;X₁&lt;/th&gt;&lt;th&gt;X₂&lt;/th&gt;&lt;th&gt;Output (Y)&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;A &lt;strong&gt;single neuron (perceptron)&lt;/strong&gt; can implement this because OR is &lt;strong&gt;linearly separable&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. Neural Network Representation&lt;/h1&gt;&lt;p&gt;A neuron computes:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = w_1 x_1 + w_2 x_2 + b&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;(x_1, x_2) = inputs&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;(w_1, w_2) = weights&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;(b) = bias&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;(z) = weighted sum&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Then an &lt;strong&gt;activation function&lt;/strong&gt; determines the output.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Perceptron Activation (Step Function)&lt;/h2&gt;&lt;p&gt;Output rule:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;y =&lt;br /&gt;\begin{cases}&lt;br /&gt;1 &amp;amp; \text{if } z \ge 0 \&lt;br /&gt;0 &amp;amp; \text{if } z &amp;lt; 0&lt;br /&gt;\end{cases}&lt;br /&gt;]&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. Choosing Weights and Bias&lt;/h1&gt;&lt;p&gt;For an OR gate we can choose:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;w1 = 1
w2 = 1
bias = -0.5
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So the neuron computes:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = 1x_1 + 1x_2 - 0.5&lt;br /&gt;]&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;4. Calculations for Each Input&lt;/h1&gt;&lt;h2&gt;Case 1&lt;/h2&gt;&lt;p&gt;Inputs:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;x1 = 0
x2 = 0
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Calculation:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = (1×0) + (1×0) - 0.5&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = -0.5&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Activation:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;z &amp;lt; 0 → output = 0
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;✔ Correct&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Case 2&lt;/h2&gt;&lt;p&gt;Inputs:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;x1 = 0
x2 = 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Calculation:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = (1×0) + (1×1) - 0.5&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = 0.5&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Activation:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;z ≥ 0 → output = 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;✔ Correct&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Case 3&lt;/h2&gt;&lt;p&gt;Inputs:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;x1 = 1
x2 = 0
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Calculation:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = (1×1) + (1×0) - 0.5&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = 0.5&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Activation:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;z ≥ 0 → output = 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;✔ Correct&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Case 4&lt;/h2&gt;&lt;p&gt;Inputs:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;x1 = 1
x2 = 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Calculation:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = (1×1) + (1×1) - 0.5&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = 1.5&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Activation:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;z ≥ 0 → output = 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;✔ Correct&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;5. Final Table with Calculations&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;X1&lt;/th&gt;&lt;th&gt;X2&lt;/th&gt;&lt;th&gt;z = w1x1 + w2x2 + b&lt;/th&gt;&lt;th&gt;Output&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;-0.5&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;0.5&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;0.5&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1.5&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;6. Geometric Interpretation&lt;/h1&gt;&lt;p&gt;The perceptron creates a &lt;strong&gt;decision boundary&lt;/strong&gt;:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;x_1 + x_2 - 0.5 = 0&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;This is a straight line separating:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;class &lt;strong&gt;0&lt;/strong&gt; → (0,0)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;class &lt;strong&gt;1&lt;/strong&gt; → others&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Meaning:&lt;/p&gt;&lt;p&gt;The OR gate is &lt;strong&gt;linearly separable&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;7. Neural Network Structure&lt;/h1&gt;&lt;pre&gt;&lt;code&gt;Input Layer
   x1   x2
    │   │
    └───┘
      │
   Weighted Sum
      │
   Activation
      │
    Output
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Only &lt;strong&gt;one neuron is needed&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;8. Why Neural Networks Can Implement Logic Gates&lt;/h1&gt;&lt;p&gt;Because neurons compute:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;weighted sum + threshold
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;which is exactly how &lt;strong&gt;Boolean logic boundaries&lt;/strong&gt; work.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;9. Quick Memory Trick&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;OR gate rule&lt;/strong&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt;If sum of inputs ≥ 1 → output 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Neural network implements this as:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;x1 + x2 − 0.5 ≥ 0
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;10. Important Insight&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Gate&lt;/th&gt;&lt;th&gt;Linear?&lt;/th&gt;&lt;th&gt;Layers Needed&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;OR&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;AND&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;NOT&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;XOR&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;This is why XOR historically led to the development of &lt;strong&gt;multi-layer neural networks&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/implementing-or-gate-using-neural.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-1944458850110912855</guid><pubDate>Thu, 12 Mar 2026 10:02:00 +0000</pubDate><atom:updated>2026-03-12T03:02:39.638-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Deep Learning</category><category domain="http://www.blogger.com/atom/ns#">Machine Learning</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks</category><category domain="http://www.blogger.com/atom/ns#">Tensorflow</category><title>Tensorflow Playground: What it is and How to use it</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2&gt;TensorFlow Playground — How to Use It and Interpret Results&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;TensorFlow Playground&lt;/strong&gt; is one of the best tools to &lt;strong&gt;visually understand how neural networks learn&lt;/strong&gt;. It lets you experiment with neural network architecture, activation functions, learning rate, and more — and immediately see how the model behaves.&lt;/p&gt;&lt;p&gt;Think of it as a &lt;strong&gt;neural network laboratory in your browser&lt;/strong&gt;. 🧠&lt;/p&gt;&lt;p&gt;You can open it here:&lt;br /&gt;&lt;a href=&quot;https://playground.tensorflow.org/&quot;&gt;https://playground.tensorflow.org&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. What TensorFlow Playground Is&lt;/h1&gt;&lt;p&gt;TensorFlow Playground is an &lt;strong&gt;interactive simulation of a neural network&lt;/strong&gt; that allows you to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Build neural network architectures&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Train models visually&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Understand how features are learned&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Observe effects of hyperparameters&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;It is perfect for understanding concepts like:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Hidden layers&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Activation functions&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Overfitting&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Decision boundaries&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Feature transformations&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;2. Interface Overview&lt;/h1&gt;&lt;p&gt;When you open the playground you will see several panels.&lt;/p&gt;&lt;h2&gt;Left Panel — Dataset Selection&lt;/h2&gt;&lt;p&gt;You can choose different datasets:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Circle dataset&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;XOR dataset&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gaussian clusters&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Spiral dataset&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;These represent different &lt;strong&gt;classification problems&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;Interpretation&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Simple datasets → easy to classify&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Complex datasets → require deeper networks&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Dataset&lt;/th&gt;&lt;th&gt;Difficulty&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Gaussian&lt;/td&gt;&lt;td&gt;Easy&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Circle&lt;/td&gt;&lt;td&gt;Moderate&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;XOR&lt;/td&gt;&lt;td&gt;Non-linear&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Spiral&lt;/td&gt;&lt;td&gt;Very hard&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory tip:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;More complex pattern → deeper network needed&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. Feature Inputs Section&lt;/h1&gt;&lt;p&gt;You will see several input features:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;X1
X2
X1²
X2²
X1*X2
sin(X1)
sin(X2)
&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;What they mean&lt;/h3&gt;&lt;p&gt;These represent &lt;strong&gt;feature engineering options&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;If the model cannot learn a pattern easily, adding &lt;strong&gt;nonlinear features&lt;/strong&gt; can help.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Circle dataset works better if:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;X1²
X2²
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;are enabled.&lt;/p&gt;&lt;p&gt;Why?&lt;/p&gt;&lt;p&gt;Because circles are &lt;strong&gt;quadratic patterns&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;4. Neural Network Architecture Panel&lt;/h1&gt;&lt;p&gt;In the center you will see the neural network diagram.&lt;/p&gt;&lt;p&gt;You can adjust:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Number of &lt;strong&gt;hidden layers&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Number of &lt;strong&gt;neurons per layer&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example architecture:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input → 4 neurons → 4 neurons → Output
&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Interpretation&lt;/h3&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Architecture&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;More neurons&lt;/td&gt;&lt;td&gt;Higher model capacity&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;More layers&lt;/td&gt;&lt;td&gt;Deeper feature learning&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Too many neurons&lt;/td&gt;&lt;td&gt;Risk of overfitting&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory tip:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Depth learns hierarchy&lt;br /&gt;Width learns complexity&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;5. Hyperparameters Panel&lt;/h1&gt;&lt;p&gt;You can modify several important hyperparameters.&lt;/p&gt;&lt;h2&gt;Learning Rate&lt;/h2&gt;&lt;p&gt;Controls how fast weights update.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Learning Rate&lt;/th&gt;&lt;th&gt;Effect&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Too small&lt;/td&gt;&lt;td&gt;Slow learning&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Too large&lt;/td&gt;&lt;td&gt;Unstable training&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Moderate&lt;/td&gt;&lt;td&gt;Smooth convergence&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Typical good value:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;0.01 – 0.03
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;Activation Function&lt;/h2&gt;&lt;p&gt;Options include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;ReLU&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Tanh&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Sigmoid&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Linear&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Interpretation&lt;/h3&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Activation&lt;/th&gt;&lt;th&gt;Behavior&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;ReLU&lt;/td&gt;&lt;td&gt;Fast training&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Tanh&lt;/td&gt;&lt;td&gt;Smooth learning&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Sigmoid&lt;/td&gt;&lt;td&gt;Probability outputs&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Linear&lt;/td&gt;&lt;td&gt;No non-linearity&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Rule of thumb:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Hidden layers → ReLU or Tanh
Output → Sigmoid / Softmax
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;Regularization&lt;/h2&gt;&lt;p&gt;Controls &lt;strong&gt;model complexity&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Types:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;L1&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;L2&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Purpose:&lt;/p&gt;&lt;p&gt;Prevent &lt;strong&gt;overfitting&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;6. Training Visualization&lt;/h1&gt;&lt;p&gt;When you press &lt;strong&gt;Play&lt;/strong&gt;, training begins.&lt;/p&gt;&lt;p&gt;Several things update in real time.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;A. Decision Boundary (Main Graph)&lt;/h2&gt;&lt;p&gt;The colored background shows &lt;strong&gt;how the model separates classes&lt;/strong&gt;.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Blue region → class 1&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Orange region → class 2&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Dots represent training samples.&lt;/p&gt;&lt;h3&gt;Interpretation&lt;/h3&gt;&lt;p&gt;Good model:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Decision boundary separates classes correctly
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Bad model:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Mixed regions and misclassified points
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h2&gt;B. Neuron Visualizations&lt;/h2&gt;&lt;p&gt;Each neuron shows a small heatmap representing &lt;strong&gt;what feature pattern it learned&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;p&gt;A neuron may detect:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Vertical boundary&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Circular shape&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Diagonal separation&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Meaning:&lt;/p&gt;&lt;p&gt;Each neuron becomes a &lt;strong&gt;feature detector&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;C. Weight Thickness&lt;/h2&gt;&lt;p&gt;Connections between neurons have different thickness.&lt;/p&gt;&lt;p&gt;Meaning:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Thicker line → stronger weight
Thinner line → weaker influence
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;7. Loss Graph&lt;/h1&gt;&lt;p&gt;On the right side you see &lt;strong&gt;loss decreasing over time&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Loss measures &lt;strong&gt;prediction error&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Good training looks like:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Loss
│
│\
│ \
│  \____
│
└───────── iterations
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Interpretation:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Pattern&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Smooth decrease&lt;/td&gt;&lt;td&gt;Good learning&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Flat line&lt;/td&gt;&lt;td&gt;Model stuck&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Oscillations&lt;/td&gt;&lt;td&gt;Learning rate too high&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;8. Typical Experiments to Try&lt;/h1&gt;&lt;p&gt;These experiments make concepts crystal clear.&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Experiment 1 — Underfitting&lt;/h2&gt;&lt;p&gt;Dataset:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Spiral
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Network:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;1 hidden layer
2 neurons
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Result:&lt;/p&gt;&lt;p&gt;Model fails to learn pattern.&lt;/p&gt;&lt;p&gt;Conclusion:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Network capacity too small.&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Experiment 2 — Overfitting&lt;/h2&gt;&lt;p&gt;Dataset:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Few training points
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Network:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Large deep network
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Result:&lt;/p&gt;&lt;p&gt;Decision boundary becomes extremely complex.&lt;/p&gt;&lt;p&gt;Conclusion:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Model memorizes training data.&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;Experiment 3 — Effect of Activation Function&lt;/h2&gt;&lt;p&gt;Try:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Sigmoid
Tanh
ReLU
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Observe:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Speed of convergence&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Shape of decision boundary&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;9. Key Neural Network Concepts You Can Learn&lt;/h1&gt;&lt;p&gt;TensorFlow Playground helps visualize:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Feature transformation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Nonlinear decision boundaries&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Hidden layer representations&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Overfitting vs underfitting&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Effect of learning rate&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Activation function behavior&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;These concepts are foundational in &lt;strong&gt;deep learning frameworks like&lt;/strong&gt; &lt;strong&gt;TensorFlow&lt;/strong&gt; and &lt;strong&gt;PyTorch&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;10. Simple Mental Model&lt;/h1&gt;&lt;p&gt;Neural networks in the playground follow this loop:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input → Hidden Layers → Prediction → Loss → Backpropagation → Update Weights
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Repeated thousands of times.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;11. Quick Interpretation Checklist&lt;/h1&gt;&lt;p&gt;When looking at results, ask:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Is loss decreasing?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Does decision boundary match the data pattern?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Is model too simple or too complex?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Is learning rate stable?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Are neurons learning useful patterns?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;h1&gt;One Sentence Summary&lt;/h1&gt;&lt;p&gt;TensorFlow Playground visually demonstrates &lt;strong&gt;how neural networks transform input features through layers to create nonlinear decision boundaries that separate data classes.&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/tensorflow-playground-what-it-is-and.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-2181991605175977849</guid><pubDate>Thu, 12 Mar 2026 08:08:00 +0000</pubDate><atom:updated>2026-03-12T01:08:17.630-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Artificial Intelligence</category><category domain="http://www.blogger.com/atom/ns#">Deep Learning</category><category domain="http://www.blogger.com/atom/ns#">Machine Learning</category><category domain="http://www.blogger.com/atom/ns#">most important terms in deep learning</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks</category><title>Most Important Terms in Deep Learning</title><description>&lt;p&gt;&lt;/p&gt;&lt;h1&gt;1. Neural Network Fundamentals&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Neuron&lt;/td&gt;&lt;td&gt;Basic computational unit of a neural network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Node&lt;/td&gt;&lt;td&gt;Another name for neuron&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Weight&lt;/td&gt;&lt;td&gt;Importance assigned to an input&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bias&lt;/td&gt;&lt;td&gt;Additional constant used to shift activation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Layer&lt;/td&gt;&lt;td&gt;Group of neurons performing computation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Input Layer&lt;/td&gt;&lt;td&gt;First layer that receives data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Hidden Layer&lt;/td&gt;&lt;td&gt;Intermediate layers that learn patterns&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Output Layer&lt;/td&gt;&lt;td&gt;Final layer producing prediction&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Connection&lt;/td&gt;&lt;td&gt;Link between neurons&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Network Architecture&lt;/td&gt;&lt;td&gt;Overall structure of a neural network&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Neural Network = Layers + Neurons + Weights&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;2. Mathematical Foundations&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Linear Transformation&lt;/td&gt;&lt;td&gt;Weighted sum of inputs&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Matrix Multiplication&lt;/td&gt;&lt;td&gt;Core operation in neural networks&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Vector&lt;/td&gt;&lt;td&gt;Ordered set of numbers&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Scalar&lt;/td&gt;&lt;td&gt;Single numeric value&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dot Product&lt;/td&gt;&lt;td&gt;Multiplication of vectors&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Gradient&lt;/td&gt;&lt;td&gt;Rate of change of loss&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Derivative&lt;/td&gt;&lt;td&gt;Mathematical rate of change&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Partial Derivative&lt;/td&gt;&lt;td&gt;Derivative with respect to one variable&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Chain Rule&lt;/td&gt;&lt;td&gt;Method used in backpropagation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Jacobian&lt;/td&gt;&lt;td&gt;Matrix of partial derivatives&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Backpropagation = Chain Rule + Gradients&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;3. Activation Functions&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Activation Function&lt;/td&gt;&lt;td&gt;Determines neuron output&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ReLU&lt;/td&gt;&lt;td&gt;Rectified Linear Unit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Leaky ReLU&lt;/td&gt;&lt;td&gt;ReLU with small negative slope&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Sigmoid&lt;/td&gt;&lt;td&gt;S-shaped function outputting probabilities&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Tanh&lt;/td&gt;&lt;td&gt;Hyperbolic tangent activation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Softmax&lt;/td&gt;&lt;td&gt;Converts outputs into probability distribution&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ELU&lt;/td&gt;&lt;td&gt;Exponential Linear Unit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Swish&lt;/td&gt;&lt;td&gt;Self-gated activation function&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GELU&lt;/td&gt;&lt;td&gt;Smooth activation used in transformers&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Linear Activation&lt;/td&gt;&lt;td&gt;Identity activation&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Hidden layers → ReLU&lt;br /&gt;Output layer → depends on problem&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;4. Training Process&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Forward Propagation&lt;/td&gt;&lt;td&gt;Data moving through network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Backpropagation&lt;/td&gt;&lt;td&gt;Error propagated backward&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Gradient Descent&lt;/td&gt;&lt;td&gt;Optimization method&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Loss Function&lt;/td&gt;&lt;td&gt;Measures prediction error&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Cost Function&lt;/td&gt;&lt;td&gt;Average loss over dataset&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Learning Rate&lt;/td&gt;&lt;td&gt;Step size for weight updates&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Epoch&lt;/td&gt;&lt;td&gt;One full pass through dataset&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Iteration&lt;/td&gt;&lt;td&gt;Single update step&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Batch&lt;/td&gt;&lt;td&gt;Subset of training data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Mini-batch&lt;/td&gt;&lt;td&gt;Small group used for training&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Train loop:&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Input → Prediction → Loss → Backprop → Update&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;5. Optimization Algorithms&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;SGD&lt;/td&gt;&lt;td&gt;Stochastic Gradient Descent&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Momentum&lt;/td&gt;&lt;td&gt;Accelerates gradient descent&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nesterov Momentum&lt;/td&gt;&lt;td&gt;Improved momentum method&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;AdaGrad&lt;/td&gt;&lt;td&gt;Adaptive learning rate optimizer&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;RMSProp&lt;/td&gt;&lt;td&gt;Adaptive gradient algorithm&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Adam&lt;/td&gt;&lt;td&gt;Most popular optimizer&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;AdamW&lt;/td&gt;&lt;td&gt;Adam with weight decay&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Learning Rate Scheduler&lt;/td&gt;&lt;td&gt;Adjusts learning rate during training&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Gradient Clipping&lt;/td&gt;&lt;td&gt;Prevents exploding gradients&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Weight Decay&lt;/td&gt;&lt;td&gt;Regularization technique&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Adam = Adaptive + Momentum&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;6. Neural Network Architectures&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Feedforward Network&lt;/td&gt;&lt;td&gt;Basic neural network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;CNN&lt;/td&gt;&lt;td&gt;Convolutional Neural Network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;RNN&lt;/td&gt;&lt;td&gt;Recurrent Neural Network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;LSTM&lt;/td&gt;&lt;td&gt;Long Short-Term Memory network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GRU&lt;/td&gt;&lt;td&gt;Gated Recurrent Unit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Autoencoder&lt;/td&gt;&lt;td&gt;Neural network for data compression&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Variational Autoencoder&lt;/td&gt;&lt;td&gt;Probabilistic autoencoder&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GAN&lt;/td&gt;&lt;td&gt;Generative Adversarial Network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Transformer&lt;/td&gt;&lt;td&gt;Attention-based architecture&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Residual Network&lt;/td&gt;&lt;td&gt;Network with skip connections&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Modern AI models such as &lt;strong&gt;GPT&lt;/strong&gt; are based on &lt;strong&gt;transformer architecture&lt;/strong&gt;, which powers systems like &lt;strong&gt;ChatGPT&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Vision → CNN&lt;br /&gt;Sequence → RNN/LSTM&lt;br /&gt;Language → Transformers&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;7. CNN Components&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Convolution&lt;/td&gt;&lt;td&gt;Feature extraction operation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Kernel / Filter&lt;/td&gt;&lt;td&gt;Small matrix detecting patterns&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Stride&lt;/td&gt;&lt;td&gt;Step size of filter movement&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Padding&lt;/td&gt;&lt;td&gt;Adding zeros to input borders&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Feature Map&lt;/td&gt;&lt;td&gt;Output of convolution&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Pooling&lt;/td&gt;&lt;td&gt;Downsampling operation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Max Pooling&lt;/td&gt;&lt;td&gt;Maximum value pooling&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Average Pooling&lt;/td&gt;&lt;td&gt;Mean value pooling&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Global Pooling&lt;/td&gt;&lt;td&gt;Pooling across entire feature map&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Channel&lt;/td&gt;&lt;td&gt;Depth dimension in images&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;CNN = Convolution → Activation → Pooling&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;8. Sequence Learning Concepts&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Sequence Data&lt;/td&gt;&lt;td&gt;Ordered data (time series, text)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Hidden State&lt;/td&gt;&lt;td&gt;Memory of RNN&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Time Step&lt;/td&gt;&lt;td&gt;Single step in sequence&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Vanishing Gradient&lt;/td&gt;&lt;td&gt;Gradients become very small&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Exploding Gradient&lt;/td&gt;&lt;td&gt;Gradients become very large&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Attention Mechanism&lt;/td&gt;&lt;td&gt;Focus on important inputs&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Self-Attention&lt;/td&gt;&lt;td&gt;Attention within sequence&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Positional Encoding&lt;/td&gt;&lt;td&gt;Adds order information&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Encoder&lt;/td&gt;&lt;td&gt;Transformer component&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Decoder&lt;/td&gt;&lt;td&gt;Transformer component&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Transformers = Attention + Context&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;9. Regularization Techniques&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Regularization&lt;/td&gt;&lt;td&gt;Prevents overfitting&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dropout&lt;/td&gt;&lt;td&gt;Randomly disable neurons&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;L1 Regularization&lt;/td&gt;&lt;td&gt;Absolute weight penalty&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;L2 Regularization&lt;/td&gt;&lt;td&gt;Squared weight penalty&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Early Stopping&lt;/td&gt;&lt;td&gt;Stop training when validation loss increases&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Data Augmentation&lt;/td&gt;&lt;td&gt;Increase training data artificially&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Batch Normalization&lt;/td&gt;&lt;td&gt;Normalize layer inputs&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Layer Normalization&lt;/td&gt;&lt;td&gt;Normalize across features&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Weight Sharing&lt;/td&gt;&lt;td&gt;Shared parameters&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Noise Injection&lt;/td&gt;&lt;td&gt;Adding noise during training&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Regularization = control model complexity&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;10. Model Evaluation Metrics&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Accuracy&lt;/td&gt;&lt;td&gt;Correct predictions ratio&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Precision&lt;/td&gt;&lt;td&gt;True positives over predicted positives&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Recall&lt;/td&gt;&lt;td&gt;True positives over actual positives&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;F1 Score&lt;/td&gt;&lt;td&gt;Harmonic mean of precision and recall&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ROC Curve&lt;/td&gt;&lt;td&gt;Receiver operating characteristic&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;AUC&lt;/td&gt;&lt;td&gt;Area under ROC curve&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Confusion Matrix&lt;/td&gt;&lt;td&gt;Classification performance table&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MAE&lt;/td&gt;&lt;td&gt;Mean Absolute Error&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MSE&lt;/td&gt;&lt;td&gt;Mean Squared Error&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;RMSE&lt;/td&gt;&lt;td&gt;Root Mean Squared Error&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Classification → Precision/Recall&lt;br /&gt;Regression → MSE/RMSE&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;11. Data Handling Concepts&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Training Set&lt;/td&gt;&lt;td&gt;Data used to train model&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Validation Set&lt;/td&gt;&lt;td&gt;Used to tune hyperparameters&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Test Set&lt;/td&gt;&lt;td&gt;Used to evaluate model&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Feature Scaling&lt;/td&gt;&lt;td&gt;Normalize input values&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Standardization&lt;/td&gt;&lt;td&gt;Zero mean, unit variance&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Normalization&lt;/td&gt;&lt;td&gt;Scaling between 0–1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Encoding&lt;/td&gt;&lt;td&gt;Convert categorical variables&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Embedding&lt;/td&gt;&lt;td&gt;Dense vector representation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Tokenization&lt;/td&gt;&lt;td&gt;Splitting text into tokens&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Vocabulary&lt;/td&gt;&lt;td&gt;Set of unique tokens&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;12. Hyperparameters&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Learning Rate&lt;/td&gt;&lt;td&gt;Controls weight update speed&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Batch Size&lt;/td&gt;&lt;td&gt;Samples processed per update&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Number of Layers&lt;/td&gt;&lt;td&gt;Network depth&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Number of Neurons&lt;/td&gt;&lt;td&gt;Network width&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dropout Rate&lt;/td&gt;&lt;td&gt;Probability of dropping neurons&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Optimizer Choice&lt;/td&gt;&lt;td&gt;Training algorithm&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Activation Choice&lt;/td&gt;&lt;td&gt;Activation function used&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Weight Initialization&lt;/td&gt;&lt;td&gt;Initial weight values&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Epoch Count&lt;/td&gt;&lt;td&gt;Training iterations&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Regularization Strength&lt;/td&gt;&lt;td&gt;Penalty magnitude&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Memory trick:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Hyperparameters = knobs controlling learning&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;13. Training Problems&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Overfitting&lt;/td&gt;&lt;td&gt;Model memorizes training data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Underfitting&lt;/td&gt;&lt;td&gt;Model too simple&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Vanishing Gradient&lt;/td&gt;&lt;td&gt;Gradients disappear&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Exploding Gradient&lt;/td&gt;&lt;td&gt;Gradients grow uncontrollably&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dead Neurons&lt;/td&gt;&lt;td&gt;ReLU stops activating&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Local Minimum&lt;/td&gt;&lt;td&gt;Suboptimal loss point&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Saddle Point&lt;/td&gt;&lt;td&gt;Flat region in loss surface&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Data Leakage&lt;/td&gt;&lt;td&gt;Information from test set leaks into training&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Class Imbalance&lt;/td&gt;&lt;td&gt;Unequal class distribution&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bias-Variance Tradeoff&lt;/td&gt;&lt;td&gt;Balance model complexity&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;Quick Master Formula of Neural Networks&lt;/h1&gt;&lt;p&gt;Forward pass:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input → Weighted Sum → Activation → Prediction
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Training:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Prediction → Loss → Backpropagation → Weight Update
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Learning loop:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Repeat until error minimized
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;One-Line Summary of Deep Learning&lt;/h1&gt;&lt;blockquote&gt;&lt;p&gt;Neural networks learn patterns from data by adjusting weights through backpropagation to minimize prediction error.&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHvSuyVgmA1kzSLWKjse2I0qgO1-bIlSqquP9npWfHm6zG70m-i3mV4Np03z1HZg86FSnOhOOLPShtfWziV8C0UPBEDsBmzFT_y_t6mlvbuw17VVFXdJZH4L3IpTM475KdQ3lbuoackkqj4YUrZHSNm_gcLAuf5x_Ntcczlr1iAXLKYTbwM7DymrPoCl1H/s1536/ChatGPT%20Image%20Mar%2012,%202026,%2001_34_44%20PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1536&quot; height=&quot;592&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHvSuyVgmA1kzSLWKjse2I0qgO1-bIlSqquP9npWfHm6zG70m-i3mV4Np03z1HZg86FSnOhOOLPShtfWziV8C0UPBEDsBmzFT_y_t6mlvbuw17VVFXdJZH4L3IpTM475KdQ3lbuoackkqj4YUrZHSNm_gcLAuf5x_Ntcczlr1iAXLKYTbwM7DymrPoCl1H/w892-h592/ChatGPT%20Image%20Mar%2012,%202026,%2001_34_44%20PM.png&quot; width=&quot;892&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/most-important-terms-in-deep-learning.html</link><author>noreply@blogger.com (ITMastersPro)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHvSuyVgmA1kzSLWKjse2I0qgO1-bIlSqquP9npWfHm6zG70m-i3mV4Np03z1HZg86FSnOhOOLPShtfWziV8C0UPBEDsBmzFT_y_t6mlvbuw17VVFXdJZH4L3IpTM475KdQ3lbuoackkqj4YUrZHSNm_gcLAuf5x_Ntcczlr1iAXLKYTbwM7DymrPoCl1H/s72-w892-h592-c/ChatGPT%20Image%20Mar%2012,%202026,%2001_34_44%20PM.png" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-370547712726607915</guid><pubDate>Thu, 12 Mar 2026 07:56:00 +0000</pubDate><atom:updated>2026-03-12T00:56:43.878-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Deep Learning</category><category domain="http://www.blogger.com/atom/ns#">Glossary</category><category domain="http://www.blogger.com/atom/ns#">Machine Learning</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks Terms Explained</category><title>Comprehensive Glossary of Neural Networks</title><description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;A&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Activation Function&lt;/strong&gt;&lt;br /&gt;A mathematical function that decides whether a neuron should activate and how strongly it should pass its signal forward.&lt;br /&gt;Examples: ReLU, Sigmoid, Tanh, Softmax.&lt;br /&gt;&lt;strong&gt;Memory aid:&lt;/strong&gt; &lt;em&gt;Neuron’s decision switch.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Adam Optimizer&lt;/strong&gt;&lt;br /&gt;An advanced optimization algorithm that combines &lt;strong&gt;momentum and adaptive learning rates&lt;/strong&gt; to update weights efficiently.&lt;br /&gt;&lt;strong&gt;Memory aid:&lt;/strong&gt; &lt;em&gt;Smart gradient descent.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Autoencoder&lt;/strong&gt;&lt;br /&gt;A neural network designed to &lt;strong&gt;compress data into a smaller representation and reconstruct it again&lt;/strong&gt;.&lt;br /&gt;Commonly used for dimensionality reduction and anomaly detection.&lt;br /&gt;&lt;strong&gt;Memory aid:&lt;/strong&gt; &lt;em&gt;Neural data compressor.&lt;/em&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;B&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Backpropagation&lt;/strong&gt;&lt;br /&gt;The algorithm used to &lt;strong&gt;update neural network weights by propagating error backward through layers&lt;/strong&gt; using gradients.&lt;br /&gt;&lt;strong&gt;Memory aid:&lt;/strong&gt; &lt;em&gt;Learning from mistakes.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Batch&lt;/strong&gt;&lt;br /&gt;A subset of training data used to update weights during one iteration of training.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Batch Size&lt;/strong&gt;&lt;br /&gt;The number of samples processed before updating weights.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Bias&lt;/strong&gt;&lt;br /&gt;A constant added to the weighted sum of inputs that allows the neuron to shift the activation function.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Binary Classification&lt;/strong&gt;&lt;br /&gt;A task where the model predicts &lt;strong&gt;one of two classes&lt;/strong&gt; (e.g., spam vs. not spam).&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;C&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Convolutional Neural Network (CNN)&lt;/strong&gt;&lt;br /&gt;A neural network specialized for &lt;strong&gt;image and spatial data processing&lt;/strong&gt; using convolution operations.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Cross Entropy Loss&lt;/strong&gt;&lt;br /&gt;A loss function used in classification tasks that measures the difference between predicted probabilities and actual labels.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Cost Function&lt;/strong&gt;&lt;br /&gt;Another term for &lt;strong&gt;loss function&lt;/strong&gt;, representing how far predictions are from actual values.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Convergence&lt;/strong&gt;&lt;br /&gt;The point where the model&#39;s loss stops improving significantly.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;D&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Dataset&lt;/strong&gt;&lt;br /&gt;A collection of data used for training and evaluating machine learning models.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Deep Learning&lt;/strong&gt;&lt;br /&gt;A subset of machine learning that uses &lt;strong&gt;deep neural networks with multiple hidden layers&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Dropout&lt;/strong&gt;&lt;br /&gt;A regularization technique where random neurons are temporarily ignored during training to prevent overfitting.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Dense Layer&lt;/strong&gt;&lt;br /&gt;A neural network layer where &lt;strong&gt;every neuron connects to all neurons in the next layer&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;E&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Epoch&lt;/strong&gt;&lt;br /&gt;One complete pass of the entire training dataset through the neural network.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Embedding&lt;/strong&gt;&lt;br /&gt;A dense numerical representation of objects (like words or images) that captures semantic relationships.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Exploding Gradient&lt;/strong&gt;&lt;br /&gt;A problem where gradients become excessively large during training, causing unstable learning.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;F&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Feedforward Neural Network&lt;/strong&gt;&lt;br /&gt;A neural network where data flows &lt;strong&gt;in one direction from input to output without loops&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Feature&lt;/strong&gt;&lt;br /&gt;An individual measurable property of data used as input for training.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Feature Extraction&lt;/strong&gt;&lt;br /&gt;The process of transforming raw data into useful features for machine learning models.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Fully Connected Layer&lt;/strong&gt;&lt;br /&gt;A layer where each neuron connects to all neurons in the previous layer.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;G&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;GAN (Generative Adversarial Network)&lt;/strong&gt;&lt;br /&gt;A model composed of two neural networks:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Generator&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Discriminator&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;They compete to generate realistic synthetic data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Gradient&lt;/strong&gt;&lt;br /&gt;A vector of derivatives that shows &lt;strong&gt;how much the loss changes with respect to each weight&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Gradient Descent&lt;/strong&gt;&lt;br /&gt;An optimization algorithm that minimizes loss by adjusting weights in the direction of the negative gradient.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;H&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Hidden Layer&lt;/strong&gt;&lt;br /&gt;A layer between input and output layers where the neural network learns intermediate representations.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Hyperparameters&lt;/strong&gt;&lt;br /&gt;Parameters set before training that control how the network learns.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Learning rate&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Batch size&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Number of layers&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;I&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Input Layer&lt;/strong&gt;&lt;br /&gt;The first layer of the network that receives raw data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Initialization&lt;/strong&gt;&lt;br /&gt;The method used to assign initial values to weights before training begins.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;K&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Kernel (Filter)&lt;/strong&gt;&lt;br /&gt;A small matrix used in CNNs to detect features like edges or textures in images.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;L&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Learning Rate&lt;/strong&gt;&lt;br /&gt;A hyperparameter that determines how much weights change during each update step.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Loss Function&lt;/strong&gt;&lt;br /&gt;A function that measures the difference between predicted output and true values.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Mean Squared Error&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Cross Entropy&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;LSTM (Long Short-Term Memory)&lt;/strong&gt;&lt;br /&gt;A special type of RNN designed to remember long-term dependencies in sequences.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;M&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Model&lt;/strong&gt;&lt;br /&gt;A trained machine learning system capable of making predictions.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Momentum&lt;/strong&gt;&lt;br /&gt;An optimization technique that accelerates gradient descent by considering past updates.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Mini-Batch Gradient Descent&lt;/strong&gt;&lt;br /&gt;A variant of gradient descent where small batches of data are used to update weights.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;N&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Neural Network&lt;/strong&gt;&lt;br /&gt;A computational model inspired by the brain consisting of interconnected neurons that learn patterns from data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Neuron (Node)&lt;/strong&gt;&lt;br /&gt;The basic unit of a neural network that processes input signals and produces output.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;O&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Optimizer&lt;/strong&gt;&lt;br /&gt;An algorithm that adjusts neural network weights to minimize the loss function.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;SGD&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Adam&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;RMSProp&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Overfitting&lt;/strong&gt;&lt;br /&gt;When a model performs well on training data but poorly on new data.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;P&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Perceptron&lt;/strong&gt;&lt;br /&gt;The simplest type of artificial neuron used for binary classification.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Pooling Layer&lt;/strong&gt;&lt;br /&gt;A CNN layer used to reduce spatial dimensions of feature maps.&lt;/p&gt;&lt;p&gt;Common types:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Max pooling&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Average pooling&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Precision&lt;/strong&gt;&lt;br /&gt;The ratio of correctly predicted positive observations to total predicted positives.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;R&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;ReLU (Rectified Linear Unit)&lt;/strong&gt;&lt;br /&gt;A popular activation function that outputs zero for negative inputs and the input itself for positive values.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Recurrent Neural Network (RNN)&lt;/strong&gt;&lt;br /&gt;A neural network designed to process &lt;strong&gt;sequential data&lt;/strong&gt; like time series or text.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Regularization&lt;/strong&gt;&lt;br /&gt;Techniques used to prevent overfitting.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;L1&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;L2&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Dropout&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;S&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Softmax Function&lt;/strong&gt;&lt;br /&gt;An activation function that converts output values into probability distributions across multiple classes.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Stochastic Gradient Descent (SGD)&lt;/strong&gt;&lt;br /&gt;A gradient descent variant where weights are updated after each training sample.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;T&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Training Data&lt;/strong&gt;&lt;br /&gt;Data used to train the neural network.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Test Data&lt;/strong&gt;&lt;br /&gt;Data used to evaluate the model after training.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Transformer&lt;/strong&gt;&lt;br /&gt;A neural network architecture based on &lt;strong&gt;attention mechanisms&lt;/strong&gt; widely used in NLP.&lt;/p&gt;&lt;p&gt;Examples include models such as &lt;strong&gt;GPT&lt;/strong&gt; that power applications like &lt;strong&gt;ChatGPT&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;U&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Underfitting&lt;/strong&gt;&lt;br /&gt;When a model is too simple to capture patterns in the data.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;V&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Validation Set&lt;/strong&gt;&lt;br /&gt;A subset of data used to tune hyperparameters during training.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Vanishing Gradient&lt;/strong&gt;&lt;br /&gt;A problem where gradients become extremely small in deep networks, slowing learning.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;W&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Weight&lt;/strong&gt;&lt;br /&gt;A parameter that determines the importance of an input in a neuron.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Weight Initialization&lt;/strong&gt;&lt;br /&gt;The process of assigning starting values to neural network weights.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;X&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Xavier Initialization&lt;/strong&gt;&lt;br /&gt;A weight initialization method designed to keep signal variance stable across layers.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Z&lt;/h1&gt;&lt;p&gt;&lt;strong&gt;Zero Padding&lt;/strong&gt;&lt;br /&gt;Adding zeros around image boundaries in CNNs to preserve spatial dimensions during convolution.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Ultra-Quick Cheat Sheet&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Quick Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Neuron&lt;/td&gt;&lt;td&gt;Basic computing unit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Weight&lt;/td&gt;&lt;td&gt;Importance of input&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bias&lt;/td&gt;&lt;td&gt;Adjustable offset&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Activation&lt;/td&gt;&lt;td&gt;Neuron firing rule&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Loss&lt;/td&gt;&lt;td&gt;Prediction error&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Gradient&lt;/td&gt;&lt;td&gt;Direction to reduce error&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Backpropagation&lt;/td&gt;&lt;td&gt;Error propagation algorithm&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Optimizer&lt;/td&gt;&lt;td&gt;Weight update strategy&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Epoch&lt;/td&gt;&lt;td&gt;One full training pass&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;p&gt;✅ &lt;strong&gt;One-Sentence Summary&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Neural networks learn by passing data through layers of neurons, calculating error, and adjusting weights using backpropagation to minimize loss.&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/comprehensive-glossary-of-neural.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-5747270375558896619</guid><pubDate>Thu, 12 Mar 2026 06:58:00 +0000</pubDate><atom:updated>2026-03-11T23:58:48.990-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Artificial Intelligence</category><category domain="http://www.blogger.com/atom/ns#">Machine Learning</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks Architecture</category><category domain="http://www.blogger.com/atom/ns#">Working of Neural Networks</category><title>How a Neural Network Works — Simple but Complete Explanation</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2&gt;How a Neural Network Works — Simple but Complete Explanation&lt;/h2&gt;&lt;p&gt;A &lt;strong&gt;neural network&lt;/strong&gt; is a computational model inspired by the &lt;strong&gt;human brain&lt;/strong&gt;. It learns patterns from data by passing information through interconnected units called &lt;strong&gt;neurons&lt;/strong&gt; and gradually adjusting their &lt;strong&gt;weights&lt;/strong&gt; to reduce prediction error.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;In simple terms:&lt;/strong&gt;&lt;br /&gt;A neural network learns by &lt;strong&gt;making predictions, measuring mistakes, and correcting itself repeatedly.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;h1&gt;1. Basic Structure of a Neural Network&lt;/h1&gt;&lt;p&gt;A neural network has &lt;strong&gt;three main types of layers&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;1️⃣ Input Layer&lt;/h3&gt;&lt;p&gt;Receives the raw data.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Image pixels&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Numerical features&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Words in a sentence&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example input vector:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;x = [x_1, x_2, x_3]&lt;br /&gt;]&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;2️⃣ Hidden Layers&lt;/h3&gt;&lt;p&gt;These layers &lt;strong&gt;extract patterns and relationships&lt;/strong&gt; from the data.&lt;/p&gt;&lt;p&gt;Each neuron performs two operations:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;Weighted sum&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Activation function&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Weighted sum:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = w_1x_1 + w_2x_2 + ... + b&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Activation output:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;a = f(z)&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;The activation function introduces &lt;strong&gt;non-linearity&lt;/strong&gt;, allowing the network to learn complex patterns.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;3️⃣ Output Layer&lt;/h3&gt;&lt;p&gt;Produces the final prediction.&lt;/p&gt;&lt;p&gt;Examples:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Problem&lt;/th&gt;&lt;th&gt;Output&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;House price prediction&lt;/td&gt;&lt;td&gt;Continuous number&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Spam detection&lt;/td&gt;&lt;td&gt;0 or 1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Image classification&lt;/td&gt;&lt;td&gt;Probability of each class&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;2. Step-by-Step Working of Neural Networks&lt;/h1&gt;&lt;p&gt;A neural network works through &lt;strong&gt;four major stages&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Step 1 — Input Data Enters the Network&lt;/h1&gt;&lt;p&gt;The network receives &lt;strong&gt;features as numbers&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Predict house price.&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Area&lt;/td&gt;&lt;td&gt;1200 sq ft&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bedrooms&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Age&lt;/td&gt;&lt;td&gt;5 years&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Input vector:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;x = [1200, 3, 5]&lt;br /&gt;]&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Step 2 — Weighted Sum Calculation&lt;/h1&gt;&lt;p&gt;Each neuron multiplies inputs by &lt;strong&gt;weights&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;z = w_1x_1 + w_2x_2 + w_3x_3 + b&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;This determines &lt;strong&gt;importance of each feature&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;/th&gt;&lt;th&gt;Weight&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Area&lt;/td&gt;&lt;td&gt;0.7&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bedrooms&lt;/td&gt;&lt;td&gt;0.2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Age&lt;/td&gt;&lt;td&gt;−0.3&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;Step 3 — Activation Function&lt;/h1&gt;&lt;p&gt;The neuron applies an activation function to decide &lt;strong&gt;how strongly to fire&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Common example: ReLU.&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;a = \max(0, z)&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Activation functions allow the network to model &lt;strong&gt;nonlinear relationships&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Without them, the network becomes just &lt;strong&gt;linear regression&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Step 4 — Information Propagates Through Layers&lt;/h1&gt;&lt;p&gt;The output of one layer becomes the &lt;strong&gt;input of the next layer&lt;/strong&gt;.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input Layer
     ↓
Hidden Layer 1
     ↓
Hidden Layer 2
     ↓
Output Layer
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each layer gradually learns &lt;strong&gt;higher-level features&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example in image recognition:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Layer&lt;/th&gt;&lt;th&gt;What it learns&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Layer 1&lt;/td&gt;&lt;td&gt;Edges&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Layer 2&lt;/td&gt;&lt;td&gt;Shapes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Layer 3&lt;/td&gt;&lt;td&gt;Objects&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;Step 5 — Prediction is Produced&lt;/h1&gt;&lt;p&gt;The output layer generates the &lt;strong&gt;final prediction&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Animal&lt;/th&gt;&lt;th&gt;Probability&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Cat&lt;/td&gt;&lt;td&gt;0.8&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dog&lt;/td&gt;&lt;td&gt;0.15&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Horse&lt;/td&gt;&lt;td&gt;0.05&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Prediction = &lt;strong&gt;Cat&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Step 6 — Loss is Calculated&lt;/h1&gt;&lt;p&gt;The network compares prediction with &lt;strong&gt;actual value&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Prediction = 0.8&lt;br /&gt;Actual = 1&lt;/p&gt;&lt;p&gt;Loss function measures error.&lt;/p&gt;&lt;p&gt;Example (Mean Squared Error):&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;L = (y - \hat{y})^2&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Loss tells the network &lt;strong&gt;how wrong it is&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Step 7 — Backpropagation&lt;/h1&gt;&lt;p&gt;Error is propagated backward through the network.&lt;/p&gt;&lt;p&gt;Backpropagation calculates:&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;\frac{\partial L}{\partial w}&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;This tells &lt;strong&gt;how each weight contributed to the error&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Step 8 — Weight Adjustment&lt;/h1&gt;&lt;p&gt;Weights are updated using &lt;strong&gt;gradient descent&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;[&lt;br /&gt;w_{new} = w_{old} - \eta \frac{\partial L}{\partial w}&lt;br /&gt;]&lt;/p&gt;&lt;p&gt;Where:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Symbol&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;η&lt;/td&gt;&lt;td&gt;Learning rate&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;L&lt;/td&gt;&lt;td&gt;Loss&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Weights move toward &lt;strong&gt;minimum error&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Step 9 — Repeat Many Times&lt;/h1&gt;&lt;p&gt;The entire process repeats:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Forward Pass
→ Prediction
→ Loss Calculation
→ Backpropagation
→ Weight Update
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This loop continues for &lt;strong&gt;many epochs&lt;/strong&gt; until the model learns.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Example: Neural Network Learning Handwritten Digits&lt;/h1&gt;&lt;p&gt;Input: Image pixels&lt;/p&gt;&lt;p&gt;Process:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Layer&lt;/th&gt;&lt;th&gt;Learns&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Layer 1&lt;/td&gt;&lt;td&gt;Edges&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Layer 2&lt;/td&gt;&lt;td&gt;Curves&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Layer 3&lt;/td&gt;&lt;td&gt;Digit shapes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Output&lt;/td&gt;&lt;td&gt;Digit classification&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;Why Neural Networks Are Powerful&lt;/h1&gt;&lt;p&gt;Neural networks can automatically &lt;strong&gt;learn features&lt;/strong&gt; from raw data.&lt;/p&gt;&lt;p&gt;Traditional ML:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Human designs features → Model learns
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Neural networks:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Model learns features automatically
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is why they power modern AI systems like &lt;strong&gt;GPT&lt;/strong&gt; models used in &lt;strong&gt;ChatGPT&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Simple Analogy&lt;/h1&gt;&lt;p&gt;Think of a neural network like a &lt;strong&gt;student learning mathematics&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;1️⃣ Student solves problems&lt;br /&gt;2️⃣ Teacher checks answers&lt;br /&gt;3️⃣ Teacher explains mistakes&lt;br /&gt;4️⃣ Student adjusts understanding&lt;/p&gt;&lt;p&gt;Repeat thousands of times → student becomes expert.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Quick Memory Formula&lt;/h1&gt;&lt;p&gt;Neural networks follow a &lt;strong&gt;simple learning loop&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Input
↓
Weighted Sum
↓
Activation
↓
Prediction
↓
Loss
↓
Backpropagation
↓
Weight Update
&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h1&gt;One-Line Summary&lt;/h1&gt;&lt;blockquote&gt;&lt;p&gt;A neural network works by &lt;strong&gt;passing data forward to make predictions and propagating errors backward to improve itself&lt;/strong&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/how-neural-network-works-simple-but.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-8553877073997589004</guid><pubDate>Thu, 12 Mar 2026 06:43:00 +0000</pubDate><atom:updated>2026-03-11T23:43:18.878-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Adversarial</category><category domain="http://www.blogger.com/atom/ns#">Artificial Intelligence</category><category domain="http://www.blogger.com/atom/ns#">Auto Encoders</category><category domain="http://www.blogger.com/atom/ns#">CNN</category><category domain="http://www.blogger.com/atom/ns#">Convolutional</category><category domain="http://www.blogger.com/atom/ns#">GAN</category><category domain="http://www.blogger.com/atom/ns#">Generative</category><category domain="http://www.blogger.com/atom/ns#">GPT</category><category domain="http://www.blogger.com/atom/ns#">Long Short Term Memory</category><category domain="http://www.blogger.com/atom/ns#">LSTM</category><category domain="http://www.blogger.com/atom/ns#">Machine Learning</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks</category><category domain="http://www.blogger.com/atom/ns#">Pretrained</category><category domain="http://www.blogger.com/atom/ns#">Recurrent</category><category domain="http://www.blogger.com/atom/ns#">RNN</category><category domain="http://www.blogger.com/atom/ns#">Simple Neural Networks</category><category domain="http://www.blogger.com/atom/ns#">Transformers</category><title>Neural Networks - A Short Overview</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2&gt;Introduction to Neural Networks (NN)&lt;/h2&gt;&lt;p&gt;Neural Networks are a class of machine learning models inspired by the &lt;strong&gt;human brain&#39;s network of neurons&lt;/strong&gt;. Just like biological neurons receive signals, process them, and pass them forward, artificial neurons do something similar using &lt;strong&gt;mathematical functions&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;At their core, neural networks try to &lt;strong&gt;learn patterns from data&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Think of it like this:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Traditional programming:&lt;/strong&gt; Rules → Data → Output&lt;br /&gt;&lt;strong&gt;Neural networks:&lt;/strong&gt; Data → Learning → Rules → Output&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Instead of explicitly programming rules, the network &lt;strong&gt;learns the rules automatically from examples&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Neural networks form the backbone of modern &lt;strong&gt;Artificial Intelligence (AI)&lt;/strong&gt; systems such as image recognition, speech assistants, recommendation engines, and large language models like &lt;strong&gt;ChatGPT&lt;/strong&gt; built on &lt;strong&gt;GPT&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Basic Structure of a Neural Network&lt;/h1&gt;&lt;p&gt;A neural network consists of three main layers:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;1. Input Layer&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Receives raw data&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Example: pixels of an image, words of a sentence&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;2. Hidden Layers&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Perform computations and pattern extraction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Deep neural networks have many hidden layers&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;3. Output Layer&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Produces prediction or classification&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;p&gt;Input → Hidden Layers → Output&lt;br /&gt;Image → Feature detection → “Cat”&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;Key Concepts (Quick Memory Aids)&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Concept&lt;/th&gt;&lt;th&gt;Simple Meaning&lt;/th&gt;&lt;th&gt;Quick Memory Tip&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Neuron&lt;/td&gt;&lt;td&gt;Small computing unit&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Mini calculator&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Weight&lt;/td&gt;&lt;td&gt;Importance of input&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Volume knob&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bias&lt;/td&gt;&lt;td&gt;Adjustment factor&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Fine tuning screw&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Activation Function&lt;/td&gt;&lt;td&gt;Decides neuron output&lt;/td&gt;&lt;td&gt;&lt;strong&gt;On/Off switch&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Training&lt;/td&gt;&lt;td&gt;Learning from data&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Practice session&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Backpropagation&lt;/td&gt;&lt;td&gt;Error correction method&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Learning from mistakes&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;Types of Neural Networks&lt;/h1&gt;&lt;p&gt;Below are the most important neural network architectures used today.&lt;/p&gt;&lt;hr /&gt;&lt;h1&gt;1. Feedforward Neural Networks (FNN)&lt;/h1&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://mukulrathi.com/static/648e5207805f95bf09c330a43d89d295/f207c/neural-net.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/364384447/figure/fig1/AS%3A11431281360872912%401744096441100/Architecture-of-Multi-Layer-Perceptron.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://i.postimg.cc/pLgLsJDt/Architecture.jpg&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.sciencelearn.org.nz/_next/image?q=85&amp;amp;url=https%3A%2F%2Fwww.datocms-assets.com%2F117510%2F1722402042-art_artificial_intelligence_neural_network_explain-281-29.png%3Fw%3D1840%26h%3D1270.9422492401216&amp;amp;w=1920&quot; /&gt;&lt;/p&gt;&lt;h3&gt;What it is&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;simplest neural network&lt;/strong&gt; where information moves &lt;strong&gt;in one direction only&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Input → Hidden → Output&lt;/p&gt;&lt;h3&gt;Capabilities&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Basic classification&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Regression problems&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Pattern recognition&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Limitations&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Cannot handle sequential data&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Limited ability for complex patterns&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Use Cases&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Credit scoring&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Basic prediction models&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Tabular datasets&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;One-liner&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;FNN = The “starter pack” of neural networks.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;h1&gt;2. Convolutional Neural Networks (CNN)&lt;/h1&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://ik.imagekit.io/upgrad1/abroad-images/imageCompo/images/unnamed8PDPDZ_1_1ZBHFR.webp&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/374143931/figure/fig4/AS%3A11431281190918268%401695521918070/Architecture-of-CNN-with-convolutional-pooling-fully-connected-layer-and-output.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/1%2AixuhX9vaf1kUQTWicVYiyg.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/320541554/figure/fig2/AS%3A592675845730304%401518316341967/sualization-of-feature-maps-learned-by-our-basic-CNN-classiication-network-Each-row.png&quot; /&gt;&lt;/p&gt;&lt;h3&gt;What it is&lt;/h3&gt;&lt;p&gt;CNNs are specialized neural networks designed for &lt;strong&gt;image and spatial data&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;They detect &lt;strong&gt;patterns like edges, shapes, textures&lt;/strong&gt; automatically.&lt;/p&gt;&lt;h3&gt;Key Idea&lt;/h3&gt;&lt;p&gt;Small filters scan the image.&lt;/p&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Edge detector&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Shape detector&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Object detector&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Capabilities&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Image recognition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Video analysis&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Medical imaging&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Autonomous driving&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Limitations&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Requires large labeled datasets&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Computationally heavy&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Use Cases&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Face recognition&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Self-driving cars&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Medical X-ray analysis&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;One-liner&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;CNN = Eyes of Artificial Intelligence.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;h1&gt;3. Recurrent Neural Networks (RNN)&lt;/h1&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/350664352/figure/fig4/AS%3A1080289619124224%401634572524259/A-recurrent-neural-network-and-the-unfolding-in-time-of-the-computation-involved-in-its.jpg&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/v2/resize%3Afit%3A1400/0%2AlGeogogzZ9T06ipo&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/1%2ArSfgNLqHzkZsofkWXQWQtg.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/342625605/figure/fig2/AS%3A908793319784450%401593684620728/Recurrent-Neural-Network-with-a-hidden-state-passing-trough-the-input-series-U-V-and-W.png&quot; /&gt;&lt;/p&gt;&lt;h3&gt;What it is&lt;/h3&gt;&lt;p&gt;RNNs are designed for &lt;strong&gt;sequential data&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;They remember previous inputs using an &lt;strong&gt;internal memory&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Example sequences:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Sentences&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Stock prices&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Weather data&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Capabilities&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Language modeling&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Time series prediction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Speech recognition&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Limitations&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Vanishing gradient problem&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Poor long-term memory&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Use Cases&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Text generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Speech processing&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;One-liner&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;RNN = Neural network with memory.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;h1&gt;4. Long Short-Term Memory (LSTM)&lt;/h1&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://media.licdn.com/dms/image/v2/D4D12AQF7aHYXD7SINQ/article-cover_image-shrink_600_2000/article-cover_image-shrink_600_2000/0/1721761416816?e=2147483647&amp;amp;t=B5_d1-po8kcVseMpzGjJ_69vYypHwZunvAUjGQ3v3YU&amp;amp;v=beta&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/1%2AlaH0_xXEkFE0lKJu54gkFQ.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/379305362/figure/fig2/AS%3A11431281250502220%401717831679507/Visualization-of-two-modern-RNN-cells-a-LSTM-memory-cell-with-Forget-gate-and-b-GRU.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://global.discourse-cdn.com/dlai/optimized/2X/d/d1440e65f144d6b784f3fdfdc93622acd3d5b620_2_690x487.jpeg&quot; /&gt;&lt;/p&gt;&lt;h3&gt;What it is&lt;/h3&gt;&lt;p&gt;LSTM is an improved version of RNN designed to &lt;strong&gt;remember long-term dependencies&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;It uses special gates:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Forget gate&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Input gate&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Output gate&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Capabilities&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Long text understanding&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Speech processing&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Time series forecasting&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Limitations&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Slower training&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Complex architecture&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Use Cases&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Machine translation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Speech assistants&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Financial forecasting&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;One-liner&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;LSTM = RNN with better memory control.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;h1&gt;5. Autoencoders&lt;/h1&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/v2/resize%3Afit%3A600/1%2AnqzWupxC60iAH2dYrFT78Q.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/0%2A2XucGwC5jo9l1DSe.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/1%2AiXCORmu7vWolNrcqCTMB0A.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.mdpi.com/machines/machines-10-00849/article_deploy/html/images/machines-10-00849-g001.png&quot; /&gt;&lt;/p&gt;&lt;h3&gt;What it is&lt;/h3&gt;&lt;p&gt;Autoencoders are neural networks used to &lt;strong&gt;compress and reconstruct data&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Structure:&lt;/p&gt;&lt;p&gt;Input → Encoder → Latent Space → Decoder → Output&lt;/p&gt;&lt;h3&gt;Capabilities&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Dimensionality reduction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Feature extraction&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Noise removal&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Limitations&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;May simply copy input without learning meaningful representation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Requires careful architecture tuning&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Use Cases&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Image denoising&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Anomaly detection&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Data compression&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;One-liner&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Autoencoder = Smart compression algorithm.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;h1&gt;6. Generative Adversarial Networks (GAN)&lt;/h1&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://developers.google.com/static/machine-learning/gan/images/gan_diagram_discriminator.svg&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/348640137/figure/fig1/AS%3A982296450576392%401611209132912/General-structure-of-the-GAN-training-process.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/351439001/figure/fig5/AS%3A11431281179213914%401691161314479/DeepFake-generation-pipeline-via-VAE-GAN.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://www.researchgate.net/publication/369878292/figure/fig1/AS%3A11431281139773107%401680889446546/The-pipeline-of-GAN-model-As-shown-in-Figure-1-the-training-of-GAN-model-can-be-divided.png&quot; /&gt;&lt;/p&gt;&lt;h3&gt;What it is&lt;/h3&gt;&lt;p&gt;GANs consist of &lt;strong&gt;two competing networks&lt;/strong&gt;:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generator&lt;/strong&gt; → Creates fake data&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Discriminator&lt;/strong&gt; → Detects fake vs real&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;They train in a &lt;strong&gt;competition&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;Capabilities&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Generate realistic images&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Deepfake generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Data augmentation&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Limitations&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Hard to train&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Mode collapse problem&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Ethical misuse risks&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Use Cases&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;AI art generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Synthetic data creation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Super-resolution images&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;One-liner&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;GAN = AI artist trained through competition.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;h1&gt;7. Transformer Models (GPT)&lt;/h1&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/1%2AaUw7xxxfrArnwCyFC1cMAw.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://poloclub.github.io/transformer-explainer/article_assets/attention.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://miro.medium.com/1%2AvrSX_Ku3EmGPyqF_E-2_Vg.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;Image&quot; src=&quot;https://sebastianraschka.com/images/blog/2023/self-attention-from-scratch/summary.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;Modern AI systems are based on &lt;strong&gt;Transformers&lt;/strong&gt;, introduced in the famous paper:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“Attention Is All You Need”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;The best-known example is the &lt;strong&gt;GPT&lt;/strong&gt; architecture used in &lt;strong&gt;ChatGPT&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;What it is&lt;/h3&gt;&lt;p&gt;A neural network architecture that uses &lt;strong&gt;attention mechanisms&lt;/strong&gt; to understand relationships between words.&lt;/p&gt;&lt;h3&gt;Key Idea&lt;/h3&gt;&lt;p&gt;Instead of reading words sequentially like RNNs, Transformers analyze &lt;strong&gt;all words simultaneously&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;Capabilities&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Language understanding&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Code generation&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Question answering&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Text summarization&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Multimodal AI&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Limitations&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Extremely compute intensive&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Requires huge datasets&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Expensive training&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Use Cases&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Chatbots&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;AI assistants&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Search engines&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Content generation&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;One-liner&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Transformers = Brain of modern AI.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;h1&gt;Comparison Summary&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;Best For&lt;/th&gt;&lt;th&gt;Strength&lt;/th&gt;&lt;th&gt;Weakness&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Feedforward NN&lt;/td&gt;&lt;td&gt;Basic prediction&lt;/td&gt;&lt;td&gt;Simple&lt;/td&gt;&lt;td&gt;Limited learning&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;CNN&lt;/td&gt;&lt;td&gt;Images&lt;/td&gt;&lt;td&gt;Spatial feature detection&lt;/td&gt;&lt;td&gt;High compute&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;RNN&lt;/td&gt;&lt;td&gt;Sequences&lt;/td&gt;&lt;td&gt;Memory of past data&lt;/td&gt;&lt;td&gt;Vanishing gradients&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;LSTM&lt;/td&gt;&lt;td&gt;Long sequences&lt;/td&gt;&lt;td&gt;Long-term memory&lt;/td&gt;&lt;td&gt;Slow training&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Autoencoder&lt;/td&gt;&lt;td&gt;Compression&lt;/td&gt;&lt;td&gt;Feature extraction&lt;/td&gt;&lt;td&gt;Risk of trivial learning&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GAN&lt;/td&gt;&lt;td&gt;Data generation&lt;/td&gt;&lt;td&gt;Realistic synthesis&lt;/td&gt;&lt;td&gt;Hard to train&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Transformer / GPT&lt;/td&gt;&lt;td&gt;Language &amp;amp; multimodal&lt;/td&gt;&lt;td&gt;Parallel processing&lt;/td&gt;&lt;td&gt;Huge resources&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;Quick Memory Tricks&lt;/h1&gt;&lt;h3&gt;The “Vision–Memory–Generation” Trick&lt;/h3&gt;&lt;p&gt;Remember neural networks in 3 groups:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Vision&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;CNN&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Memory&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;RNN&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;LSTM&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Generation&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;GAN&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;GPT&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Compression&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Autoencoders&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h1&gt;Ultra-Short Cheat Sheet&lt;/h1&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;5-Word Explanation&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;FNN&lt;/td&gt;&lt;td&gt;Basic pattern learning network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;CNN&lt;/td&gt;&lt;td&gt;Image feature detection system&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;RNN&lt;/td&gt;&lt;td&gt;Sequence memory neural network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;LSTM&lt;/td&gt;&lt;td&gt;Long-memory sequence learner&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Autoencoder&lt;/td&gt;&lt;td&gt;Data compression neural network&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GAN&lt;/td&gt;&lt;td&gt;Generator vs detector competition&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Transformer/GPT&lt;/td&gt;&lt;td&gt;Attention-based language intelligence&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;&lt;h1&gt;Intuitive Real-World Analogy&lt;/h1&gt;&lt;p&gt;Imagine building an AI company:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Role&lt;/th&gt;&lt;th&gt;Neural Network&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Photographer&lt;/td&gt;&lt;td&gt;CNN&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Historian&lt;/td&gt;&lt;td&gt;RNN&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Memory expert&lt;/td&gt;&lt;td&gt;LSTM&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Archivist&lt;/td&gt;&lt;td&gt;Autoencoder&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Artist&lt;/td&gt;&lt;td&gt;GAN&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Writer&lt;/td&gt;&lt;td&gt;GPT&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Together they form a &lt;strong&gt;complete AI ecosystem&lt;/strong&gt;.&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;✅ &lt;strong&gt;Key Takeaway&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Neural networks evolved from simple pattern recognizers to powerful architectures capable of &lt;strong&gt;seeing, hearing, remembering, generating, and reasoning&lt;/strong&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;hr /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/neural-networks-short-overview.html</link><author>noreply@blogger.com (ITMastersPro)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2000632512313948863.post-8808479478402484552</guid><pubDate>Thu, 12 Mar 2026 06:28:00 +0000</pubDate><atom:updated>2026-03-11T23:28:09.198-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Artificial Intelligence</category><category domain="http://www.blogger.com/atom/ns#">Backpropagation</category><category domain="http://www.blogger.com/atom/ns#">Deep Learning</category><category domain="http://www.blogger.com/atom/ns#">Gradient</category><category domain="http://www.blogger.com/atom/ns#">Loss</category><category domain="http://www.blogger.com/atom/ns#">Macine Learning</category><category domain="http://www.blogger.com/atom/ns#">Neural Networks</category><category domain="http://www.blogger.com/atom/ns#">Weights Adjustment</category><title>Backpropagation in Neural Networks — Intuitive + Mathematical Explanation</title><description>&lt;p&gt;&lt;/p&gt;&lt;p data-end=&quot;185&quot; data-start=&quot;77&quot;&gt;Backpropagation is the &lt;strong data-end=&quot;127&quot; data-start=&quot;100&quot;&gt;core learning algorithm&lt;/strong&gt; that allows neural networks to improve their predictions.&lt;/p&gt;
&lt;blockquote data-end=&quot;271&quot; data-start=&quot;187&quot;&gt;
&lt;p data-end=&quot;271&quot; data-start=&quot;189&quot;&gt;&lt;strong data-end=&quot;271&quot; data-start=&quot;189&quot;&gt;Backpropagation = learning from mistakes by adjusting weights using gradients.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p data-end=&quot;466&quot; data-start=&quot;273&quot;&gt;Whenever a neural network makes a prediction, it usually makes &lt;strong data-end=&quot;350&quot; data-start=&quot;336&quot;&gt;some error&lt;/strong&gt;. Backpropagation calculates &lt;strong data-end=&quot;429&quot; data-start=&quot;379&quot;&gt;how much each neuron contributed to that error&lt;/strong&gt; and adjusts the weights accordingly.&lt;/p&gt;
&lt;hr data-end=&quot;471&quot; data-start=&quot;468&quot; /&gt;
&lt;h1 data-end=&quot;504&quot; data-section-id=&quot;cjkv24&quot; data-start=&quot;473&quot;&gt;Why Backpropagation Is Needed&lt;/h1&gt;
&lt;p data-end=&quot;555&quot; data-start=&quot;506&quot;&gt;Imagine a neural network predicting house prices.&lt;/p&gt;
&lt;p data-end=&quot;592&quot; data-start=&quot;557&quot;&gt;Input → Neural Network → Prediction&lt;/p&gt;
&lt;p data-end=&quot;602&quot; data-start=&quot;594&quot;&gt;Example:&lt;/p&gt;
&lt;div class=&quot;TyagGW_tableContainer&quot;&gt;&lt;div class=&quot;group TyagGW_tableWrapper flex flex-col-reverse w-fit&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;669&quot; data-start=&quot;604&quot;&gt;&lt;thead data-end=&quot;638&quot; data-start=&quot;604&quot;&gt;&lt;tr data-end=&quot;638&quot; data-start=&quot;604&quot;&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;619&quot; data-start=&quot;604&quot;&gt;Actual Price&lt;/th&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;638&quot; data-start=&quot;619&quot;&gt;Predicted Price&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;669&quot; data-start=&quot;649&quot;&gt;&lt;tr data-end=&quot;669&quot; data-start=&quot;649&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;659&quot; data-start=&quot;649&quot;&gt;10 lakh&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;669&quot; data-start=&quot;659&quot;&gt;8 lakh&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p data-end=&quot;685&quot; data-start=&quot;671&quot;&gt;Error = 2 lakh&lt;/p&gt;
&lt;p data-end=&quot;712&quot; data-start=&quot;687&quot;&gt;Now the question becomes:&lt;/p&gt;
&lt;p data-end=&quot;777&quot; data-start=&quot;714&quot;&gt;&lt;strong data-end=&quot;777&quot; data-start=&quot;714&quot;&gt;Which weights caused this error and how should they change?&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;887&quot; data-start=&quot;779&quot;&gt;Backpropagation answers this by computing the &lt;strong data-end=&quot;886&quot; data-start=&quot;825&quot;&gt;gradient of the loss function with respect to each weight&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;892&quot; data-start=&quot;889&quot; /&gt;
&lt;h1 data-end=&quot;928&quot; data-section-id=&quot;1r5t0mp&quot; data-start=&quot;894&quot;&gt;Training Flow of Neural Networks&lt;/h1&gt;
&lt;p data-end=&quot;959&quot; data-start=&quot;930&quot;&gt;Training involves two phases:&lt;/p&gt;
&lt;h3 data-end=&quot;987&quot; data-section-id=&quot;pqwpic&quot; data-start=&quot;961&quot;&gt;1. Forward Propagation&lt;/h3&gt;
&lt;p data-end=&quot;1032&quot; data-start=&quot;989&quot;&gt;Data moves &lt;strong data-end=&quot;1031&quot; data-start=&quot;1000&quot;&gt;forward through the network&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;1064&quot; data-start=&quot;1034&quot;&gt;Input → Hidden layers → Output&lt;/p&gt;
&lt;p data-end=&quot;1090&quot; data-start=&quot;1066&quot;&gt;Prediction is generated.&lt;/p&gt;
&lt;hr data-end=&quot;1095&quot; data-start=&quot;1092&quot; /&gt;
&lt;h3 data-end=&quot;1124&quot; data-section-id=&quot;1vlk3av&quot; data-start=&quot;1097&quot;&gt;2. Backward Propagation&lt;/h3&gt;
&lt;p data-end=&quot;1172&quot; data-start=&quot;1126&quot;&gt;Error moves &lt;strong data-end=&quot;1171&quot; data-start=&quot;1138&quot;&gt;backwards through the network&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;1207&quot; data-start=&quot;1174&quot;&gt;Loss → Gradients → Weight Updates&lt;/p&gt;
&lt;hr data-end=&quot;1212&quot; data-start=&quot;1209&quot; /&gt;
&lt;h1 data-end=&quot;1239&quot; data-section-id=&quot;3a32qv&quot; data-start=&quot;1214&quot;&gt;Mathematical Foundation&lt;/h1&gt;
&lt;p data-end=&quot;1297&quot; data-start=&quot;1241&quot;&gt;Neural networks learn by minimizing a &lt;strong data-end=&quot;1296&quot; data-start=&quot;1279&quot;&gt;loss function&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;1327&quot; data-start=&quot;1299&quot;&gt;Example: Mean Squared Error.&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mi&gt;s&lt;/mi&gt;&lt;mi&gt;s&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mfrac&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mi&gt;r&lt;/mi&gt;&lt;mi&gt;u&lt;/mi&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;p&lt;/mi&gt;&lt;mi&gt;r&lt;/mi&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;Loss = \frac{1}{n} \sum (y_{true} - y_{pred})^2&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;oss&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mop op-symbol large-op&quot;&gt;∑&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;e&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;d&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;1445&quot; data-start=&quot;1384&quot;&gt;Backpropagation calculates how each weight affects this loss.&lt;/p&gt;
&lt;p data-end=&quot;1482&quot; data-start=&quot;1447&quot;&gt;This is done using &lt;strong data-end=&quot;1481&quot; data-start=&quot;1466&quot;&gt;derivatives&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;1487&quot; data-start=&quot;1484&quot; /&gt;
&lt;h1 data-end=&quot;1511&quot; data-section-id=&quot;ojv9qe&quot; data-start=&quot;1489&quot;&gt;Gradient — Core Idea&lt;/h1&gt;
&lt;p data-end=&quot;1583&quot; data-start=&quot;1513&quot;&gt;A gradient tells us &lt;strong data-end=&quot;1582&quot; data-start=&quot;1533&quot;&gt;how much the loss changes when weights change&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;1600&quot; data-start=&quot;1585&quot;&gt;Mathematically:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;G&lt;/mi&gt;&lt;mi&gt;r&lt;/mi&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mi&gt;s&lt;/mi&gt;&lt;mi&gt;s&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;W&lt;/mi&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mi&gt;t&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;Gradient = \frac{\partial Loss}{\partial Weight}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;G&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;W&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;t&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;oss&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;1673&quot; data-start=&quot;1658&quot;&gt;Interpretation:&lt;/p&gt;
&lt;div class=&quot;TyagGW_tableContainer&quot;&gt;&lt;div class=&quot;group TyagGW_tableWrapper flex flex-col-reverse w-fit&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;1826&quot; data-start=&quot;1675&quot;&gt;&lt;thead data-end=&quot;1703&quot; data-start=&quot;1675&quot;&gt;&lt;tr data-end=&quot;1703&quot; data-start=&quot;1675&quot;&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;1692&quot; data-start=&quot;1675&quot;&gt;Gradient Value&lt;/th&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;1703&quot; data-start=&quot;1692&quot;&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;1826&quot; data-start=&quot;1714&quot;&gt;&lt;tr data-end=&quot;1757&quot; data-start=&quot;1714&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1723&quot; data-start=&quot;1714&quot;&gt;Positive&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1757&quot; data-start=&quot;1723&quot;&gt;Increase weight increases loss&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1801&quot; data-start=&quot;1758&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1767&quot; data-start=&quot;1758&quot;&gt;Negative&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1801&quot; data-start=&quot;1767&quot;&gt;Increase weight decreases loss&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1826&quot; data-start=&quot;1802&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1807&quot; data-start=&quot;1802&quot;&gt;Zero&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1826&quot; data-start=&quot;1807&quot;&gt;Minimum reached&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;1831&quot; data-start=&quot;1828&quot; /&gt;
&lt;h1 data-end=&quot;1853&quot; data-section-id=&quot;s4vn4p&quot; data-start=&quot;1833&quot;&gt;Weight Update Rule&lt;/h1&gt;
&lt;p data-end=&quot;1902&quot; data-start=&quot;1855&quot;&gt;Weights are updated using &lt;strong data-end=&quot;1901&quot; data-start=&quot;1881&quot;&gt;Gradient Descent&lt;/strong&gt;.&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mi&gt;l&lt;/mi&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;η&lt;/mi&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;w_{new} = w_{old} - \eta \frac{\partial L}{\partial w}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;d&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;η&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;1972&quot; data-start=&quot;1966&quot;&gt;Where:&lt;/p&gt;
&lt;div class=&quot;TyagGW_tableContainer&quot;&gt;&lt;div class=&quot;group TyagGW_tableWrapper flex flex-col-reverse w-fit&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;2048&quot; data-start=&quot;1974&quot;&gt;&lt;thead data-end=&quot;1994&quot; data-start=&quot;1974&quot;&gt;&lt;tr data-end=&quot;1994&quot; data-start=&quot;1974&quot;&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;1983&quot; data-start=&quot;1974&quot;&gt;Symbol&lt;/th&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;1994&quot; data-start=&quot;1983&quot;&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;2048&quot; data-start=&quot;2005&quot;&gt;&lt;tr data-end=&quot;2017&quot; data-start=&quot;2005&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2007&quot; data-start=&quot;2005&quot;&gt;w&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2017&quot; data-start=&quot;2007&quot;&gt;weight&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2037&quot; data-start=&quot;2018&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2020&quot; data-start=&quot;2018&quot;&gt;η&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2037&quot; data-start=&quot;2020&quot;&gt;learning rate&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2048&quot; data-start=&quot;2038&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2040&quot; data-start=&quot;2038&quot;&gt;L&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2048&quot; data-start=&quot;2040&quot;&gt;loss&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;2053&quot; data-start=&quot;2050&quot; /&gt;
&lt;h1 data-end=&quot;2086&quot; data-section-id=&quot;rz4jb3&quot; data-start=&quot;2055&quot;&gt;Simple Neural Network Example&lt;/h1&gt;
&lt;p data-end=&quot;2112&quot; data-start=&quot;2088&quot;&gt;Consider a tiny network:&lt;/p&gt;
&lt;p data-end=&quot;2155&quot; data-start=&quot;2114&quot;&gt;Input layer → Hidden layer → Output layer&lt;/p&gt;
&lt;p data-end=&quot;2161&quot; data-start=&quot;2157&quot;&gt;Let:&lt;/p&gt;
&lt;p data-end=&quot;2198&quot; data-start=&quot;2163&quot;&gt;Input = x&lt;br data-end=&quot;2175&quot; data-start=&quot;2172&quot; /&gt;
Weight = w&lt;br data-end=&quot;2188&quot; data-start=&quot;2185&quot; /&gt;
Bias = b&lt;/p&gt;
&lt;p data-end=&quot;2214&quot; data-start=&quot;2200&quot;&gt;Neuron output:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z = wx + b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;2252&quot; data-start=&quot;2234&quot;&gt;Activation output:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;a = f(z)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;hr data-end=&quot;2273&quot; data-start=&quot;2270&quot; /&gt;
&lt;h1 data-end=&quot;2289&quot; data-section-id=&quot;c3u4do&quot; data-start=&quot;2275&quot;&gt;Forward Pass&lt;/h1&gt;
&lt;p data-end=&quot;2297&quot; data-start=&quot;2291&quot;&gt;Step 1&lt;/p&gt;
&lt;p data-end=&quot;2322&quot; data-start=&quot;2299&quot;&gt;Compute weighted input.&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z = wx + b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;2348&quot; data-start=&quot;2342&quot;&gt;Step 2&lt;/p&gt;
&lt;p data-end=&quot;2367&quot; data-start=&quot;2350&quot;&gt;Apply activation.&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;a = f(z)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;2420&quot; data-start=&quot;2385&quot;&gt;This value moves to the next layer.&lt;/p&gt;
&lt;hr data-end=&quot;2425&quot; data-start=&quot;2422&quot; /&gt;
&lt;h1 data-end=&quot;2445&quot; data-section-id=&quot;61isx8&quot; data-start=&quot;2427&quot;&gt;Loss Calculation&lt;/h1&gt;
&lt;p data-end=&quot;2479&quot; data-start=&quot;2447&quot;&gt;Suppose the predicted output is:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\hat{y}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;2526&quot; data-start=&quot;2496&quot;&gt;Loss using Mean Squared Error:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;L = (y - \hat{y})^2&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;hr data-end=&quot;2558&quot; data-start=&quot;2555&quot; /&gt;
&lt;h1 data-end=&quot;2584&quot; data-section-id=&quot;1oorfr3&quot; data-start=&quot;2560&quot;&gt;Backpropagation Begins&lt;/h1&gt;
&lt;p data-end=&quot;2591&quot; data-start=&quot;2586&quot;&gt;Goal:&lt;/p&gt;
&lt;p data-end=&quot;2600&quot; data-start=&quot;2593&quot;&gt;Compute&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial w}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;2689&quot; data-start=&quot;2639&quot;&gt;This is done using the &lt;strong data-end=&quot;2688&quot; data-start=&quot;2662&quot;&gt;chain rule of calculus&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;2694&quot; data-start=&quot;2691&quot; /&gt;
&lt;h1 data-end=&quot;2716&quot; data-section-id=&quot;1oxadh&quot; data-start=&quot;2696&quot;&gt;Chain Rule Concept&lt;/h1&gt;
&lt;p data-end=&quot;2801&quot; data-start=&quot;2718&quot;&gt;If a variable depends on another variable, derivatives propagate through the chain.&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{dL}{dw} =
\frac{dL}{da}
\times
\frac{da}{dz}
\times
\frac{dz}{dw}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;2926&quot; data-start=&quot;2882&quot;&gt;Each term represents a stage of the network.&lt;/p&gt;
&lt;hr data-end=&quot;2931&quot; data-start=&quot;2928&quot; /&gt;
&lt;h1 data-end=&quot;2954&quot; data-section-id=&quot;sap6gs&quot; data-start=&quot;2933&quot;&gt;Gradient Components&lt;/h1&gt;
&lt;h3 data-end=&quot;2978&quot; data-section-id=&quot;1fw3mzd&quot; data-start=&quot;2956&quot;&gt;1. Loss derivative&lt;/h3&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial a}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;3046&quot; data-start=&quot;3017&quot;&gt;How loss changes with output.&lt;/p&gt;
&lt;hr data-end=&quot;3051&quot; data-start=&quot;3048&quot; /&gt;
&lt;h3 data-end=&quot;3081&quot; data-section-id=&quot;1rkv2p9&quot; data-start=&quot;3053&quot;&gt;2. Activation derivative&lt;/h3&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial a}{\partial z}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;3151&quot; data-start=&quot;3120&quot;&gt;Depends on activation function.&lt;/p&gt;
&lt;p data-end=&quot;3166&quot; data-start=&quot;3153&quot;&gt;Example ReLU:&lt;/p&gt;
&lt;p data-end=&quot;3180&quot; data-start=&quot;3168&quot;&gt;Derivative =&lt;/p&gt;
&lt;p data-end=&quot;3205&quot; data-start=&quot;3182&quot;&gt;0 if z &amp;lt; 0&lt;br data-end=&quot;3195&quot; data-start=&quot;3192&quot; /&gt;
1 if z &amp;gt; 0&lt;/p&gt;
&lt;hr data-end=&quot;3210&quot; data-start=&quot;3207&quot; /&gt;
&lt;h3 data-end=&quot;3236&quot; data-section-id=&quot;3ip6zc&quot; data-start=&quot;3212&quot;&gt;3. Weight derivative&lt;/h3&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial z}{\partial w} = x&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;3286&quot; data-start=&quot;3279&quot;&gt;Because&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z = wx + b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;hr data-end=&quot;3309&quot; data-start=&quot;3306&quot; /&gt;
&lt;h1 data-end=&quot;3327&quot; data-section-id=&quot;58yya4&quot; data-start=&quot;3311&quot;&gt;Final Gradient&lt;/h1&gt;
&lt;p data-end=&quot;3339&quot; data-start=&quot;3329&quot;&gt;Combining:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial w}
=
\frac{\partial L}{\partial a}
\times
\frac{\partial a}{\partial z}
\times
x&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;3504&quot; data-start=&quot;3456&quot;&gt;This tells us &lt;strong data-end=&quot;3503&quot; data-start=&quot;3470&quot;&gt;how much to adjust the weight&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;3509&quot; data-start=&quot;3506&quot; /&gt;
&lt;h1 data-end=&quot;3530&quot; data-section-id=&quot;vaez6x&quot; data-start=&quot;3511&quot;&gt;Weight Adjustment&lt;/h1&gt;
&lt;p data-end=&quot;3555&quot; data-start=&quot;3532&quot;&gt;Using gradient descent:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;η&lt;/mi&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;w_{new} = w - \eta \frac{\partial L}{\partial w}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;η&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;3618&quot; data-start=&quot;3613&quot;&gt;Where&lt;/p&gt;
&lt;p data-end=&quot;3637&quot; data-start=&quot;3620&quot;&gt;η = learning rate&lt;/p&gt;
&lt;hr data-end=&quot;3642&quot; data-start=&quot;3639&quot; /&gt;
&lt;h1 data-end=&quot;3685&quot; data-section-id=&quot;xtflbk&quot; data-start=&quot;3644&quot;&gt;Backpropagation Through Multiple Layers&lt;/h1&gt;
&lt;p data-end=&quot;3747&quot; data-start=&quot;3687&quot;&gt;For deeper networks, the gradient propagates layer by layer.&lt;/p&gt;
&lt;p data-end=&quot;3790&quot; data-start=&quot;3749&quot;&gt;Output layer → Hidden layer → Input layer&lt;/p&gt;
&lt;p data-end=&quot;3829&quot; data-start=&quot;3792&quot;&gt;The chain rule is applied repeatedly.&lt;/p&gt;
&lt;p data-end=&quot;3839&quot; data-start=&quot;3831&quot;&gt;Example:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial w_1}
=
\frac{\partial L}{\partial a_3}
\times
\frac{\partial a_3}{\partial a_2}
\times
\frac{\partial a_2}{\partial a_1}
\times
\frac{\partial a_1}{\partial w_1}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;4090&quot; data-start=&quot;4037&quot;&gt;This allows gradients to flow through &lt;strong data-end=&quot;4089&quot; data-start=&quot;4075&quot;&gt;all layers&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;4095&quot; data-start=&quot;4092&quot; /&gt;
&lt;h1 data-end=&quot;4138&quot; data-section-id=&quot;h9jme8&quot; data-start=&quot;4097&quot;&gt;Vectorized Form (Matrix Representation)&lt;/h1&gt;
&lt;p data-end=&quot;4169&quot; data-start=&quot;4140&quot;&gt;Neural networks use matrices.&lt;/p&gt;
&lt;p data-end=&quot;4191&quot; data-start=&quot;4171&quot;&gt;Forward propagation:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;Z&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;W&lt;/mi&gt;&lt;mi&gt;X&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;Z = W X + b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;Z&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;W&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;4223&quot; data-start=&quot;4212&quot;&gt;Activation:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;A&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;Z&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;A = f(Z)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;Z&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;4267&quot; data-start=&quot;4241&quot;&gt;Backpropagation gradients:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;W&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;W&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;dW = \frac{\partial L}{\partial W}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;W&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;W&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;db = \frac{\partial L}{\partial b}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p data-end=&quot;4361&quot; data-start=&quot;4353&quot;&gt;Updates:&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;W&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;W&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;η&lt;/mi&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;W&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;W = W - \eta dW&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;W&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;W&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;η&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;W&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;η&lt;/mi&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;b = b - \eta db&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;η&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;hr data-end=&quot;4412&quot; data-start=&quot;4409&quot; /&gt;
&lt;h1 data-end=&quot;4453&quot; data-section-id=&quot;1et5r91&quot; data-start=&quot;4414&quot;&gt;Intuition: How Backpropagation Learns&lt;/h1&gt;
&lt;p data-end=&quot;4489&quot; data-start=&quot;4455&quot;&gt;Think of a student taking an exam.&lt;/p&gt;
&lt;p data-end=&quot;4636&quot; data-start=&quot;4491&quot;&gt;Step 1 — Student answers questions&lt;br data-end=&quot;4528&quot; data-start=&quot;4525&quot; /&gt;
Step 2 — Teacher checks answers&lt;br data-end=&quot;4562&quot; data-start=&quot;4559&quot; /&gt;
Step 3 — Teacher points out mistakes&lt;br data-end=&quot;4601&quot; data-start=&quot;4598&quot; /&gt;
Step 4 — Student improves next time&lt;/p&gt;
&lt;p data-end=&quot;4678&quot; data-start=&quot;4638&quot;&gt;Backpropagation is exactly this process.&lt;/p&gt;
&lt;hr data-end=&quot;4683&quot; data-start=&quot;4680&quot; /&gt;
&lt;h1 data-end=&quot;4716&quot; data-section-id=&quot;11rrrto&quot; data-start=&quot;4685&quot;&gt;Challenges in Backpropagation&lt;/h1&gt;
&lt;h2 data-end=&quot;4741&quot; data-section-id=&quot;1o9ldp5&quot; data-start=&quot;4718&quot;&gt;1 Vanishing Gradient&lt;/h2&gt;
&lt;p data-end=&quot;4788&quot; data-start=&quot;4743&quot;&gt;Gradients become very small in deep networks.&lt;/p&gt;
&lt;p data-end=&quot;4810&quot; data-start=&quot;4790&quot;&gt;Learning slows down.&lt;/p&gt;
&lt;p data-end=&quot;4824&quot; data-start=&quot;4812&quot;&gt;Common with:&lt;/p&gt;
&lt;ul data-end=&quot;4842&quot; data-start=&quot;4826&quot;&gt;
&lt;li data-end=&quot;4835&quot; data-section-id=&quot;1npxgbe&quot; data-start=&quot;4826&quot;&gt;
&lt;p data-end=&quot;4835&quot; data-start=&quot;4828&quot;&gt;Sigmoid&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4842&quot; data-section-id=&quot;1j4cyfv&quot; data-start=&quot;4836&quot;&gt;
&lt;p data-end=&quot;4842&quot; data-start=&quot;4838&quot;&gt;Tanh&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;4847&quot; data-start=&quot;4844&quot; /&gt;
&lt;h2 data-end=&quot;4872&quot; data-section-id=&quot;12fbxzv&quot; data-start=&quot;4849&quot;&gt;2 Exploding Gradient&lt;/h2&gt;
&lt;p data-end=&quot;4907&quot; data-start=&quot;4874&quot;&gt;Gradients become extremely large.&lt;/p&gt;
&lt;p data-end=&quot;4933&quot; data-start=&quot;4909&quot;&gt;Weights become unstable.&lt;/p&gt;
&lt;hr data-end=&quot;4938&quot; data-start=&quot;4935&quot; /&gt;
&lt;h1 data-end=&quot;4951&quot; data-section-id=&quot;136sux8&quot; data-start=&quot;4940&quot;&gt;Solutions&lt;/h1&gt;
&lt;div class=&quot;TyagGW_tableContainer&quot;&gt;&lt;div class=&quot;group TyagGW_tableWrapper flex flex-col-reverse w-fit&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;5099&quot; data-start=&quot;4953&quot;&gt;&lt;thead data-end=&quot;4975&quot; data-start=&quot;4953&quot;&gt;&lt;tr data-end=&quot;4975&quot; data-start=&quot;4953&quot;&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;4963&quot; data-start=&quot;4953&quot;&gt;Problem&lt;/th&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;4975&quot; data-start=&quot;4963&quot;&gt;Solution&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;5099&quot; data-start=&quot;4986&quot;&gt;&lt;tr data-end=&quot;5013&quot; data-start=&quot;4986&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5005&quot; data-start=&quot;4986&quot;&gt;Vanishing gradient&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5013&quot; data-start=&quot;5005&quot;&gt;ReLU&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5054&quot; data-start=&quot;5014&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5033&quot; data-start=&quot;5014&quot;&gt;Exploding gradient&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5054&quot; data-start=&quot;5033&quot;&gt;Gradient clipping&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5099&quot; data-start=&quot;5055&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5076&quot; data-start=&quot;5055&quot;&gt;Training instability&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5099&quot; data-start=&quot;5076&quot;&gt;Batch normalization&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;5104&quot; data-start=&quot;5101&quot; /&gt;
&lt;h1 data-end=&quot;5131&quot; data-section-id=&quot;1tf1zxc&quot; data-start=&quot;5106&quot;&gt;Quick Algorithm Summary&lt;/h1&gt;
&lt;p data-end=&quot;5147&quot; data-start=&quot;5133&quot;&gt;Training loop:&lt;/p&gt;
&lt;ol data-end=&quot;5348&quot; data-start=&quot;5149&quot;&gt;
&lt;li data-end=&quot;5181&quot; data-section-id=&quot;x8f6cv&quot; data-start=&quot;5149&quot;&gt;
&lt;p data-end=&quot;5181&quot; data-start=&quot;5152&quot;&gt;Initialize weights randomly&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5214&quot; data-section-id=&quot;1ig6g9h&quot; data-start=&quot;5182&quot;&gt;
&lt;p data-end=&quot;5214&quot; data-start=&quot;5185&quot;&gt;Perform forward propagation&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5232&quot; data-section-id=&quot;x5nia6&quot; data-start=&quot;5215&quot;&gt;
&lt;p data-end=&quot;5232&quot; data-start=&quot;5218&quot;&gt;Compute loss&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5277&quot; data-section-id=&quot;1wmhiz8&quot; data-start=&quot;5233&quot;&gt;
&lt;p data-end=&quot;5277&quot; data-start=&quot;5236&quot;&gt;Compute gradients using backpropagation&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5320&quot; data-section-id=&quot;phayr6&quot; data-start=&quot;5278&quot;&gt;
&lt;p data-end=&quot;5320&quot; data-start=&quot;5281&quot;&gt;Update weights using gradient descent&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5348&quot; data-section-id=&quot;1l2l3ih&quot; data-start=&quot;5321&quot;&gt;
&lt;p data-end=&quot;5348&quot; data-start=&quot;5324&quot;&gt;Repeat until convergence&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;5353&quot; data-start=&quot;5350&quot; /&gt;
&lt;h1 data-end=&quot;5384&quot; data-section-id=&quot;b85drz&quot; data-start=&quot;5355&quot;&gt;Backpropagation Cheat Sheet&lt;/h1&gt;
&lt;div class=&quot;TyagGW_tableContainer&quot;&gt;&lt;div class=&quot;group TyagGW_tableWrapper flex flex-col-reverse w-fit&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;5578&quot; data-start=&quot;5386&quot;&gt;&lt;thead data-end=&quot;5404&quot; data-start=&quot;5386&quot;&gt;&lt;tr data-end=&quot;5404&quot; data-start=&quot;5386&quot;&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;5393&quot; data-start=&quot;5386&quot;&gt;Step&lt;/th&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;5404&quot; data-start=&quot;5393&quot;&gt;Formula&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;5578&quot; data-start=&quot;5415&quot;&gt;&lt;tr data-end=&quot;5441&quot; data-start=&quot;5415&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5423&quot; data-start=&quot;5415&quot;&gt;Forward&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5441&quot; data-start=&quot;5423&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z = wx + b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5469&quot; data-start=&quot;5442&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5453&quot; data-start=&quot;5442&quot;&gt;Activation&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5469&quot; data-start=&quot;5453&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;a = f(z)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5494&quot; data-start=&quot;5470&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5475&quot; data-start=&quot;5470&quot;&gt;Loss&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5494&quot; data-start=&quot;5475&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo separator=&quot;true&quot;&gt;,&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;L(y,\hat y)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;mpunct&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5541&quot; data-start=&quot;5495&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5504&quot; data-start=&quot;5495&quot;&gt;Gradient&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5541&quot; data-start=&quot;5504&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial w}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5578&quot; data-start=&quot;5542&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5549&quot; data-start=&quot;5542&quot;&gt;Update&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5578&quot; data-start=&quot;5549&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;η&lt;/mi&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∇&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;w = w - \eta \nabla L&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;η&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;∇&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;5583&quot; data-start=&quot;5580&quot; /&gt;
&lt;h1 data-end=&quot;5598&quot; data-section-id=&quot;1cbbvmf&quot; data-start=&quot;5585&quot;&gt;Key Insight&lt;/h1&gt;
&lt;p data-end=&quot;5654&quot; data-start=&quot;5600&quot;&gt;Backpropagation works because of one fundamental idea:&lt;/p&gt;
&lt;blockquote data-end=&quot;5752&quot; data-start=&quot;5656&quot;&gt;
&lt;p data-end=&quot;5752&quot; data-start=&quot;5658&quot;&gt;&lt;strong data-end=&quot;5752&quot; data-start=&quot;5658&quot;&gt;Use calculus (chain rule) to propagate error backward and adjust weights to minimize loss.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p data-end=&quot;5849&quot; data-start=&quot;5754&quot;&gt;Without backpropagation, training deep neural networks would be &lt;strong data-end=&quot;5848&quot; data-start=&quot;5818&quot;&gt;computationally impossible&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p data-end=&quot;219&quot; data-start=&quot;0&quot;&gt;Great — let’s walk through a &lt;strong data-end=&quot;82&quot; data-start=&quot;29&quot;&gt;numerical example of backpropagation step-by-step&lt;/strong&gt;. This makes the concept much clearer than formulas alone. We will compute &lt;strong data-end=&quot;209&quot; data-start=&quot;157&quot;&gt;forward pass → loss → gradients → weight updates&lt;/strong&gt; manually.&lt;/p&gt;&lt;hr data-end=&quot;224&quot; data-start=&quot;221&quot; /&gt;&lt;h1 data-end=&quot;277&quot; data-section-id=&quot;18kujfb&quot; data-start=&quot;226&quot;&gt;Step-by-Step Numerical Example of Backpropagation&lt;/h1&gt;&lt;p data-end=&quot;320&quot; data-start=&quot;279&quot;&gt;Consider a &lt;strong data-end=&quot;319&quot; data-start=&quot;290&quot;&gt;very small neural network&lt;/strong&gt;:&lt;/p&gt;&lt;p data-end=&quot;338&quot; data-start=&quot;322&quot;&gt;&lt;strong data-end=&quot;338&quot; data-start=&quot;322&quot;&gt;Architecture&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;385&quot; data-start=&quot;340&quot;&gt;&lt;div class=&quot;relative w-full mt-4 mb-1&quot;&gt;&lt;div class=&quot;&quot;&gt;&lt;div class=&quot;relative&quot;&gt;&lt;div class=&quot;h-full min-h-0 min-w-0&quot;&gt;&lt;div class=&quot;h-full min-h-0 min-w-0&quot;&gt;&lt;div class=&quot;border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl&quot;&gt;&lt;div class=&quot;h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback&quot;&gt;&lt;div class=&quot;pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;&quot;&gt;&lt;div class=&quot;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p data-end=&quot;397&quot; data-start=&quot;387&quot;&gt;We assume:&lt;/p&gt;&lt;div class=&quot;TyagGW_tableContainer&quot;&gt;&lt;div class=&quot;group TyagGW_tableWrapper flex flex-col-reverse w-fit&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;558&quot; data-start=&quot;399&quot;&gt;&lt;thead data-end=&quot;420&quot; data-start=&quot;399&quot;&gt;&lt;tr data-end=&quot;420&quot; data-start=&quot;399&quot;&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;411&quot; data-start=&quot;399&quot;&gt;Component&lt;/th&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;420&quot; data-start=&quot;411&quot;&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;558&quot; data-start=&quot;431&quot;&gt;&lt;tr data-end=&quot;446&quot; data-start=&quot;431&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;441&quot; data-start=&quot;431&quot;&gt;Input (x)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;446&quot; data-start=&quot;441&quot;&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;470&quot; data-start=&quot;447&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;465&quot; data-start=&quot;447&quot;&gt;Target output (y)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;470&quot; data-start=&quot;465&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;491&quot; data-start=&quot;471&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;484&quot; data-start=&quot;471&quot;&gt;Weight1 (w₁)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;491&quot; data-start=&quot;484&quot;&gt;0.5&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;512&quot; data-start=&quot;492&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;505&quot; data-start=&quot;492&quot;&gt;Weight2 (w₂)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;512&quot; data-start=&quot;505&quot;&gt;0.5&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;538&quot; data-start=&quot;513&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;531&quot; data-start=&quot;513&quot;&gt;Learning rate (η)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;538&quot; data-start=&quot;531&quot;&gt;0.1&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;558&quot; data-start=&quot;539&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;550&quot; data-start=&quot;539&quot;&gt;Activation&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;558&quot; data-start=&quot;550&quot;&gt;ReLU&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr data-end=&quot;563&quot; data-start=&quot;560&quot; /&gt;&lt;h1 data-end=&quot;595&quot; data-section-id=&quot;1vg9yuk&quot; data-start=&quot;565&quot;&gt;Step 1 — Forward Propagation&lt;/h1&gt;&lt;p data-end=&quot;634&quot; data-start=&quot;597&quot;&gt;First compute the hidden layer value.&lt;/p&gt;&lt;p data-end=&quot;650&quot; data-start=&quot;636&quot;&gt;Hidden neuron:&lt;/p&gt;&lt;p&gt;











&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z_1 = w_1 \times x&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;698&quot; data-start=&quot;680&quot;&gt;Substitute values:&lt;/p&gt;&lt;p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0.5&lt;/mn&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z_1 = 0.5 \times 2 = 1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;754&quot; data-start=&quot;730&quot;&gt;Apply activation (ReLU).&lt;/p&gt;&lt;p data-end=&quot;774&quot; data-start=&quot;758&quot;&gt;Since &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z_1=1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;,&lt;/p&gt;&lt;p&gt;

&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;a_1 = 1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;794&quot; data-start=&quot;791&quot; /&gt;&lt;h1 data-end=&quot;819&quot; data-section-id=&quot;1fy7yoe&quot; data-start=&quot;796&quot;&gt;Step 2 — Output Layer&lt;/h1&gt;&lt;p data-end=&quot;869&quot; data-start=&quot;821&quot;&gt;Output neuron receives input from hidden neuron.&lt;/p&gt;&lt;p&gt;


&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z_2 = w_2 \times a_1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;912&quot; data-start=&quot;901&quot;&gt;Substitute:&lt;/p&gt;&lt;p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0.5&lt;/mn&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0.5&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z_2 = 0.5 \times 1 = 0.5&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;967&quot; data-start=&quot;946&quot;&gt;Assume linear output.&lt;/p&gt;&lt;p data-end=&quot;980&quot; data-start=&quot;969&quot;&gt;Prediction:&lt;/p&gt;&lt;p&gt;

&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0.5&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\hat{y} = 0.5&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;1006&quot; data-start=&quot;1003&quot; /&gt;&lt;h1 data-end=&quot;1031&quot; data-section-id=&quot;1yrbb7p&quot; data-start=&quot;1008&quot;&gt;Step 3 — Compute Loss&lt;/h1&gt;&lt;p data-end=&quot;1063&quot; data-start=&quot;1033&quot;&gt;We use &lt;strong data-end=&quot;1062&quot; data-start=&quot;1040&quot;&gt;Mean Squared Error&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;


&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;L = (y - \hat{y})^2&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;1105&quot; data-start=&quot;1094&quot;&gt;Substitute:&lt;/p&gt;&lt;p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;0.5&lt;/mn&gt;&lt;msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;L = (1 - 0.5)^2&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0.25&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;L = 0.25&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.25&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;1180&quot; data-start=&quot;1146&quot;&gt;So the model has &lt;strong data-end=&quot;1179&quot; data-start=&quot;1163&quot;&gt;error = 0.25&lt;/strong&gt;.&lt;/p&gt;&lt;hr data-end=&quot;1185&quot; data-start=&quot;1182&quot; /&gt;&lt;h1 data-end=&quot;1219&quot; data-section-id=&quot;1onmr3t&quot; data-start=&quot;1187&quot;&gt;Step 4 — Start Backpropagation&lt;/h1&gt;&lt;p data-end=&quot;1273&quot; data-start=&quot;1221&quot;&gt;Now we compute gradients &lt;strong data-end=&quot;1272&quot; data-start=&quot;1246&quot;&gt;from output → backward&lt;/strong&gt;.&lt;/p&gt;&lt;p data-end=&quot;1285&quot; data-start=&quot;1275&quot;&gt;Goal: find&lt;/p&gt;&lt;p&gt;




&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mspace width=&quot;1em&quot;&gt;&lt;/mspace&gt;&lt;mtext&gt;and&lt;/mtext&gt;&lt;mspace width=&quot;1em&quot;&gt;&lt;/mspace&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial w_2}
\quad
\text{and}
\quad
\frac{\partial L}{\partial w_1}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord text&quot;&gt;&lt;span class=&quot;mord&quot;&gt;and&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;1384&quot; data-start=&quot;1381&quot; /&gt;&lt;h1 data-end=&quot;1421&quot; data-section-id=&quot;u7a75m&quot; data-start=&quot;1386&quot;&gt;Step 5 — Gradient at Output Layer&lt;/h1&gt;&lt;p data-end=&quot;1475&quot; data-start=&quot;1423&quot;&gt;First derivative of loss with respect to prediction.&lt;/p&gt;&lt;p&gt;


&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial \hat{y}} = 2(\hat{y} - y)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;1555&quot; data-start=&quot;1537&quot;&gt;Substitute values:&lt;/p&gt;&lt;p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mn&gt;0.5&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;= 2(0.5 - 1)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;= -1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;1592&quot; data-start=&quot;1589&quot; /&gt;&lt;p data-end=&quot;1610&quot; data-start=&quot;1594&quot;&gt;Next derivative:&lt;/p&gt;&lt;p&gt;

&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial \hat{y}}{\partial w_2} = a_1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;1670&quot; data-start=&quot;1663&quot;&gt;Because&lt;/p&gt;&lt;p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\hat{y} = w_2 a_1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;1699&quot; data-start=&quot;1697&quot;&gt;So&lt;/p&gt;&lt;p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;= 1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;1715&quot; data-start=&quot;1712&quot; /&gt;&lt;h1 data-end=&quot;1750&quot; data-section-id=&quot;10dzr4u&quot; data-start=&quot;1717&quot;&gt;Step 6 — Gradient for Weight w₂&lt;/h1&gt;&lt;p data-end=&quot;1769&quot; data-start=&quot;1752&quot;&gt;Using chain rule:&lt;/p&gt;&lt;p&gt;


&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial w_2}
=
\frac{\partial L}{\partial \hat{y}}
\times
\frac{\partial \hat{y}}{\partial w_2}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;= (-1) \times 1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;= -1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;1931&quot; data-start=&quot;1928&quot; /&gt;&lt;h1 data-end=&quot;1960&quot; data-section-id=&quot;5sld77&quot; data-start=&quot;1933&quot;&gt;Step 7 — Update Weight w₂&lt;/h1&gt;&lt;p data-end=&quot;1981&quot; data-start=&quot;1962&quot;&gt;Weight update rule:&lt;/p&gt;&lt;p&gt;


&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mi&gt;e&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;η&lt;/mi&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;w_{new} = w - \eta \frac{\partial L}{\partial w}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;η&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;2052&quot; data-start=&quot;2041&quot;&gt;Substitute:&lt;/p&gt;&lt;p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0.5&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;0.1&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;w_2 = 0.5 - 0.1(-1)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0.6&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;w_2 = 0.6&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.6&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;2150&quot; data-start=&quot;2098&quot;&gt;Weight increased because prediction was &lt;strong data-end=&quot;2149&quot; data-start=&quot;2138&quot;&gt;too low&lt;/strong&gt;.&lt;/p&gt;&lt;hr data-end=&quot;2155&quot; data-start=&quot;2152&quot; /&gt;&lt;h1 data-end=&quot;2197&quot; data-section-id=&quot;1rxsdbe&quot; data-start=&quot;2157&quot;&gt;Step 8 — Backpropagate to Hidden Layer&lt;/h1&gt;&lt;p data-end=&quot;2231&quot; data-start=&quot;2199&quot;&gt;Now compute gradient for &lt;strong data-end=&quot;2230&quot; data-start=&quot;2224&quot;&gt;w₁&lt;/strong&gt;.&lt;/p&gt;&lt;p data-end=&quot;2250&quot; data-start=&quot;2233&quot;&gt;Chain rule again:&lt;/p&gt;&lt;p&gt;




&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial w_1}
=
\frac{\partial L}{\partial \hat{y}}
\times
\frac{\partial \hat{y}}{\partial a_1}
\times
\frac{\partial a_1}{\partial z_1}
\times
\frac{\partial z_1}{\partial w_1}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;2459&quot; data-start=&quot;2456&quot; /&gt;&lt;h3 data-end=&quot;2482&quot; data-section-id=&quot;1awqfm&quot; data-start=&quot;2461&quot;&gt;Compute each term&lt;/h3&gt;&lt;p data-end=&quot;2487&quot; data-start=&quot;2484&quot;&gt;1️⃣&lt;/p&gt;&lt;p&gt;


&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial \hat{y}} = -1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;2540&quot; data-start=&quot;2537&quot; /&gt;&lt;p data-end=&quot;2545&quot; data-start=&quot;2542&quot;&gt;2️⃣&lt;/p&gt;&lt;p&gt;

&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mover accent=&quot;true&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;^&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial \hat{y}}{\partial a_1} = w_2&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord accent&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;accent-body&quot;&gt;&lt;span class=&quot;mord&quot;&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;2603&quot; data-start=&quot;2598&quot;&gt;= 0.5&lt;/p&gt;&lt;hr data-end=&quot;2608&quot; data-start=&quot;2605&quot; /&gt;&lt;p data-end=&quot;2629&quot; data-start=&quot;2610&quot;&gt;3️⃣ ReLU derivative&lt;/p&gt;&lt;p data-end=&quot;2645&quot; data-start=&quot;2631&quot;&gt;If &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;&amp;gt;&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;z_1 &amp;gt; 0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;



&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial a_1}{\partial z_1} = 1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;2695&quot; data-start=&quot;2692&quot; /&gt;&lt;p data-end=&quot;2700&quot; data-start=&quot;2697&quot;&gt;4️⃣&lt;/p&gt;&lt;p&gt;

&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial z_1}{\partial w_1} = x&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p data-end=&quot;2750&quot; data-start=&quot;2747&quot;&gt;= 2&lt;/p&gt;&lt;hr data-end=&quot;2755&quot; data-start=&quot;2752&quot; /&gt;&lt;h1 data-end=&quot;2791&quot; data-section-id=&quot;1jzx9gn&quot; data-start=&quot;2757&quot;&gt;Step 9 — Compute Gradient for w₁&lt;/h1&gt;&lt;p data-end=&quot;2812&quot; data-start=&quot;2793&quot;&gt;Multiply all terms:&lt;/p&gt;&lt;p&gt;



&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;mi&gt;L&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∂&lt;/mi&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mn&gt;0.5&lt;/mn&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;×&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\frac{\partial L}{\partial w_1}
=
(-1) \times 0.5 \times 1 \times 2&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord&quot;&gt;∂&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;×&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;= -1&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;2904&quot; data-start=&quot;2901&quot; /&gt;&lt;h1 data-end=&quot;2934&quot; data-section-id=&quot;1bccmkm&quot; data-start=&quot;2906&quot;&gt;Step 10 — Update Weight w₁&lt;/h1&gt;&lt;p&gt;

&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0.5&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;0.1&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;w_1 = 0.5 - 0.1(-1)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math display=&quot;block&quot; xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;w&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0.6&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;w_1 = 0.6&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;katex-html&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;span class=&quot;pstrut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0.6&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;hr data-end=&quot;2983&quot; data-start=&quot;2980&quot; /&gt;&lt;h1 data-end=&quot;3008&quot; data-section-id=&quot;3ykquk&quot; data-start=&quot;2985&quot;&gt;Final Updated Weights&lt;/h1&gt;&lt;div class=&quot;TyagGW_tableContainer&quot;&gt;&lt;div class=&quot;group TyagGW_tableWrapper flex flex-col-reverse w-fit&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;3085&quot; data-start=&quot;3010&quot;&gt;&lt;thead data-end=&quot;3037&quot; data-start=&quot;3010&quot;&gt;&lt;tr data-end=&quot;3037&quot; data-start=&quot;3010&quot;&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;3019&quot; data-start=&quot;3010&quot;&gt;Weight&lt;/th&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;3028&quot; data-start=&quot;3019&quot;&gt;Before&lt;/th&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;3037&quot; data-start=&quot;3028&quot;&gt;After&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;3085&quot; data-start=&quot;3052&quot;&gt;&lt;tr data-end=&quot;3068&quot; data-start=&quot;3052&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3055&quot; data-start=&quot;3052&quot;&gt;w₁&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3061&quot; data-start=&quot;3055&quot;&gt;0.5&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3068&quot; data-start=&quot;3061&quot;&gt;0.6&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3085&quot; data-start=&quot;3069&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3072&quot; data-start=&quot;3069&quot;&gt;w₂&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3078&quot; data-start=&quot;3072&quot;&gt;0.5&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3085&quot; data-start=&quot;3078&quot;&gt;0.6&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;p data-end=&quot;3126&quot; data-start=&quot;3087&quot;&gt;Both weights increased to reduce error.&lt;/p&gt;&lt;hr data-end=&quot;3131&quot; data-start=&quot;3128&quot; /&gt;&lt;h1 data-end=&quot;3152&quot; data-section-id=&quot;1m1ybzu&quot; data-start=&quot;3133&quot;&gt;What Happens Next&lt;/h1&gt;&lt;p data-end=&quot;3178&quot; data-start=&quot;3154&quot;&gt;Next training iteration:&lt;/p&gt;&lt;ol data-end=&quot;3282&quot; data-start=&quot;3180&quot;&gt;
&lt;li data-end=&quot;3203&quot; data-section-id=&quot;4s76k0&quot; data-start=&quot;3180&quot;&gt;
&lt;p data-end=&quot;3203&quot; data-start=&quot;3183&quot;&gt;Forward pass again&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3240&quot; data-section-id=&quot;ebdmbi&quot; data-start=&quot;3204&quot;&gt;
&lt;p data-end=&quot;3240&quot; data-start=&quot;3207&quot;&gt;New prediction closer to target&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3260&quot; data-section-id=&quot;123ki3u&quot; data-start=&quot;3241&quot;&gt;
&lt;p data-end=&quot;3260&quot; data-start=&quot;3244&quot;&gt;Loss decreases&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3282&quot; data-section-id=&quot;ce4o3z&quot; data-start=&quot;3261&quot;&gt;
&lt;p data-end=&quot;3282&quot; data-start=&quot;3264&quot;&gt;Gradients shrink&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;p data-end=&quot;3319&quot; data-start=&quot;3284&quot;&gt;Eventually the model &lt;strong data-end=&quot;3318&quot; data-start=&quot;3305&quot;&gt;converges&lt;/strong&gt;.&lt;/p&gt;&lt;hr data-end=&quot;3324&quot; data-start=&quot;3321&quot; /&gt;&lt;h1 data-end=&quot;3342&quot; data-section-id=&quot;a2z60k&quot; data-start=&quot;3326&quot;&gt;Why This Works&lt;/h1&gt;&lt;p data-end=&quot;3360&quot; data-start=&quot;3344&quot;&gt;Backpropagation:&lt;/p&gt;&lt;ol data-end=&quot;3470&quot; data-start=&quot;3362&quot;&gt;
&lt;li data-end=&quot;3381&quot; data-section-id=&quot;airex&quot; data-start=&quot;3362&quot;&gt;
&lt;p data-end=&quot;3381&quot; data-start=&quot;3365&quot;&gt;Measures error&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3427&quot; data-section-id=&quot;em16p9&quot; data-start=&quot;3382&quot;&gt;
&lt;p data-end=&quot;3427&quot; data-start=&quot;3385&quot;&gt;Calculates gradient using &lt;strong data-end=&quot;3425&quot; data-start=&quot;3411&quot;&gt;chain rule&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3470&quot; data-section-id=&quot;xz06az&quot; data-start=&quot;3428&quot;&gt;
&lt;p data-end=&quot;3470&quot; data-start=&quot;3431&quot;&gt;Adjusts weights toward &lt;strong data-end=&quot;3470&quot; data-start=&quot;3454&quot;&gt;minimum loss&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;p data-end=&quot;3545&quot; data-start=&quot;3472&quot;&gt;It is essentially &lt;strong data-end=&quot;3544&quot; data-start=&quot;3490&quot;&gt;multivariable calculus applied to learning systems&lt;/strong&gt;.&lt;/p&gt;&lt;hr data-end=&quot;3550&quot; data-start=&quot;3547&quot; /&gt;&lt;h1 data-end=&quot;3570&quot; data-section-id=&quot;y52nkx&quot; data-start=&quot;3552&quot;&gt;Visual Intuition&lt;/h1&gt;&lt;p data-end=&quot;3611&quot; data-start=&quot;3572&quot;&gt;Imagine a &lt;strong data-end=&quot;3610&quot; data-start=&quot;3582&quot;&gt;ball rolling down a hill&lt;/strong&gt;.&lt;/p&gt;&lt;ul data-end=&quot;3695&quot; data-start=&quot;3613&quot;&gt;
&lt;li data-end=&quot;3636&quot; data-section-id=&quot;1dx52ma&quot; data-start=&quot;3613&quot;&gt;
&lt;p data-end=&quot;3636&quot; data-start=&quot;3615&quot;&gt;Hill = loss surface&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3664&quot; data-section-id=&quot;1bofxsz&quot; data-start=&quot;3637&quot;&gt;
&lt;p data-end=&quot;3664&quot; data-start=&quot;3639&quot;&gt;Ball = model parameters&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3695&quot; data-section-id=&quot;13olt3n&quot; data-start=&quot;3665&quot;&gt;
&lt;p data-end=&quot;3695&quot; data-start=&quot;3667&quot;&gt;Gradient = slope direction&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p data-end=&quot;3729&quot; data-start=&quot;3697&quot;&gt;Backpropagation tells the model:&lt;/p&gt;&lt;blockquote data-end=&quot;3790&quot; data-start=&quot;3731&quot;&gt;
&lt;p data-end=&quot;3790&quot; data-start=&quot;3733&quot;&gt;“Move in the direction where the loss decreases fastest.”&lt;/p&gt;
&lt;/blockquote&gt;&lt;hr data-end=&quot;3795&quot; data-start=&quot;3792&quot; /&gt;&lt;h1 data-end=&quot;3818&quot; data-section-id=&quot;p51vyy&quot; data-start=&quot;3797&quot;&gt;Key Learning Points&lt;/h1&gt;&lt;p&gt;





















&lt;/p&gt;&lt;div class=&quot;TyagGW_tableContainer&quot;&gt;&lt;div class=&quot;group TyagGW_tableWrapper flex flex-col-reverse w-fit&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;4032&quot; data-start=&quot;3820&quot;&gt;&lt;thead data-end=&quot;3841&quot; data-start=&quot;3820&quot;&gt;&lt;tr data-end=&quot;3841&quot; data-start=&quot;3820&quot;&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;3830&quot; data-start=&quot;3820&quot;&gt;Concept&lt;/th&gt;&lt;th class=&quot;&quot; data-col-size=&quot;sm&quot; data-end=&quot;3841&quot; data-start=&quot;3830&quot;&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;4032&quot; data-start=&quot;3852&quot;&gt;&lt;tr data-end=&quot;3894&quot; data-start=&quot;3852&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3872&quot; data-start=&quot;3852&quot;&gt;Forward propagation&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3894&quot; data-start=&quot;3872&quot;&gt;Compute prediction&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3917&quot; data-start=&quot;3895&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3900&quot; data-start=&quot;3895&quot;&gt;Loss&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3917&quot; data-start=&quot;3900&quot;&gt;Measure error&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3956&quot; data-start=&quot;3918&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3927&quot; data-start=&quot;3918&quot;&gt;Gradient&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3956&quot; data-start=&quot;3927&quot;&gt;Direction to reduce error&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3996&quot; data-start=&quot;3957&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3973&quot; data-start=&quot;3957&quot;&gt;Backpropagation&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3996&quot; data-start=&quot;3973&quot;&gt;Calculate gradients&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4032&quot; data-start=&quot;3997&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4014&quot; data-start=&quot;3997&quot;&gt;Gradient descent&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4032&quot; data-start=&quot;4014&quot;&gt;Update weights&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://computer-science-notes.blogspot.com/2026/03/backpropagation-in-neural-networks.html</link><author>noreply@blogger.com (ITMastersPro)</author></item></channel></rss>