{"slug": "i-built-a-neural-network-s-first-neuron-from-scratch-the-1958-perceptron", "title": "I Built a Neural Network's First Neuron From Scratch — the 1958 Perceptron", "summary": "A developer built Frank Rosenblatt's 1958 Perceptron from scratch, implementing a single neuron with weighted inputs, bias, and step activation. The project demonstrates how a perceptron learns a linear decision boundary through iterative weight updates, achieving perfect accuracy on linearly separable data. The developer notes the perceptron's limitation with non-linear problems like XOR, which led to the development of multi-layer networks and backpropagation.", "body_md": "Before transformers, before backprop, there was **one neuron** — Frank Rosenblatt's 1958 Perceptron. Build it and you understand the atom that every deep network is made of.\n\nThis is Day 1 of DeepLearningFromZero: neural nets built from a single neuron up, no framework magic.\n\nTake inputs, multiply each by a weight, add a bias, then apply an activation. The original used a **step**: output +1 if the sum is ≥ 0, else −1.\n\n``` js\nlet w = [Math.random(), Math.random()], b = 0;\nconst sum = x => w[0]*x[0] + w[1]*x[1] + b;\nconst predict = x => sum(x) >= 0 ? 1 : -1;\n```\n\n`w₁·x₁ + w₂·x₂ + b = 0`\n\nis the equation of a straight line — the **decision boundary**. One side is class +1, the other is −1. So a neuron's entire \"knowledge\" is the tilt and position of one line.\n\nPredict each point. If correct, do nothing. If wrong, nudge the weights toward the right answer:\n\n```\nfor (const { x, y } of data) {\n  if (predict(x) !== y) {        // y is the true label, +1 or -1\n    w[0] += lr * y * x[0];\n    w[1] += lr * y * x[1];\n    b    += lr * y;\n  }\n}\n```\n\nGeometrically, that rotates and shifts the line so the misclassified point ends up on the correct side. Repeat for a few epochs:\n\n``` js\nfor (let epoch = 0; epoch < 50; epoch++) trainStep(0.1);\n```\n\nRosenblatt proved it: **if the two classes can be separated by a straight line, the perceptron will find one in a finite number of steps.** Watch the accuracy climb to 100% and training stop.\n\nA single neuron can only draw **one straight line**. The famous failure is **XOR** — no single line separates it. That limitation nearly killed neural nets in the 1970s.\n\nThe fix: stack neurons into layers, swap the step for a smooth activation, and train with gradient descent + backprop. That arc — from this one neuron to a transformer — is the rest of the series.\n\n🌐 Train the neuron live (watch the boundary rotate): [https://dev48v.infy.uk/dl/day1-perceptron.html](https://dev48v.infy.uk/dl/day1-perceptron.html)\n\nDay 1 of DeepLearningFromZero. From one neuron to transformers, built from scratch.", "url": "https://wpnews.pro/news/i-built-a-neural-network-s-first-neuron-from-scratch-the-1958-perceptron", "canonical_source": "https://dev.to/dev48v/i-built-a-neural-networks-first-neuron-from-scratch-the-1958-perceptron-3gfg", "published_at": "2026-06-13 23:51:26+00:00", "updated_at": "2026-06-14 00:29:19.866381+00:00", "lang": "en", "topics": ["neural-networks", "machine-learning", "artificial-intelligence", "ai-research", "developer-tools"], "entities": ["Frank Rosenblatt", "Perceptron", "DeepLearningFromZero", "XOR"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-neural-network-s-first-neuron-from-scratch-the-1958-perceptron", "markdown": "https://wpnews.pro/news/i-built-a-neural-network-s-first-neuron-from-scratch-the-1958-perceptron.md", "text": "https://wpnews.pro/news/i-built-a-neural-network-s-first-neuron-from-scratch-the-1958-perceptron.txt", "jsonld": "https://wpnews.pro/news/i-built-a-neural-network-s-first-neuron-from-scratch-the-1958-perceptron.jsonld"}}