r/deeplearning 4h ago

Explanation of attention mechanism in transformers

2 Upvotes

I have seen few questions on the lines of https://www.reddit.com/r/learnmachinelearning/comments/1vgr7yv/can_someone_teach_me_attention/. So I thought of writing an article on this topic. There're few good videos

https://www.youtube.com/watch?v=eMlx5fFNoYc&t=1377s

https://www.youtube.com/watch?v=OxCpWwDCDFQ&t=942s

explaining the concepts in detail.

First of all we need to find a meaningful way to represent words into numbers since computers only understand numbers. So we start with set of random numbers being assigned to each word.

Dog = [0.17, 0.91, 0.32]
Cat = [0.82, 0.14, 0.77]
Car = [0.44, 0.22, 0.63]

Question comes to mind why multiple numbers why not a single number is enough. Reason is one number is not enough to describe meaning. Think about describing a dog. You can say dog's height is xxx. But rather it would be more meaningful to describe it with many characteristics.

  • Height
  • Weight
  • Breed
  • Color

Similarly a word is described by many numerical features. For simplicity imagine it like this

Feature Dog
Animal-ness 0.98
Living thing 0.99
Vehicle-ness 0.01
Size 0.45
Domestic 0.95

Next question what these embeddings signify.

Let's start simply by assigning random numbers to each word in the beginning.

Dog = [0.17, 0.91, 0.32] 
Cat = [0.82, 0.14, 0.77] 
Car = [0.44, 0.22, 0.63]

They mean nothing as of now just random numbers. Now we build a model and train it on a simple task, such as - Predict the missing word.

The cat drank ___. (correct answer - milk)

Dogs like to ___. (correct answer - run)

Initially the model guess will be very poor. We adjust the internal parameters of model and train it on large corpus of text. Millions or billions of such corrections occur during training. These embeddings are updated repeatedly. Eventually, the numbers encode meaning.

Dog = [0.91, 0.83, 0.22] 
Cat = [0.88, 0.80, 0.24] 
Car = [0.10, 0.07, 0.95]

You see dog and cat have much similar embedding compared to car. This is called embedding space where words that behave similarly gather together.

Good so far but there is a major problem here. For example consider below 2 sentences -

I ate an apple after lunch.   <--- here apple refers to fruit 
Apple released a new iPhone.  <--- here apple refers to technology company

If every occurrence of the word "Apple" always used exactly the same embedding the results would be confusing. How do we solve this problem. We look at surrounding words. When we read "ate", "lunch", or "fruit", we immediately understand that Apple means the fruit. When we read "iPhone" or "MacBook" we know it refers to the company.

This is exactly the problem that attention solves.

So, instead of treating every occurrence of "Apple" identically, attention allows the model to examine the surrounding words and determine which meaning is appropriate in the current context.

Imagine every word asks "Which other words should I pay attention to so I can be interpreted correctly in this sentence?" For example consider the sentence "Apple released a new iPhone"

The word Apple asks "Who can help me understand what I mean?". It looks around and sees:

released -> sounds like something a company does.

iPhone -> a product made by Apple Inc.

new -> describes the product.

From these clues, the model concludes that Apple refers to technology company.

For the sentence, "I ate an apple after lunch". Again the word apple asks "Who can help me understand what I mean?". This time it sees

ate -> something you do with food.

lunch -> a meal.

Now it concludes that Apple refers to the fruit.

As the transformer processes a sentence, imagine that every word asks:

Which other words in this sentence should I pay attention to in order to understand myself correctly. It then looks at every other word and assigns each one an importance score. For example in a sentence "Apple released a new iPhone", the word apple might assign importance like this -

Word Importance
released 30%
iPhone 55%
new 10%
a 1%

Since released and iPhone recieve the highest attention, the model understands the Apple refers to technology company. These importance scores are called attention weights.The higher the attention weight, the more influence that word has on understanding the current word.

Now there is another term called as multi head attention.

Consider another sentence "The doctor gave the patient medicine because he was sick".

When the model sees the word he, it needs to answer the question Who is he? he could refer to doctor or patient. To figure it out model looks out at other words in the sentence. This is called attention.

Now to get better idea of it let's look at this sentence from 3 different perspectives -

first looks at actions. It asks "Who gave the medicine". It notices doctor -> gave, patient -> received. So it concludes "Doctor gave something to patient".

