salcad/single-neuron-digit-recognition — reverse-engineered prompt
Reverse engineered prompt
Build me a simple educational Python app that shows how a single neuron can learn to recognize handwritten digits, only telling apart 0 and 1 from MNIST.
I want it to download the data, keep just the 0 and 1 images, normalize the pixels, train one logistic neuron from scratch with numpy, and show the results in a way beginners can understand. It should print the train and test accuracy, save a loss curve image, and include a small Streamlit demo where someone can run the training and see what happened.
Please keep the code clear and heavily explained, especially the forward pass, sigmoid, binary cross entropy loss, gradients, backpropagation, and gradient descent. The goal is not a fancy neural network library, it’s a learning project that makes the math feel understandable. If you need exact Streamlit or sklearn details, look up the current docs online.
Want more depth? Deep Reverse