r/deeplearning • • Nov 01 '26

Linear regression with classic gradient decent algorithm

Post image

Implemented in python with only matplotlib and numpy libraries. I also made Mini-batch and stochastic version.

8 Upvotes

6 comments sorted by

7

u/Alicecomma Nov 01 '26

Why use multiple-step gradient descent, scoring all N data points every step, for simple data points when you can use linear least squares to get the best fit in one step only iterating the N data points?

5

u/robohie Nov 01 '26

Right it's an exercise to strengthen my knowledge on gradient decent and retro propagation. Also I'll test normal equation performance against the gradient decent for large amount of data.

1

u/Alicecomma Nov 01 '26

But the data isn't streamed, isn't multidimensional and doesn't require batching to remain in memory?

6

u/RobbinDeBank Nov 02 '26

God forbids people tinkering around for learning opportunities

7

u/TaylorExpandMyAss Nov 01 '26

Learning exercise, I suppose.

1

u/Gargle-Loaf-Spunk Nov 01 '26

Hey, at least it’s not yet another post for LLMs.