Karpathy’s micrograd did it first (and better); start here: https://karpathy.ai/zero-to-hero.html
MyTorch – Minimalist autograd in 450 lines of Python
11–20 of 20 posts
Re: MyTorch – Minimalist autograd in 450 lines of Python
#12Karpathy’s micrograd did it first (and better); start here: https://karpathy.ai/zero-to-hero.html
Why is it better
P.S. Course goes far beyond micrograd, to makemore (transfomers), minbpe (tokenization), and nanoGPT (LLM training/loading).
Re: MyTorch – Minimalist autograd in 450 lines of Python
#13Earlier quoted context omitted.
Why is it better
Because it's an acclaimed, often cited course by a preeminent AI Researcher (and founding member of OAI) rather than four undocumented python files.
Re: MyTorch – Minimalist autograd in 450 lines of Python
#14Re: MyTorch – Minimalist autograd in 450 lines of Python
#15Earlier quoted context omitted.
Because it's an acclaimed, often cited course by a preeminent AI Researcher (and founding member of OAI) rather than four undocumented python files.
Ironically the reason Karpathy's is better is because he livecoded it and I can be sure it's not some LLM vomit. Unfortunately, we are now indundated with newbies posting their projects/tutorials/guides in the hopes that doing so will catch the eye of a recuiter and land them a high paying AI job. That's not so bad in itself except for the fact that most of these people are completely clueless and posting AI slop.
Re: MyTorch – Minimalist autograd in 450 lines of Python
#16Supporting higher order derivatives was also something I considered, but it’s basically never needed in production models from what I’ve seen.
Re: MyTorch – Minimalist autograd in 450 lines of Python
#17Better readme would be way to go
It arguably reads cleaner than Karpathy's in some respects, as he occasionally gets a little ahead of his students with his '1337 Python skillz.
Re: MyTorch – Minimalist autograd in 450 lines of Python
#18Having written a slightly more involved version of this recently myself I think you did a great job of keeping this compact while still readable. This style of library requires some design for sure. Supporting higher order derivatives was also something I considered, but it’s basically never needed in production models from what I’ve seen.
Re: MyTorch – Minimalist autograd in 450 lines of Python
#19Karpathy’s micrograd did it first (and better); start here: https://karpathy.ai/zero-to-hero.html
Karpathy's material is excellent! This was a project I made for fun, and hopefully provides a different perspective on how this can look
Re: MyTorch – Minimalist autograd in 450 lines of Python
#20Earlier quoted context omitted.
Karpathy's material is excellent! This was a project I made for fun, and hopefully provides a different perspective on how this can look
I'm very sorry, I should have phrased my original post in a kinder, less dismissive way, and kudos to you for not reacting badly to my rudeness. It is a cool repo and a great accomplishment. Implementing autograd is great as a learning exercise, but my opinion is that you're not going to get the performance or functionality of one of the large, mainstream autograd libraries. Karpathy, for example, throws away microgr…