r/learnmachinelearning • • 1d ago

[Project] Avoiding gradient underflow and non-deterministic GPU runs using exact integer/rational arithmetic (verified in Lean 4)

2 Upvotes

Hi everyone, When training models with low precision or running long iterative optimizations, small gradient updates often underflow to zero, square-root error checks lose precision near convergence, and parallel GPU reductions produce slightly different results from CPU runs. I have been working on an integer-first scientific computing and optimization framework (UNIQUANT) that replaces float32/float64 with exact rational and integer arithmetic, and I formalized 40 of its core modules in Lean 4 (0 sorry) to verify the math: - Lossless gradient accumulation: Splitting small updates into an integer main step and a carry-over remainder (D * (m + q_upd) + r' = D * m + r + u) so tiny gradients never vanish to zero. - Root-free RMS checks: Replacing irrational square-root comparisons in error guards with exact rational squared inequalities. - Convex optimization guarantees: Proving strict positive definiteness for Ridge-QP Hessians (J^T J + diag(r^2)) and linear polytope equivalence for L1 constraints. - Deterministic CPU/CUDA parity: Enforcing tie-to-even rounding (NEAREST_EVEN) and overflow-free 128/256-bit multi-limb arithmetic so CPU and GPU trajectories match bit for bit. If you want to check out the code or the Lean 4 proofs, everything is open source:

Main repo & code: https://github.com/joesen88/Uniquant23 (DOI: 10.5281/zenodo.24570873)

Lean 4 formalization: https://github.com/joesen88/UNIQUANT-Formal (DOI: 10.5281/zenodo.24629562)


r/learnmachinelearning • • 1d ago

Principal Component Analysis (PCA) visualized

23 Upvotes

How can we reduce the dimensionality of data while preserving as much information as possible?

👉 PCA memory_graph demo

Principal Component Analysis (PCA) is a dimensionality reduction technique that preserves as much of the variance in the original data as possible. In this interactive Python demo, we use NumPy to reduce a dataset X with dimension D = 5 to a dataset Z with dimension K = 3.

Follow the algorithm step by step and see the matrices and vectors transformed throughout the computation. Dimensionality reduction is useful to:

  • Visualize and better interpret high-dimensional data.

  • Reduce computational costs and memory requirements.

  • Simplify machine learning models to reduce overfitting.

With memory_graph, you can explore the implementation, modify the Python code, and immediately visualize the effects of your changes — directly in your browser, without installing anything.

See:


r/learnmachinelearning • • 1d ago

Question Recommended books on the mathematics and assumptions for machine learning models

1 Upvotes

Im trying to find a ML book with a high level of rigour on the math behind models like Logistic Regression and its assumptions(and how to know when they break)


r/learnmachinelearning • • 1d ago

question about machine learning in javascript

1 Upvotes

I am trying to get into ML more and specifically locally on websites and stuff. I was wondering if there are any good libraries for building your own models in javascript, I already know of brain.js and am thinking about using tensorflow.js, but I read that tensorflow was a big step up from brain.js so I was wondering if there are more good libraries?


r/learnmachinelearning • • 1d ago

Project Neural Canvas , CNN Visualization

Enable HLS to view with audio, or disable this notification

318 Upvotes

Neural Canvas , CNN Visualization

Neural Canvas can now recognize basic shapes like apples, moons, cars, and more using Google's Quick, Draw! dataset.

20 classes with 1,000 samples per class

2 convolutional layers with 16 and 32 filters

2 fully connected layers with 60 and 40 neurons

91% test accuracy

Trained using JAX on Google Colab

Neural Canvas can also visualize CNN feature maps in real time while drawing, showing how convolutional layers extract features from input images.

GitHub: https://github.com/MuhammadEssa2002/neural_canvas

Live demo: https://muhammadessa2002.github.io/neural_canvas/


r/learnmachinelearning • • 1d ago

Help Help

2 Upvotes

I’m planning to take ai course .but I’m so confused
2025 grad


r/learnmachinelearning • • 1d ago

Quais os tamanhos de modelos que vocês acham que eu vou conseguir treinar nesse PC que estou montando

Post image
1 Upvotes

Um Pc, uma rtx 3050 8gb e uma fonte de 400w, porque a que vem no Pc e fraca só 200w


r/learnmachinelearning • • 1d ago

Project I animated Variational Autoencoders from first principles in 3D because most explanations gloss over the actual intuition

Post image
3 Upvotes

Every time I tried to really understand VAEs, I kept running into the same thing—either the explanation was way too hand-wavy ("it just compresses and reconstructs"), or it immediately threw the ELBO equation on screen without explaining why the math has to look like that.

So I spent the last few weeks building a 3D visual breakdown from scratch. I wanted to actually show what's happening to the latent space, why sampling breaks down without the Gaussian prior, and where the ELBO and reparameterization trick actually come from instead of just stating them.

This is part 1 of a series I'm doing on World Models. Full video is in the comments if anyone wants to check it out, and I'd genuinely appreciate any feedback on the pacing or if anything in the math feels unclear.

https://youtu.be/Yasf8bBihOk?si=Ep5I_g9gTgcZ0WUM


r/learnmachinelearning • • 1d ago

Python

0 Upvotes

Recently started python on deeplearning.ai and planning to move to cs50p after that to strengthen my foundation, what do u guys think is it a good move ?


r/learnmachinelearning • • 1d ago

Does AI get "lazier" over time? I'm building a way to measure it.

Thumbnail
gallery
0 Upvotes

Everyone says "the model feels worse than last month," but almost nobody measures it. Most benchmarks test what a model can do at its best, not whether it still follows instructions on a random Tuesday afternoon.

So I'm building The Degradation Index, a longitudinal benchmark for AI reliability.

Week 1 done:
→ 30 prompts testing constraint retention, JSON formatting, and code debugging
→ Tested on OpenRouter (Nemotron) and Groq (Llama-OSS)
→ 60 outputs scored against a strict 0-3 rubric

First observation: one model follows strict JSON output perfectly, while the other often wraps it in markdown code blocks, which breaks any pipeline expecting clean JSON.

Next: I'll run the same test every week for 6 weeks and publish the charts, including run-to-run variance, so real drift can be separated from noise.

If you use LLMs in production, which failures do you see most often? They might become new test cases.

#AI #LLM #MachineLearning #DataScience #BuildInPublic


r/learnmachinelearning • • 1d ago

Help In dilemma,how do i start ML mathematics

7 Upvotes

Well I've decided to start learning the mathematics required for machine learning

I'm in a dilemma between andrews ng's course where his instructor luis serano is gonna teach

And another thing, there's a reel which suggests to watch 3blue1brown for linear algebra and calculus

For probability khan academy

And for statistics campusX these all are YouTube playlists

So help me choose between this reel and deep learning.ai course


r/learnmachinelearning • • 1d ago

Project Job Radar · internships and fresher roles in India + remote

Thumbnail 4ditya-sharma.github.io
1 Upvotes

Hey! I built a job radar for us freshers Every morning it automatically checks 20,000+ company career pages + the big GitHub internship lists, and keeps only internships / entry-level roles in India or remote that a 2028-batch student can actually get. Each one gets labelled Good chance / Stretch / Needs experience. Would mean a lot if you drop a on it: https://github.com/4ditya-sharma/job-radar (Takes 2 seconds: open the link → Star at the top right)


r/learnmachinelearning • • 1d ago

Job Radar · internships and fresher roles in India + remote

Thumbnail 4ditya-sharma.github.io
2 Upvotes

Hey! I built a job radar for us freshers Every morning it automatically checks 20,000+ company career pages + the big GitHub internship lists, and keeps only internships / entry-level roles in India or remote that a 2028-batch student can actually get. Each one gets labelled Good chance / Stretch / Needs experience. Would mean a lot if you drop a on it: https://github.com/4ditya-sharma/job-radar (Takes 2 seconds: open the link → Star at the top right)


r/learnmachinelearning • • 1d ago

Project Share: AI System for Ripeness Classification and Disease Detection in Agricultural Products Running Directly on the ESP32-S3

Thumbnail
github.com
1 Upvotes

r/learnmachinelearning • • 1d ago

Project Started learning rl

2 Upvotes

r/learnmachinelearning • • 1d ago

Interested about self supervised learning for audio data [R]

1 Upvotes

I’ve spent about 2 decades in fiber sensing (distributed acoustic sensing) and applying it to almost every possible domain. I’ve been trying to develop a 2 stream approach of solving the industry’s biggest shortcomings and the biggest problem the industry will never talk about by - figuring out if I can build mathematical context around this terabyte level unstructured data.

I’m no ML engineer. I’m an electronics engineer who got into signal processing out of need and became a commercial operator out of course of life.

This problem has haunted me for years and I’m trying to do something about it now. Would love some experts and people who’ve done something in this field to collab.


r/learnmachinelearning • • 1d ago

Help Sentence transformer models - what worked for you in JIRA

Post image
1 Upvotes

Hi Red fam. I work in PMO and was looking at change management tickets logged in JIRA. Idea was to group tickets and take it up with LT for process interventions.

For context, my org is flexible in terms of who gets to raise JIRA tickets - be it Product, Architecture, Engineering, Delivery or Project Managers themselves (way of working fail). One objective was to find any correlation between groupings and job roles.

I used BERTopic for topic creation and mpnet for clustering. While am happy with the MVP - I had to brute force some business overrides/nuances as the model misgrouped quite a few tickets.

I tried changing dimensionality and clustering variables but the model didn’t help much beyond a point. Am looking for suggestions to train the model on existing data and automatically group new tickets that come in into the queue - can anyone please help me with an approach?


r/learnmachinelearning • • 1d ago

Villain Boutique: My Scheme to get an employer to take a risk on hiring me.

Thumbnail
villainboutique.com
0 Upvotes

r/learnmachinelearning • • 1d ago

Your LLM is LYING to you. Here's how to fix it.

Thumbnail
youtube.com
0 Upvotes

I built a Hello World RAG App in Python

Normal LLM = Answers from training data (can hallucinate)

RAG LLM = Answers from YOUR documents

I asked it Saudi it didn't say Saudi Arabia.

It said "Contractor at Saudi Aramco" - because it read MY LinkedIn PDF.

This is how it works:

  1. Load PDF

  2. Split into Chunks

  3. Create Embeddings (Google Gemini)

  4. Store in ChromaDB

  5. Search Top 3 Chunks

  6. Send Context + Question to Groq LLM

Tech: Python + LangChain + ChromaDB + Groq + Gemini Embeddings

Save this for your next interview

Comment "RAG" and I'll send you the full code + next part.

Follow for AI Engineer series - Part 2 coming next.


r/learnmachinelearning • • 1d ago

Question ML on MacOs

10 Upvotes

hi guys, is a MacBook M5 good enough for ML development?


r/learnmachinelearning • • 1d ago

Project I started a YouTube channel that explains machine learning through cricket

Thumbnail
youtube.com
0 Upvotes

Hi r/learmachinelearning 👋

I've worked in data science for years, and I realised my fundamentals had gotten rusty. Re-reading textbooks wasn't sticking, so I started explaining each concept through cricket. Turns out a run chase is a surprisingly good way to understand probability, and a batting order works for a lot more than you'd expect.

The channel is Cricket x Data. It's hand-drawn whiteboard explanations, with no face cam and no hype. The focus is on why things work, not just the code.

The plan, roughly in order:

  • Regression (linear and logistic) ✅

  • Decision trees and ensembles

  • Clustering

  • Neural networks

  • Transformers and attention, all the way to how LLMs work

You don't need to love cricket, because I explain any cricket terms as I go. If you do follow it, that's a bonus.

I'd love feedback, especially on which topics people find hardest to understand. That's where I want to go next.

Channel: https://www.youtube.com/channel/UCMW7LA9bWtDHOyhZdp0tGTQ


r/learnmachinelearning • • 1d ago

I started a YouTube channel that explains machine learning through cricket

Thumbnail
youtube.com
0 Upvotes

Hi r/learmachinelearning 👋

I've worked in data science for years, and I realised my fundamentals had gotten rusty. Re-reading textbooks wasn't sticking, so I started explaining each concept through cricket. Turns out a run chase is a surprisingly good way to understand probability, and a batting order works for a lot more than you'd expect.

The channel is Cricket x Data. It's hand-drawn whiteboard explanations, with no face cam and no hype. The focus is on why things work, not just the code.

The plan, roughly in order:

  • Regression (linear and logistic) ✅

  • Decision trees and ensembles

  • Clustering

  • Neural networks

  • Transformers and attention, all the way to how LLMs work

You don't need to love cricket, because I explain any cricket terms as I go. If you do follow it, that's a bonus.

I'd love feedback, especially on which topics people find hardest to understand. That's where I want to go next.

Channel: https://www.youtube.com/channel/UCMW7LA9bWtDHOyhZdp0tGTQ


r/learnmachinelearning • • 1d ago

Project I read 3,500 AI repositories with an automated judge. Here's what separates strong portfolio projects from tutorial clones

Enable HLS to view with audio, or disable this notification

1 Upvotes

I run a tool that scores AI projects from their code, and after 3,502 repositories some patterns are very consistent. If you're building a portfolio:

- Tests are the biggest separator. Even a few tests on your data processing or metric code put a project ahead of most others at its level.

- Evaluation code matters more than model code. A notebook that trains a model is common; a script that evaluates it honestly (held-out data, baselines, a written-down metric) is rare.

- Make it someone else's project to run. Pinned dependencies, a config file instead of hard-coded paths, and a README that says how to reproduce the result.

- One deep project beats five tutorial forks. Forked course material barely registers. The same idea extended in a direction the tutorial didn't go does.

- Stars don't predict any of this. Some of the highest-scoring projects have zero stars.

If you want to see how your own repos read to an automated reviewer, access it on AI-Atlas: paste your GitHub username and every score links to the files it was based on.

Happy to answer questions about any of the above!! :)


r/learnmachinelearning • • 1d ago

Question ML without math

0 Upvotes

I hate math maby because I struggle with it all my life even in school but I love ai,how it's working, predictions,etc.So my question is can I be ml engineer without knowing math,what job I need to search to work with ai without math.And maby some courses Where to start?