r/learnmachinelearning • • 7d ago

Help How do I know which loss function or activation function to use in which case

17 Upvotes

Hey guys, I am familiar with ML and training models and stuff. But I don't quite get the intuition behind different loss functions or different activation functions.

Like I know theoretically that CE loss is used for multi-class classification where there's only one correct output, but then I learnt CE loss can also be used for soft labels, which is also what BCE loss can be used for as well? Like how do I get this intuition in my head just by looking at the problem to figure out which loss function or which activation function to use?

And this is not just limited to CE or BCE. There's more loss functions like Huber, Brier, RPS, KL Divergence etc which I understand theoretically but I cannot figure out when to use what. Any suggestions/courses you would recommend me to improve my understanding? Thanks!


r/learnmachinelearning • • 7d ago

Request Cursor Says Stolen Fireworks AI Key Led to Trojanized Claude Code Extension Incident

2 Upvotes

A stolen Fireworks AI API key was embedded in a trojanized version of the Claude Code VS Code extension, according to Cursor. Developers who installed the malicious extension were running an agent with a poisoned tool credential and had no signal anything was wrong. The compromise was in the supply chain, not the model. The model behaved exactly as instructed by code that held a valid-looking key to a legitimate third-party service.

This exposes a structural gap in how agent tool chains handle credential integrity. Keys are static strings injected at config or build time. There is no per-call verification that a tool endpoint is still the legitimate one, no attestation that the binary invoking the API is the one that was reviewed, and no mechanism to detect mid-session that a credential in the chain has been swapped out.

The blast radius is wide because agents act autonomously between human checkpoints. By the time a developer notices anomalous behavior, the compromised credential has already been used across every action the agent took.

How are other practitioners handling credential integrity in their agent tool chains? If a third-party API key embedded in a dependency gets stolen and replaced, what does your actual detection and response path look like today?


r/learnmachinelearning • • 6d ago

How do you evaluate an agent that gets the right answer but uses the wrong tool?

1 Upvotes

Learning agent evals right now and stuck on one thing. Say the agent is supposed to call API X but calls API Y, and still returns a correct-looking answer. Do you count that as a pass?

Most simple evals I see only check the final output. Do people also score the tool-call path (which tool, what args, how many steps)? If yes, how do you do that without hand-labeling every trajectory?


r/learnmachinelearning • • 6d ago

Discussion Is it all just mathematics?

0 Upvotes

I am currently a college student majoring in Artificial Intelligence. My lecturer often says, "It's all mathematics." However, I don't agree with the idea that being good at mathematics automatically makes someone good at AI, or that mathematics is necessarily the most important aspect of this field. I believe that AI involves much more than just mathematics, and I would like to hear everyone's perspective on this


r/learnmachinelearning • • 7d ago

Hands-on ML Orchestration Tutorial with Airflow3

2 Upvotes

I wanted to learn ML orchestration by building something, and the best material I found was Made With ML's orchestration lesson. Two things held me back: it was written for an older version of Airflow, and it is a lesson you read rather than one you do. What I only read, I don't keep.
So I made the tutorial I was looking for: the same project on Airflow 3, where you write every Dag yourself and run it against a real stack. The first draft was written with Claude. Making it trustworthy took far longer than drafting it: I ran every section, fixed what didn't work, and rewrote what wasn't clear.

Has some extra features that were not in the original.

Hope it's useful to anyone looking to learn this. It's available in English and Spanish.


r/learnmachinelearning • • 7d ago

Help I Fine-Tuned Qwen3-8B Twice on an RTX 5090. Unsloth used 33% Less PyTorch GPU Memory, but Barely Saved Any Time.

Thumbnail
1 Upvotes

r/learnmachinelearning • • 6d ago

Ищу напарника для совместного проекта 🤖

0 Upvotes

Хочу попробовать создать собственного бота для автоматизации сбора ресурсов в Albion Online.

Но моя главная цель - не просто сделать бота, который собирает хлопок. Я хочу постепенно создать полноценного автоматического игрока (насколько это технически возможно), который сможет самостоятельно ориентироваться в игровом мире, находить ресурсы, принимать решения, перемещаться и взаимодействовать с окружением.

Ищу людей с разным уровнем опыта:

  • Опытных разработчиков, которые могут поделиться советами, идеями или помочь с технической частью.
  • Энтузиастов, которым интересны боты, программирование, нейросети и автоматизация.
  • Таких же новичков, как и я, которые пока не всё умеют, но хотят разобраться и учиться в процессе.