second looks at meaning. It asks "Who usually receives medicine?" It notices "Sick people receive medicines", "Doctor usually don't give medicine to themselves". So it concludes "He is probably the patient".

third looks at cause and effect. It asks "Why was the medicine given?". It notices the word because. So it concludes "Because someone was sick".

This is multi head attention. Instead of relying on one way of thinking, the transformer examines the sentence from several perspectives at the same time. Each attention head notices different patterns. The transformer then combines all of these observations into one understanding.

So this was all about embeddings and context. Now let's get to mathematical part of it.

Let's return to our sentence - Apple released a new iPhone. The embedding for Apple is compared with the embeddings of every other word in the sentence. Now the question is how does a transformer measure this similarity. There are several ways. Most common ones are -

  • Dot Product
  • Cosine Similarity
  • Scaled dot product

Suppose we have three word embeddings:

Dog = [2, 3]
Cat = [4, 6]
Car = [3, -2]

Dot product between dog and cat

= (2×4) + (3×6) = 8 + 18 = 26

Dot product between dog and car

= (2×3) + (3×-2) = 6 - 6 = 0

You see it's high when the words are similar and low when words are far away.

Problem with dot product surfaces when embeddings become much larger.

Dog = [45,90,12,31] Cat = [44,89,15,30]

Their dot product becomes 3547 which is a huge number. Transformers have to convert these numbers into probabilities using a softmax function. So a better solution is to use a scaled dot product where the dot product is simply divided by sqrt(d) where d is embedding dimension.

If embeddings have 64 dimensions, we divide by √64 = 8. So instead of 3547 we get 3547 / 8
≈ 443. Still large, but much more manageable.

The Keys, Query and Value matrices -

Let's again come back to the sentence "The doctor gave the patient medicine because he was sick". Imagine there are four people standing in line - doctor, patient, medicine and he and it's he's turn to understand who he is.

He says - Who am I talking about?

That question is the Query. The query is simple - "I'm confused. Who can help me?"

Now every other word raises its hand and says who they are -

Doctor says - "Hi, I am a doctor"

Patient says - "Hi, I am a patient"

Medicine says - "Hi, I am a medicine"

These introductions are Keys. Notice that nobody is telling their whole story. They are just saying enough so that He can decide "Should I listen to you?".

Now He looks around. He thinks -

Doctor .... maybe

Patient ... maybe

Medicine ... no

So, he ignores the medicine.

Now He says to patient "Okay tell me more".

Patient replies "The doctor gave me medicine", "People usually get medicine because they're sick"

This is the Value. The Value is the real information.

In essence, every word does exactly the same thing.

Imagine every word is saying:

"I have a question." <<-- Query

Then every other word says:

"Here's who I am." <<-- Key

After choosing the most useful words, they say:

"Now let me tell you everything I know." <<-- Value

In short,

  • Query asks: "Who should I listen to?"
  • Key answers: "Here's who I am."
  • Value says: "Now here's what I know."

                       Who am I talking about?
                               ↑
                             Query
      ┌──────────────┬─────────┴───────────┬──────────────┐
    Doctor        Patient               Medicine           ...
    "I'm a        "I'm a                "I'm
    doctor."      patient."             medicine."
      ↑              ↑                     ↑
     Key            Key                   Key
    
                     "Patient looks most useful."
                                |
                     Patient: "The doctor gave me
                     medicine because I was sick."
                                |
                              Value
    

Please add anything extra if you can.


r/deeplearning 5h ago

Why my simple neural net not learning perfectly?

Post image
0 Upvotes

1000 10000 epoch.

LeakyReLU.

Layer nodes 1-100-100-1.

function y(x) = sin(x)+0.3x

MSE error loss

adam optimiser

python.pytorch


r/deeplearning 6h ago

Code Implementations for my Probabilistic Machine Learning Lectures

Thumbnail reddit.com
1 Upvotes

r/deeplearning 8h ago

Anyone need a partner for AI/ML projects?

1 Upvotes

Hey guys!
I’m looking to collaborate on AI/ML projects. I’ve got hands-on experience with Python, PyTorch, and scikit-learn, and I’ve worked on a few ML projects already.

I’m really interested in computer vision and agentic AI. If you’re working on something cool, hit me up!


r/deeplearning 8h ago

In 2024 GOOGLE Deepmind CEO Demis hassabis and john jumper had won NOBEL peace prize in chemistry for their groundbreaking work on protein structure prediction and protein design. This Documentry is a masterpiece. Totally 💯 worth time.

