HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
workofart
ml-by-hand
Python2025–2026
workofart / ml-by-hand

ml-by-hand

A deep learning library built from scratch with complex neural networks examples built on top for learning purposes.

2Distinct people
12Mentions
0Explicit recommenders
110GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A deep learning library built from scratch with complex neural networks examples built on top for learning purposes.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month12 dated mentions

Observed mentions: 2025-02-08 22:05:59 UTC to 2026-08-14 18:46:37 UTC.

01232025-02-01 00:00:00 UTC to 2025-03-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 commentsFeb 20252025-03-01 00:00:00 UTC to 2025-04-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-04-01 00:00:00 UTC to 2025-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-05-01 00:00:00 UTC to 2025-06-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-06-01 00:00:00 UTC to 2025-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-07-01 00:00:00 UTC to 2025-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-08-01 00:00:00 UTC to 2025-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-09-01 00:00:00 UTC to 2025-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-10-01 00:00:00 UTC to 2025-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-11-01 00:00:00 UTC to 2025-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsNov 20252025-12-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2026-02-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-02-01 00:00:00 UTC to 2026-03-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-03-01 00:00:00 UTC to 2026-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-04-01 00:00:00 UTC to 2026-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-05-01 00:00:00 UTC to 2026-06-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-06-01 00:00:00 UTC to 2026-07-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2026-07-01 00:00:00 UTC to 2026-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-08-01 00:00:00 UTC to 2026-09-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsAug 2026

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Feb 20252025-02-01 00:00:00 UTC2025-03-01 00:00:00 UTC220
Mar 20252025-03-01 00:00:00 UTC2025-04-01 00:00:00 UTC101
Apr 20252025-04-01 00:00:00 UTC2025-05-01 00:00:00 UTC000
May 20252025-05-01 00:00:00 UTC2025-06-01 00:00:00 UTC101
Jun 20252025-06-01 00:00:00 UTC2025-07-01 00:00:00 UTC000
Jul 20252025-07-01 00:00:00 UTC2025-08-01 00:00:00 UTC000
Aug 20252025-08-01 00:00:00 UTC2025-09-01 00:00:00 UTC000
Sep 20252025-09-01 00:00:00 UTC2025-10-01 00:00:00 UTC000
Oct 20252025-10-01 00:00:00 UTC2025-11-01 00:00:00 UTC101
Nov 20252025-11-01 00:00:00 UTC2025-12-01 00:00:00 UTC000
Dec 20252025-12-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
Jan 20262026-01-01 00:00:00 UTC2026-02-01 00:00:00 UTC101
Feb 20262026-02-01 00:00:00 UTC2026-03-01 00:00:00 UTC101
Mar 20262026-03-01 00:00:00 UTC2026-04-01 00:00:00 UTC000
Apr 20262026-04-01 00:00:00 UTC2026-05-01 00:00:00 UTC000
May 20262026-05-01 00:00:00 UTC2026-06-01 00:00:00 UTC101
Jun 20262026-06-01 00:00:00 UTC2026-07-01 00:00:00 UTC312
Jul 20262026-07-01 00:00:00 UTC2026-08-01 00:00:00 UTC000
Aug 20262026-08-01 00:00:00 UTC2026-09-01 00:00:00 UTC101

What Hacker News says