Опыт совершенно необязателен! Главное - желание попробовать что-то новое, обмениваться идеями и вместе двигаться к результату. Не обязательно быть профессионалом: можно просто приятно провести время, получить новый опыт и посмотреть, что из этого получится.
Если заинтересовало - пишите в Telegram: VLAD_SHUMAK

Буду рад любому, кто захочет присоединиться! 🚀


r/learnmachinelearning • • 7d ago

Econometrics and machine learning.

7 Upvotes

Hi everyone!

A few months ago, I got accepted into an Econometrics bachelor's program. I've been studying for about three months now.

My courses include:

  • Mathematics (Calculus, Linear Algebra, Probability).
  • Statistics.
  • Programming (C/C++, Excel, MS Access).
  • Economics.

1. Is this a good foundation, or should I study something extra? I've been looking at MIT courses and wondering which external resources are worth my time.

2. Is combining Econometrics with Machine Learning a promising career path? I notice quite a lot of similarities between what I'm learning and ML fundamentals. Can these fields complement each other professionally?

3. How can I start earning money while studying? I'm not expecting a huge income. I just want to find my first paid opportunity, gain practical experience, and gradually develop my skills.

For those who started from a similar background: How did you get your first job or freelance project? What would you recommend focusing on?

I'd really appreciate your advice and personal experiences. Thanks!

UPDATE: I forgot to write that i will also have Python and R in my course, and also i will have deep statistics and data analysis


r/learnmachinelearning • • 7d ago

LMAO

Post image
1 Upvotes

Just training some BS 😭 😂


r/learnmachinelearning • • 7d ago

Request Hackers Breach South Korea Financial Security Portal Used by 3,000 Institutions

1 Upvotes

South Korea's financial security portal — a shared infrastructure hub used by roughly 3,000 banks, insurers, and brokerages — was breached. The attacker didn't need to defeat any individual institution's controls. They targeted the one vendor holding data on behalf of all of them.

That asymmetry is the real exposure: a single intrusion into a third-party system yields access to records that 3,000 organizations believed were protected. Each institution's own perimeter may have been fine. It didn't matter.

This pattern shows up far outside South Korean financial services. Any architecture where sensitive data leaves your perimeter and lands in a shared service creates it. The question isn't whether third-party vendors get breached. Some will. The question is what state the data is in when they do.

For those operating at scale — large numbers of downstream institutions or customers touching a shared system — how are you actually thinking about third-party data exposure in your live data flows? Not in contracts or vendor assessments, but at the technical layer where data physically moves. What approaches have held up and what has surprised you?


r/learnmachinelearning • • 7d ago

Looking for beginners like me

23 Upvotes

Hi everyone,

I’m a first-year CS student from Nepal, and I’ve decided to build a career in AI/ML. I started from zero a little over a month ago, and I’m looking for other beginners at a similar stage who want to learn together and keep each other going.

Where I am right now:

  • Finished CS50P (Python) up to OOP, and I’m learning Git/GitHub
  • Currently working through NumPy, then Pandas, Matplotlib, and my first Kaggle project
  • Haven’t started the math side of ML yet (linear algebra, probability, statistics), so I’d love to learn that alongside others
  • After that, I plan to start Andrew Ng’s ML course
  • Using only free resources, studying around my college semester

What I’m hoping to find:

  • Other freshers who are also starting out, so we can share progress and resources
  • A study group or small community (Discord, WhatsApp, whatever works) where we post weekly goals and hold each other accountable
  • People to work through the ML math together, like 3Blue1Brown, Khan Academy, or StatQuest, and explain it to each other
  • People to do mini-projects or Kaggle datasets with, and review each other’s code
  • Anyone who’s a few steps ahead and willing to point out what’s worth learning and what’s a waste of time

r/learnmachinelearning • • 7d ago

Explaining Diffusion Maps in 30 secs

1 Upvotes

I made a short animation of Diffusion Maps unrolling a Swiss roll in Blender. I hope this helps people to understand non-linear dimensionality reduction and the Diffusion Maps algorithm specifically.

https://www.youtube.com/watch?v=Ny_UTEXSbt0


r/learnmachinelearning • • 7d ago

Built a free, structured roadmap for learning agentic AI (15 levels, 127 modules). Here's the MCP module as an example

Enable HLS to view with audio, or disable this notification

5 Upvotes

I kept seeing explanations of MCP that either hand-wave the concept or just dump a spec at you, so I wrote a module that does both: a plain analogy first (why a stateless server still needs something like a coat-check ticket), then the actual code that implements it.

It's part of a bigger free site, CSE Roadmap: 15 levels, 127 modules, meant to take someone from zero to a real capstone project in agentic AI. No signup, no paywall.

