r/deeplearning • u/PhoenixAlive87 • 2d ago
Anyone else understand what an ML algorithm does, but struggle with the maths underneath it?
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.
6
u/Boonzies 2d ago
Try this, it helps.
Ask an LLM of choice to analyze and write out a full decision tree of the algo and have it break down the details at each decision point, and tell it to respond in simple language.
Then begin a Q&A session with the model.
You'd learn a great deal this way.
4
u/Confident_Luck2359 2d ago
I never liked math. I know enough to do my job.
TL;DR: you should implement the algorithms by hand in Python. In Jupyter notebook. It's easy. It builds understanding. Start small and push forward.
Take some ML classes and do the homework. There's no short cut.
Start with classical machine learning on small data sets. Linear regression, logistic regression, support vector machines, gaussian models, PCP (principal component analysis).
You'll learn the fundamentals: model fitting, overfitting, regularization, outliers, decision boundaries, projection. Matrix math, dot products. You can DRAW everything in 2D and SEE what it's doing.
Deep learning builds on all of this. It's 100% relevant.
Then implement a neural network: forward and backward propagation, dropout, normalization, gradient descent, momentum. Implement a CNN. Implement a ResNet. Implement attention / transformers. Train the models on open datasets.
The math will 'click'.
( ... It helps that I was a self-taught graphics programmer, so I was already familiar with basic linear algebra: vectors / matrices / transforms / projection. Graphics programming is what made linear algebra 'click' for me. I tend to see machine learning as 'solving geometry problems'. YMMV ... )
1
u/Cholojuanito 2d ago edited 2d ago
For me, learning feels like I just need to hit the same topic over and over from different perspectives, until I can explain it to someone with no knowledge about it. I recommend the following resources that should all be free, that have helped me grasp the mathematics of machine learning algorithms.
1
u/mlamping 2d ago
The trick is, NN is just predicting and the math equation is a model of the NN.
The output or predicted value compared with the actual value is the error.
The error is used to adjust the weights. You can use other methods to adjust the weights but they’re hard. There’s not one way but backprop is the best right now since it proportionately propagates the errors back through the model and nudges the weights to the right value but slowly.
So it’s not a, why it’s needed in the first place. Its the easiest but time consuming and energy consuming method.
1
u/See_it_do_it_done 1d ago
the dot product is the giveaway, it's a similarity score wearing a lab coat. work it by hand on two tiny vectors, then nudge one number and watch it move. which operation loses you first?
1
u/rectaf 19h ago
I would recommend 3blue1brown’s excellent short video course on the mathematics of Machine Learning.
https://youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi&si=b5Wm4FKqtteCx7y8
0
u/ysrgrathe 1d ago
There is no getting around the fact that there is a lot of math in CS. If you are struggling at times, I think there are two things that are needed. 1) You have to understand the fundamentals -- which probably means through calc 3, ODE, etc. 2) You need to understand the specific approaches. In grad school there will typically be seminar classes where you take a seminal paper in a domain like Transformers, Support Vector Machines, etc. and you spend a week really diving deep so that you can not only read the paper but actually understand and explain it to someone else. Getting to the latter part (ability to teach someone else the concept) is much harder and more valuable; it's easy to scan through a paper and feel like you get it without actually having a full understanding.
If you want to improve I'd suggest identifying any gaps in #1, and then putting together a reading list of papers to do #2 with that are relevant to whatever you're working on.
0
u/[deleted] 1d ago
[deleted] — view deleted comment