← sources

built a neural network from scratch using numpy to understand backpropagation

source: reddit (reddit:deeplearning)published 2026-10-19 13:28ingested 2026-10-20 02:36

retained text

hey everyone!

recently built a 2 → 3 → 1 XOR neural network using NumPy, without PyTorch or TensorFlow.

wanted to understand backpropagation properly, so I implemented the mathematics and gradient descent manually.

trained it for 5,000 epochs and achieved 4/4 correct classifications.

the repo includes mathematical derivations, training visualizations and 12 editable diagrams.

also wrote a detailed Medium article explaining the process.

GitHub: [https://github.com/Vaibh37/Neural-Network](https://github.com/Vaibh37/Neural-Network)

Medium: [https://medium.com/@devvaibhav37/building-a-neural-network-from-scratch-the-mathematics-behind-learning-xor-10441e674a69](https://medium.com/@devvaibhav37/building-a-neural-network-from-scratch-the-mathematics-behind-learning-xor-10441e674a69)

would appreciate feedback on the implementation. if you find it useful, consider starring the repo 🍀

document fetched 2026-10-20 00:24 · canonical https://reddit.com/r/deeplearning/comments/1x9wwuh/built_a_neural_network_from_scratch_using_numpy