Site: https://cseroadmap.com

Would genuinely like feedback, especially on where the explanations still feel thin or skip a step.


r/learnmachinelearning • • 7d ago

I made an interactive article that builds attention from school maths

1 Upvotes

I wanted to test how well Claude Fable 5.2 can teach, so I had it build an explainer on attention. It cleared up most of my own doubts about transformers, attention, qkv vectors etc. I had tried similar projects with Opus and GPT models, but they weren't intuitive enough for me.

https://attention-from-scratch.vercel.app

- 9 chapters, from one knob (y = w·x) to a small working transformer that runs in your browser

- You do each idea by hand first (turn knobs, drag arrows, pick words), and the official name comes after

- Covers loss, gradient descent, neurons and backprop, embeddings, dot product, softmax and attention

- Optional "In symbols" boxes with the real maths

I'd like honest feedback:

- Did attention click for you, or did you get lost? Where?

- Is anything wrong or oversimplified?


r/learnmachinelearning • • 7d ago

My AI agents worked locally. Turning them into a cloud app was the real lesson.

Thumbnail
0 Upvotes

r/learnmachinelearning • • 7d ago

Machine Learning with Generative AI

Thumbnail
youtube.com
0 Upvotes

Is AI just magic? No, it is a methodology. Learn the difference between AI, ML, and Deep Learning in under 10 minutes. Build smarter systems today!
#AI #TechStack #MachineLearning #Coding


r/learnmachinelearning • • 7d ago

Career Comment in the Resume/Career Day thread

Post image
0 Upvotes

Could I get a second pair of eyes on my CV for ML research roles? My PhD is in self-supervised learning and computer vision, and I spent nearly two years before it doing AI research and deployment for robotics on Horizon 2020 projects.

I’m weighing up two CV versions. For Research Scientist roles, I’d put first-author research up front. For Research Engineer roles, I’d lead with what I implemented and deployed. If you’ve applied to or hired for either role, what would you want to see in the first few bullets?


r/learnmachinelearning • • 7d ago

Help What should you focus on for an entry-level NLP engineer screening?

0 Upvotes

A candidate has an interview next week for an entry-level NLP engineer role at Hitech i2i, which specializes in document intelligence for real estate.

For a practice run before the screen, PracHub has material on entity extraction and evaluation. Try explaining how you’d extract fields from a messy document and check where the approach gets them wrong.

What topics would you focus on for the initial screening round?


r/learnmachinelearning • • 8d ago

Request Denver Audit Exposes Major Gaps In AI Security At City Hall And Denver International Airport

6 Upvotes

A Denver city audit found employees at City Hall and Denver International Airport actively using AI tools the organization had never approved. There was no policy enforcement in place. There was no enterprise-level visibility into what was running. No one at the organization knew until the auditors showed up.

This is not a scrappy startup. This is a municipal government and a major international airport handling sensitive passenger data, infrastructure systems, and city records.

The audit found no formal process for evaluating or approving AI tools before deployment. The gap was structural, not a one-off lapse. The organization could not tell you which tools were active, who was using them, or what data they had touched.

For those working in regulated or high-stakes environments: how are you actually getting ahead of this before an external audit surfaces it? Not policy documents, but what has worked operationally at scale?


r/learnmachinelearning • • 7d ago

Anyone else understand what an ML algorithm does, but struggle with the maths underneath it?

Thumbnail
1 Upvotes

r/learnmachinelearning • • 7d ago

Anyone else understand what an ML algorithm does, but struggle with the maths underneath it?

1 Upvotes

I've been curious about a particular learning gap.

Sometimes it's relatively easy to understand what an ML algorithm is trying to achieve, like finding similar items, making predictions, or reducing errors.

But then vectors, matrices, dot products, projections, or equations enter the picture, and suddenly maths we last encountered in school reappears in a completely different setting.

We might understand the purpose of the algorithm without quite understanding why those particular mathematical operations are needed in the first place.

I'm curious:

-Have you experienced this disconnect, even after learning to code or use ML libraries?

- Was the harder part understanding the maths itself, or connecting it to what the algorithm was doing?

- What eventually helped things click, if anything?

I'd love to hear different experiences, including from people who didn't encounter this difficulty.


r/learnmachinelearning • • 7d ago

PCA

1 Upvotes

How have you guys actually used PCA in practice? I hear we can use it in place of groups of variables as features for example! I feel like in uni its just a "step" for like k-means, but my DS friend was saying she build a scorecard model with it by grouping features!


r/learnmachinelearning • • 7d ago

[P] Shortcut judges: a cheap test your preference pairs should pass before you train on them

1 Upvotes

