惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
量子位
小众软件
小众软件
The Cloudflare Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
G
Google Developers Blog
博客园 - 叶小钗
H
Help Net Security
Jina AI
Jina AI
Y
Y Combinator Blog
Last Week in AI
Last Week in AI
GbyAI
GbyAI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
MyScale Blog
MyScale Blog
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Vercel News
Vercel News

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Built a Neural Network's First Neuron From Scratch — th...
Devanshu Biswas · 2026-06-14 · via DEV Community

Devanshu Biswas

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.

This is Day 1 of DeepLearningFromZero: neural nets built from a single neuron up, no framework magic.

A neuron is shockingly simple

Take 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.

let w = [Math.random(), Math.random()], b = 0;
const sum = x => w[0]*x[0] + w[1]*x[1] + b;
const predict = x => sum(x) >= 0 ? 1 : -1;

The weights ARE a line

w₁·x₁ + w₂·x₂ + b = 0 is 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.

The learning rule: only fix mistakes

Predict each point. If correct, do nothing. If wrong, nudge the weights toward the right answer:

for (const { x, y } of data) {
  if (predict(x) !== y) {        // y is the true label, +1 or -1
    w[0] += lr * y * x[0];
    w[1] += lr * y * x[1];
    b    += lr * y;
  }
}

Geometrically, that rotates and shifts the line so the misclassified point ends up on the correct side. Repeat for a few epochs:

for (let epoch = 0; epoch < 50; epoch++) trainStep(0.1);

The guarantee that launched a field

Rosenblatt 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.

The catch (and the whole future of deep learning)

A 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.

The 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.

🌐 Train the neuron live (watch the boundary rotate): https://dev48v.infy.uk/dl/day1-perceptron.html

Day 1 of DeepLearningFromZero. From one neuron to transformers, built from scratch.