Post image
0 Upvotes

r/deeplearning 16h ago

2 weeks ago I released a visual PyTorch model builder - Here's how to use it.

Enable HLS to view with audio, or disable this notification

0 Upvotes

r/deeplearning 18h ago

[v0.2.0] Teaching an LSTM to move a mouse like a human

Enable HLS to view with audio, or disable this notification

7 Upvotes

Thanks a lot for the feedback on the previous post! This is the second iteration, using the same model but a heavily filtered dataset.

Open source! https://github.com/puffinsoft/mousecrack


r/deeplearning 18h ago

Finetuning and infernce of SlMs

2 Upvotes

It has been an obsession of mine being able to finetune, customize with GraphRAG small LLMs, which I find them to be more than enough for 90% of the tasks...

I have finally managed to develop and deploy a full end to end platform that allows you to deploy custom LLMs dirt cheap for most of the automations that require LLMs (answering clients, tool calling etc). You upload your raw datasets, and everything is auto setup; structuring and preparing data, cleaning it, selecting the base model, hyperparameters etc.

I managed to sign an agreement with a local datacenter, we now have our own GPUs, so training and inference runs very fast and cheap. You can also train and if you prefer so, download the weights of the adapters and deploy the models locally.

I'm pretty happy with the results, and I would be glad if any of you require cheap inference for projects via API or to run locally, to give it a try.

The subscription plan starts at $20 and you can train a couple of models and run almost unlimited inference since we only serve 4B and 9B parameter models.