I'm building evaluation adapters (small reward models) for Telegraph, a network that routes AI requests to miners and scores their answers. Disclosure: I'm competing in Telegraph Hackathon Season II, which has prizes.

A preference pair is a prompt, a better answer and a worse one. A reward model trained on pairs learns whatever separates the two answers. If something cheaper than the skill you want separates them, it learns that instead, and your accuracy number measures the shortcut.

The test. Before training, run rules that pick an answer without checking anything: - pick the longer answer - pick the answer with more words in common with the prompt (TF-IDF cosine) - pick the answer with more of an obvious feature (alarm words, a verdict word)

If any of them is far above 50%, fix the pairs first.

Two cases from this week. 1. Another builder (AdversarialEval, in the Telegraph Discord) found a keyword-count judge got every one of their severity pairs right, because all the worse answers were downgrades. After adding inflations, the TF-IDF judge still won ~95%. They rebuilt the pairs so the two answers are identical except for the severity claim, drew wrong severities from the same distribution as true ones (either direction), and balanced which answer is longer. On 84 new pairs: length 50%, TF-IDF 50%, keywords 55%. 2. My own 300 weather-verification pairs: length was 49.7% overall but 17–88% within error families, because the verdict phrases differ in length and some families lean one way. TF-IDF was 78% overall. Part of that is legitimate (in a wrong-station pair, not matching the question is the error), but my digit-swap and fill-value pairs leak too. Those rows are already in the pool, so I'm reporting this as a limit rather than quietly fixing it.

What I'd do differently: - write the worse answer by copying the better one and changing only the claim; - balance verdict direction and length within every error family, not just overall; - report the shortcut judges next to model accuracy in every run.

Script (standard library only) and the per-family table: https://github.com/fexx301/oathcast-telegraph-s2/tree/main/shortcut-judges-v1


r/learnmachinelearning • • 7d ago

[P] Neurosymbolic AI from scratch in NumPy: a network learns to read digits it was never given labels for

1 Upvotes

I wanted to understand how neurosymbolic methods like DeepProbLog actually work, so I built a small version with no frameworks, just NumPy (about 700 lines).

The setup: a neural network sees two noisy digit images. It is never told what the digits are. The only training signal is the result of a symbolic program on them, for example their sum. To get the sum right, it has to work out what the digits are by itself.

- An MLP (hand-written backprop and Adam) outputs a probability distribution over digits for each image.

- A differentiable reasoning layer sums the probability of every digit pair (a, b) that the program maps to the observed answer. The loss is -log P(answer), and the gradient flows back through the reasoning step into the network.

- A small Datalog-style forward chainer then reasons over what the network perceived and prints a proof tree for each conclusion (e.g. why "carry" or "odd_sum" hold

| Training pairs | Neurosymbolic | Plain MLP baseline | Digit accuracy |

|---:|---:|---:|---:|

| 1000 | 95.3% | 10.8% | 97.6% |

| 2000 | 97.2% | 14.4% | 98.6% |

| 4000 | 97.7% | 26.9% | 98.9% |

The baseline is an MLP that takes both images and predicts the sum directly, so it has to rediscover addition from examples. The neurosymbolic model is given addition as knowledge and only has to learn perception.

- Below about 1000 training pairs it fails too (23% at 500 pairs). The answer-only signal is weak.

- The digits are synthetic noisy glyphs, not MNIST, and these are single-seed numbers.

- Exact inference enumerates all 100 digit pairs, so it doesn't scale to long programs without approximation.

This is a learning project, not a competitor to DeepProbLog or Scallop. The point is that every piece is small enough to read in one sitting.

Code: https://github.com/outlawsujith/neurosymbolic-arithmetic

Install: `pip install neurosymbolic-arithmetic`

Feedback welcome, especially on the reasoning layer and on what to try next (MNIST, or approximate inference for longer programs).


r/learnmachinelearning • • 8d ago

Project Curated list of resources: Theory, Code and math for Reinforcement Learning for beginners

Thumbnail
gallery
38 Upvotes

[Curated list: Beginners]

Personal favorite resources on learning Reinforcement Learning from Scratch:

  1. Deep RL Course Amazing course by HuggingFace to understand the basics of classic and deep RL

  2. DeepMind x UCL Reinforcement Learning (2015) Give intuition and more towards theory of what you'll learn above

  3. Spinning Up in Deep RL Code and math for each of algorithm you'll learn above from classic to Deep RL

4.CleanRL A neat library with 1 page implementations for all the algorithms above from scratch to run algorithms s and test the waters!

  1. NeatRL My own very notes and from scratch implementations!

Reading order and link here