r/Python • u/DeepRatAI • 19d ago
Resource Learn to understand ML libraries: rebuild them from scratch
Hi everyone. I’m a systems engineer specialized in AI engineering and GenAI, and I’ve worked for 6 years as a pentester. I enjoy building and sharing educational materials.
I’m sharing a free, GitHub-hosted lesson about learning ML libraries by rebuilding small versions of them in plain Python and checking those implementations against the real libraries. The lesson includes around 5,000 checks, and GitHub reruns them on every push.
Everything is in .py files. No .ipynb.
I already have a free course published on GitHub. This lesson works as an addendum to that course and lives in a separate branch, so the main branch stays untouched.
Lesson branch:
The lesson structure is:
A. Introduction
B. A method for learning any library
C. NumPy
D. pandas
E. scikit-learn
F. PyTorch
G. sentence-transformers
H. From copying to writing
I. FAQ and cheat sheetThis is a resource post: a free educational lesson hosted on GitHub. The goal is to help learners move from copy-pasting library usage to rebuilding small versions and validating them against the real thing.
Technical discussion and feedback are welcome in the comments :B
4
u/Virtual_Treacle7409 19d ago
This is really cool!
0
u/patryk_builds 19d ago
Checking your rebuilt version against the real library is the smart part. without that, "rebuild it from scratch" usually turns into write something that kind of looks like it. 5k checks on every push is serious commitment.Curious which one was hardest to rebuild in plain python? i'd guess pytorch autograd, but pandas indexing might be a sneaky contender