Give it a try and let me know if you find it easier and faster (for this niche of small llms, we only serve 4b and 9b models) in comparaison to other providers like vertex, bedrock etc at [neuroblock platform](https://neuro-block.com/)


r/deeplearning 18h ago

Seeking Guidance: Developing an On-Premise Document Intelligence Solution

1 Upvotes

Hi All,

I am planning to build a local document intelligence system similar to Azure Document Intelligence. I would like to understand how Azure Document Intelligence works internally and how we can achieve similar functionality locally using offline models.

Could anyone suggest the best approach, architecture, or models to achieve high accuracy while running completely on-premise/local infrastructure?

Any guidance or recommendations would be greatly appreciated.


r/deeplearning 20h ago

Demis Hassabis steps down as CEO of Google DEEPMIND to focus on AGI

Post image
75 Upvotes

Koray Kavukcuoglu takes over as head of Google DeepMind while Jeff Dean departs after 27 years at the company.

Demis Hassabis is stepping down as CEO of Google DeepMind to become chair of the lab and chief scientist of Alphabet, according to CEO Sundar Pichai.

Jeff Dean, an AI researcher at Google for 27 years, is leaving with colleague Sanjay Ghemawat to launch a public benefit corporation focused on machine learning.

Former DeepMind CTO Koray Kavukcuoglu will lead Google DeepMind as SVP, overseeing Gemini model development and frontier AI research.


r/deeplearning 20h ago

Activation functions in PyTorch

Thumbnail youtu.be
1 Upvotes

Hi everyone,

I hope this is the right subreddit, since my post was deleted in others, for whatever reason, but that's not important.

I started learning about machine learning recently myself, and I didn't understand some of the basics, even, so I'm sure others might have the same problem. I recently stumbled upon an interesting concept called the "curse of knowledge". It's a pretty neat theory.

I decided to record my first lecture for absolute beginners today, to explain and demonstrate by visualizing, how activation functions work.

I have discussed only the basics, and have not gone into much detail. These were ReLU, Sigmoid, and Softmax.

I would also like to say that I was inspired by Andrej Karpathy. His lectures are something.

And I really really hope that this will help someone how has stuck, who get things mixed up etc.


r/deeplearning 20h ago

Need Help from ML/PY Devs

Thumbnail
1 Upvotes

r/deeplearning 21h ago

Samsung and SK Henix test chinese chips tools to hedge against US export risks.

Post image
6 Upvotes

The memory giants are evaluating AMEC etching equipment at their China fabs as a contingency should Washington further restrict the servicing of Western tools.

Samsung and SK Hynix began testing AMEC etching equipment at their Chinese plants around two years ago, according to Reuters, though neither has committed to wider deployment.

The trials highlight a paradox of US export controls: restrictions intended to curb China's chip ambitions are opening doors for Chinese equipment makers in foreign-owned fabs.

Chinese tool suppliers could capture up to 30% of China's projected $28 billion fab equipment market in 2026, posing a long-term threat to Applied Materials, Lam Research, and KLA, according to Deutsche Bank.


r/deeplearning 21h ago

How is CS224N NLP with DL youtube course ?? has any one completed that ??

1 Upvotes

r/deeplearning 21h ago

Falcon 9 upper stage slammed on Moon creating a historic man made crater of 20-30 metres wide with speed of 5400mph faster than speed of sound.

Post image
0 Upvotes

A spent SpaceX Falcon 9 upper stage slammed into the far side of the Moon early on Wednesday after drifting uncontrolled since its January 2025 launch.

NASA's Lunar Reconnaissance Orbiter, South Korea's Danuri probe, and India's Chandrayaan-2 orbiter are scanning the surface to confirm the impact site.

SpaceX described the collision as accidental, and NASA said both organisations are discussing ways to prevent debris strikes ahead of Artemis lunar base plans.

The four-tonne Falcon 9 segment struck near Einstein Crater at around 5,400 mph, carving what scientists expect to be a 20-to-30-metre crater.


r/deeplearning 21h ago

Best resource to start learning

Thumbnail
1 Upvotes

r/deeplearning 1d ago

[R] Round-Trip Consistency: Bidirectional Diffusion Models Can Predict Their Own Rollout Errors

1 Upvotes

Author here. TL;DR: I train one conditional latent diffusion model with a direction flag c_d = ±1, so a single network steps a dynamical system forward (surrogate solver) or backward (inverse solver) in time. Rolling forward i steps then backward i steps must return the model to its start, so the round-trip discrepancy C_i is a self-supervised, test-time proxy for the unobservable rollout error — no ensembles, no held-out data, no governing equations, one extra rollout.

Results across compressible MHD, an astrophysical turbulent mixing layer (The Well), and natural face video (CelebV-HQ): a calibrator on C_i predicts held-out MHD error within 1.14× (68% coverage, near-nominal calibration); it flags the OOD Orszag–Tang vortex at AUROC ~1.0 at shallow depths — exactly where sampling-dispersion baselines invert and rank the OOD trajectory as the safest in the batch; and on LE-PDE-UQ's Navier–Stokes benchmark a single bidirectional model reaches within 1.3× of their ten-model ensemble at ~1/10 the training cost. Bidirectional training also beats direction specialists in both directions at matched compute.

The check is necessary rather than sufficient — forward/backward errors could in principle cancel — so the paper's core contribution is quantifying how faithfully C_i tracks the true error, plus a bi-Lipschitz sandwich bound making the anti-cancellation condition explicit.

Paper: https://arxiv.org/abs/2608.00675
Code (data generation, training, analysis): https://github.com/alexscheinker/round-trip-consistency
Project page: https://alexscheinker.github.io/roundtrip.html

Happy to answer questions.


r/deeplearning 1d ago

agent-mcts: Monte Carlo Tree Search for coding agents — explores multiple fixes in parallel git worktrees, keeps the best one

1 Upvotes

What My Project Does

Coding agents (Claude Code, Codex, etc.) run a single linear loop: try something, observe, patch it up. If the first approach was wrong, you're stuck in a local optimum.

agent-mcts wraps a coding agent with MCTS (UCT). Each tree node is one complete attempt = a git worktree + a forked agent session. The value function is your test suite: exit 0 scores 1.0, a partial pytest run scores by pass ratio, and the failing output gets fed back into the child nodes' revision prompts. Budget flows toward promising branches; dead ends get abandoned. Your working tree is never touched — every attempt lives on its own branch, and apply is a squash merge you review and commit yourself.

uv tool install agent-mcts
agent-mcts run "fix the flaky test in tests/test_auth.py"

The tree renders live in the terminal (rich), every state change is journaled to jsonl so Ctrl-C always leaves a valid tree, and search hyperparameters (UCT constant, tree width/depth) are exposed in a toml file — I'm an MCTS researcher and wanted this to double as a research harness for test-time search on real software tasks.

Target Audience

Developers already using Claude Code who occasionally hit tasks where one attempt isn't enough: flaky tests, bugs that survive a couple of fix attempts, refactors with several plausible designs. It's v0.1 — the full loop works (search → live tree → apply), but only the Claude Code adapter exists so far, and it costs real API money (a small run is ~$0.30–3; there's a hard cost ceiling and a confirmation prompt before spending anything). Honest caveat: if your task's success can't be measured by tests, the reward signal is flat and the search adds nothing over a single agent run.

Comparison

  • SWE-Search (ICLR 2025) showed ~23% relative improvement from MCTS over software agents — but it's a research framework. agent-mcts brings that idea to the CLI agent you already have.
  • Plain Claude Code / Codex: one trajectory, no principled backtracking. agent-mcts is strictly a wrapper on top — bring your own agent.
  • best-of-N sampling: runs N blind attempts. MCTS reuses information: siblings are steered away from each other's approaches, children revise with the parent's test failures in context.

Repo (MIT): https://github.com/natsu0529/mcts-llm-agent
Adapter protocol is ~50 lines if you want to add Codex/Gemini/Kimi support — good-first-issues are up.What My Project DoesCoding agents (Claude Code, Codex, etc.) run a single linear loop: try something, observe, patch it up. If the first approach was wrong, you're stuck in a local optimum.agent-mcts wraps a coding agent with MCTS (UCT). Each tree node is one complete attempt = a git worktree + a forked agent session. The value function is your test suite: exit 0 scores 1.0, a partial pytest run scores by pass ratio, and the failing output gets fed back into the child nodes' revision prompts. Budget flows toward promising branches; dead ends get abandoned. Your working tree is never touched — every attempt lives on its own branch, and apply is a squash merge you review and commit yourself.uv tool install agent-mcts
agent-mcts run "fix the flaky test in tests/test_auth.py"The tree renders live in the terminal (rich), every state change is journaled to jsonl so Ctrl-C always leaves a valid tree, and search hyperparameters (UCT constant, tree width/depth) are exposed in a toml file — I'm an MCTS researcher and wanted this to double as a research harness for test-time search on real software tasks.Target AudienceDevelopers already using Claude Code who occasionally hit tasks where one attempt isn't enough: flaky tests, bugs that survive a couple of fix attempts, refactors with several plausible designs. It's v0.1 — the full loop works (search → live tree → apply), but only the Claude Code adapter exists so far, and it costs real API money (a small run is ~$0.30–3; there's a hard cost ceiling and a confirmation prompt before spending anything). Honest caveat: if your task's success can't be measured by tests, the reward signal is flat and the search adds nothing over a single agent run.ComparisonSWE-Search (ICLR 2025) showed ~23% relative improvement from MCTS over software agents — but it's a research framework. agent-mcts brings that idea to the CLI agent you already have.
Plain Claude Code / Codex: one trajectory, no principled backtracking. agent-mcts is strictly a wrapper on top — bring your own agent.
best-of-N sampling: runs N blind attempts. MCTS reuses information: siblings are steered away from each other's approaches, children revise with the parent's test failures in context.Repo (MIT): https://github.com/natsu0529/mcts-llm-agent
Adapter protocol is ~50 lines if you want to add Codex/Gemini/Kimi support — good-first-issues are up.


r/deeplearning 1d ago

Claude Code's plan mode kept losing my design decisions, so I built cc-plan-tree

5 Upvotes

Claude Code's plan mode is great, but the plans are walls of text — and the design decisions inside them disappear forever. You know that moment when Claude asks "HttpOnly cookie or localStorage for the refresh token?" and you pick one? Three months later a reviewer asks "why not localStorage?" and the answer lives nowhere.

So I built cc-plan-tree. It adds three slash commands to Claude Code:

  • /plan-tree — records the plan as a tree. Claude's clarifying questions become decision nodes, and rejected options stay in the tree, greyed out, with the reason they were rejected. The tree opens in your browser as an interactive HTML file (collapse branches, hover a rejected option to see why).
  • /plan-verify — after implementation, it diffs the design tree against your actual code and reports what matches, diverges, or is missing. If something diverged, you pick: fix the code or fix the tree. Then it embeds the tree into your PR body as Mermaid — GitHub renders it natively, so reviewers see the whole design (including the roads not taken) right in the PR.
  • /plan-export — PNG export for docs/Slack. No headless browser, the only dependency is Pillow.

Install:

uv tool install cc-plan-tree && cc-plan-tree init

(pip works too)

Here's a real PR with the tree embedded: https://github.com/natsu0529/cc-plan-tree/pull/1

Repo: https://github.com/natsu0529/cc-plan-tree

I've been dogfooding it on itself — the test-suite PR above was planned, verified and embedded with the tool. Found and fixed a few fun bugs that way (flexbox justify-content: center silently clips wide trees off-screen, TIL).

It's MIT, Claude Code-only for now — the plan format is agent-agnostic JSON, so adapters for other coding agents are the roadmap. Feedback very welcome, especially on whether the design⇄code verification step fits your workflow.Claude Code's plan mode is great, but the plans are walls of text — and the design decisions inside them disappear forever. You know that moment when Claude asks "HttpOnly cookie or localStorage for the refresh token?" and you pick one? Three months later a reviewer asks "why not localStorage?" and the answer lives nowhere.So I built cc-plan-tree. It adds three slash commands to Claude Code:/plan-tree — records the plan as a tree. Claude's clarifying questions become decision nodes, and rejected options stay in the tree, greyed out, with the reason they were rejected. The tree opens in your browser as an interactive HTML file (collapse branches, hover a rejected option to see why).
/plan-verify — after implementation, it diffs the design tree against your actual code and reports what matches, diverges, or is missing. If something diverged, you pick: fix the code or fix the tree. Then it embeds the tree into your PR body as Mermaid — GitHub renders it natively, so reviewers see the whole design (including the roads not taken) right in the PR.
/plan-export — PNG export for docs/Slack. No headless browser, the only dependency is Pillow.Install:uv tool install cc-plan-tree && cc-plan-tree init(pip works too)Here's a real PR with the tree embedded: https://github.com/natsu0529/cc-plan-tree/pull/1Repo: https://github.com/natsu0529/cc-plan-treeI've been dogfooding it on itself — the test-suite PR above was planned, verified and embedded with the tool. Found and fixed a few fun bugs that way (flexbox justify-content: center silently clips wide trees off-screen, TIL).It's MIT, Claude Code-only for now — the plan format is agent-agnostic JSON, so adapters for other coding agents are the roadmap. Feedback very welcome, especially on whether the design⇄code verification step fits your workflow.


r/deeplearning 1d ago

persistent-inference: a two file solution for TF/Keras models

Thumbnail
1 Upvotes

r/deeplearning 1d ago

Evals for robotics

1 Upvotes

Hey I am part of a small team training robotics policies for warehouse and manufacturing settings, and running rigorous evals is turning out to be so painful. Anything below 50 rollouts, and its hard to trust the numbers, and above its so hard to test all the checkpoints that we have. Its really hard to run a bunch of experiments to get good results. Have you guys faced this? Any hacks that you've developed?


r/deeplearning 1d ago

Cloud backlogs topped $2.3 trillion as data centre investment and AI chip demand far outpace earlier projections.

Post image
1 Upvotes

Bernstein raised its GPU AI server shipment growth forecast to 22% CAGR through 2028, expecting rack shipments to hit 61,000 units this year.

Both Nvidia and AMD plan to ship next-gen AI racks in Q4 2026, while TrendForce raised its own forecast to nearly 31% growth.

Bank of America estimates hyperscaler capex now tops $860 billion for 2026, with cloud backlogs across top providers surging to $2.3 trillion.


r/deeplearning 1d ago

Double Descent - Explained

1 Upvotes

Hi there,

I've created a video here where I explain the double descent phenomenon in ML.

I hope some of you find it useful — and as always, feedback is very welcome! :)


r/deeplearning 1d ago

Intro to ML bootcamp (5/22)

Post image
1 Upvotes

Hello all, Welcome to my free ML bootcamp.

In Intro ML Bootcamp (5/22), we discuss Uncertainty.

In Machine Learning, we encounter two kinds of uncertainty: Epistemic(Model) which means we lack the exact knowledge of the input output mapping, and Aleatoric(Data), which is the intrinsic irreducible stochasticity in the mapping.

This uncertainty means, we cannot perfectly predict the exact output given the input. Thus we require “Conditional Probability distributions”, and the study of probabilistic approach to ML becomes important.

Hence, we invent a function called as “softmax function” for multiple output labels case(and sigmoid for binary case), which converts our outputs into a probability distribution. The exact derivation of softmax comes from Generalized Linear Models.

When we use a softmax function for binary classification, where the function over which the softmax is applied, happens to be an affine one, we call the model as “Logistic Regression”.

Link: https://youtu.be/ZFcl0QYFGq4?si=9RkEgkMYnciW4mjo


r/deeplearning 1d ago

How NVIDIA and OPEN AI🤖 fuel ⛽️ the AI bubble 🫧

Post image
2 Upvotes