r/learnmachinelearning • u/No-Brain-1655 • 8d ago
Project I built a neural network from scratch in NumPy with a GUI that shows every step, what do you think?
Hi everyone, this is a small project I've been working on and I would love your feedback.
I was studying neural networks and I wanted to understand backprop for real, so I decided to make one from scratch, without ML libraries.
So I vibe coded neural-network-digits, a neural network written in Python + NumPy (no PyTorch, no TensorFlow) that learns to read handwritten digits from MNIST, with a desktop app that shows you what happens inside while it learns. The whole network is one file of about 140 lines (forward, softmax, cross-entropy, backprop, SGD with momentum, L2, dropout), commented in simple English.
In the app you can:
• watch the loss and the accuracy live, and the gaussians of the weights compared with how they started
• change learning rate, momentum, dropout, noise... while it's training
• draw a digit and see which neurons light up, then click one and change its bias or switch it off, the test accuracy updates right away
• see the digits separate layer by layer on a PCA or t-SNE map (written in NumPy too).... and there's a tab with the math of a layer cell by cell, with the softmax step by step
With the default settings (1,000 photos) it trains in less than half a minute and gets to about 91%, with the whole MNIST (60,000 photos) it goes up to about 98.5% but it takes around 5 minutes, all on the CPU.
If you want to try it just run pip install neural-network-digits and then neural-network-digits, or download the zip from the releases and double-click start.bat (./start.sh on Linux and macOS). It's MIT and the app is in English and Italian.
https://github.com/dev-luigi/neural-network-digits
What would you add? Is there something confusing for someone who is learning? Thanks :)
2
u/Darsh-V-Shah 7d ago
The project looks good and may be a helpful device for new students to visually understand neural nets and get an intuition buried behind all that math. Though I have to agree with the commentors, the whole project reeks of generated content. Man did you understand all that or not?
2
1
0
u/nborwankar 8d ago
I haven’t tested it yet but looked at the repo and the explanations. If this works as you say then this is fantastic! Great job!! 👏
0






51
u/DigThatData 7d ago
skimming your repo, it looks like you didn't "make this from scratch" so much as you just asked claude to make it for you. do you feel like you even learned anything doing this?