12 sources
i created something similar a while back. Inspired by micrograd for showing the connection between math/calculus and code, then building along the way to a full NumPy deep learning library that I pretrained GPT-2 124M model with it. One way to learn is to trace through the PRs merged to the repo in chronological order. The philosophy is the same: "What I cannot create, I do not understand." https://github.com/workofart/ml-by-hand
In AI by Hand
Interesting project. Do you think manual memory management help understand computational graph lifecycle better, or does it distract from backprop itself? btw, I went down the micrograd path with numpy-primitives all the way to building a PyTorch clone that can pre-train and post-train LLMs (https://github.com/workofart/ml-by-hand). My learning focus was on the math/calculus <-> high-level APIs, instead of efficiency. I'm glad to see more people tackling this problem from different angles.
In Show HN: Microcrad – Micrograd Reimplemented in C
I'm continuing to expand my own deep learning library [1] built with numpy-primitives to support LLM post-training techniques like supervised fine-tuning (SFT) and reinforcement learning with GRPO. It's a good learning experience to work without all the high-level abstractions to "build a wheel" and "use that wheel to build a car". I'm also looking into coding harness self-improvement [2]. An inner LLM (raw LLM request) + harness solves coding tasks, an outer agent like Claude or Codex that proposes harness changes. I experimented with many things in the past few months that made me realize this self-improvement thing that everyone is talking about is just an experiment design problem. I wrote about it here [3]. I'm continuing to improve the infra around the self-improvement loop, to increase signal-to-noise ratio per experiment. I'm also
Read the rest
generalizing the infra to expand beyond terminal bench tasks and to collect some data across different models (harness-bound vs model-bound). [1] https://github.com/workofart/ml-by-hand [2] https://github.com/workofart/harness-experiment [3] https://www.henrypan.com/blog/2026-05-25-self-improvement-ha...
In Ask HN: What are you working on? (June 2026)
I'm continuing to expand my own deep learning library [1] (PyTorch-clone built with Python and Numpy) to support LLM post-training techniques like supervised fine-tuning (SFT) [2] and reinforcement learning with GRPO [3] . It's a good learning experience to work without all the high-level abstractions to "build a wheel" and "use that wheel to build a car". Post-training results are still cooking, since training on my MacBookPro is quite slow with "unoptimized PyTorch" :) 1. https://github.com/workofart/ml-by-hand 2. https://github.com/workofart/ml-by-hand/blob/main/examples/s... 3. https://github.com/workofart/ml-by-hand/blob/main/examples/g...
In Ask HN: What are you working on? (May 2026)
Thanks for sharing! It's inspiring to see more people "reinventing for insight" in the age of AI. This reminds me of my similar previous project a year ago when I built an entire PyTorch-style machine learning library [1] from scratch, using nothing but Python and NumPy. I started with a tiny autograd engine, then gradually created layer modules, optimizers, data loaders etc... I simply wanted to learn machine learning from first principles. Along the way I attempted to reproduce classical convnets [2] all the way to a toy GPT-2 [3] using the library I built. It definitely helped me understand how machine learning worked underneath the hood without all the fancy abstractions that PyTorch/TensorFlow provides. I eventually wrote a blog post [4] of this journey. [1] https://github.com/workofart/ml-by-hand [2] https://github.com/workofart/ml-
Read the rest
In Build a Deep Learning Library
Thanks for this inspiring essay, I couldn’t agree more that “reinventing for insight” is one of the best ways to learn. I had a similar experience couple months ago when I built an entire PyTorch-style machine learning library [1] from scratch, using nothing but Python and NumPy. I started with a tiny autograd engine, then gradually created layer modules, optimizers, data loaders etc... I simply wanted to learn machine learning from first principles. Along the way I attempted to reproduce classical convnets [2] all the way to a toy GPT-2 [3] using the library I built. It definitely helped me understand how machine learning worked underneath the hood without all the fancy abstractions that PyTorch/TensorFlow provides. Kinda like reinventing the car using the wheel I reinvented :) [1] https://github.com/workofart/ml-by-hand [2] https://gith
Read the rest
In Reinvent the Wheel
I built a machine learning library [1] (similar to PyTorch's API) entirely from scratch using only Python and NumPy. It was inspired by Andrej Karpathy's Micrograd project [2]. I slowly added more functionality and evolved it into a fully functional ML library that can build and train classical CNNs [3] to even a toy GPT-2 [4]. I wanted to understand how models learn, like literally bridging the gap between mathematical formulas and high-level API calls. I feel like, as a beginner in machine learning, it's important to strip away the abstractions and understand how these libraries work from the ground up before leveraging these "high-level" libraries such as PyTorch and Tensorflow. Oh I also wrote a blog post [5] on the journey. [1] https://github.com/workofart/ml-by-hand [2] https://github.com/karpathy/micrograd [3] https://github.com/wo
Read the rest
In Ask HN: What are you working on? (March 2025)

Show HN: ML Library created by Python+NumPy (trains CNNs to a toy GPT-2)

Hi HN, I built a machine learning library entirely from scratch using only Python and NumPy. I then used it to train a range of models—from classical CNNs, ResNets, RNNs, and LSTMs to modern Transformers and even a toy GPT-2. The motivation came from my curiosity about how to build deep learning models from scratch, like literally from mathematical formulas. I built this project not to replace production-ready libraries like PyTorch or TensorFlow, but to strip away the abstractions and reveal the underlying mathematics of machine learning. Key points: - Everything is derived in code — no opaque black boxes. - API mirrors PyTorch so you can pick it up quickly. - You can train CNNs, RNNs, Transformers, and even GPT models. - Designed more for learning/debugging than raw performance. What’s different here? While there are many powerful ML li
Read the rest
braries available (TensorFlow, PyTorch, Scikit-learn, etc.), they often hide the underlying math behind layers of abstraction. I believe that to truly master these tools, you first need to understand how they work from the ground up. This project explicitly derives all the mathematical and calculus operations in the code, making it a hands-on resource for deepening the understanding of neural networks and library building :) Check it out: - Github Repository: https://github.com/workofart/ml-by-hand - API Documentation: https://ml-by-hand.readthedocs.io/en/latest/ - Examples: Explore models like GPT-2, CNNs, Transformers, and LSTMs in the examples/ folder: https://github.com/workofart/ml-by-hand/tree/main/examples - Blog Post: Read about the project’s motivation, design, and challenges at https://www.henrypan.com/blog/2025-02-06-ml-by-hand/ I’d love to hear any thoughts, questions, or suggestions — thanks for checking it out!
1 points · Open discussion

Show HN: From-Scratch ML Library (trains models from CNNs to a toy GPT-2)

Hi HN, I built a machine learning library entirely from scratch using only Python and NumPy. I then used it to train a range of models—from classical CNNs, ResNets, RNNs, and LSTMs to modern Transformers and even a toy GPT-2. The motivation came from my curiosity about how to build deep learning models from scratch, like literally from mathematical formulas. I built this project not to replace production-ready libraries like PyTorch or TensorFlow, but to strip away the abstractions and reveal the underlying mathematics of machine learning. Key points: - Everything is derived in code — no opaque black boxes. - API mirrors PyTorch so you can pick it up quickly. - You can train CNNs, RNNs, Transformers, and even GPT models. - Designed more for learning/debugging than raw performance. What’s different here? While there are many powerful ML li
Read the rest
braries available (TensorFlow, PyTorch, Scikit-learn, etc.), they often hide the underlying math behind layers of abstraction. I believe that to truly master these tools, you first need to understand how they work from the ground up. This project explicitly derives all the mathematical and calculus operations in the code, making it a hands-on resource for deepening the understanding of neural networks and library building :) Check it out: - Github Repository: https://github.com/workofart/ml-by-hand - API Documentation: https://ml-by-hand.readthedocs.io/en/latest/ - Examples: Explore models like GPT-2, CNNs, Transformers, and LSTMs in the examples/ folder: https://github.com/workofart/ml-by-hand/tree/main/examples - Blog Post: Read about the project’s motivation, design, and challenges at https://www.henrypan.com/blog/2025-02-06-ml-by-hand/ I’d love to hear any thoughts, questions, or suggestions — thanks for checking it out!
1 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.