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

推荐订阅源

博客园 - 叶小钗
D
Docker
GbyAI
GbyAI
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
G
Google Developers Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
小众软件
小众软件
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
B
Blog
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog

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
Why y=mx+b is the heart of AI
Aanand · 2026-05-22 · via DEV Community

We hear words like:

  • Artificial Intelligence
  • Machine Learning
  • Neural Networks

then imagine something mysterious.

Something extremely advanced.

But surprisingly, one of the core ideas behind neural networks starts from a concept many of us studied in school.

y = mx + b

This is called the slope-intercept form of a line.

y = mx + b

Enter fullscreen mode Exit fullscreen mode

x Input — the number we feed in
y Output — the result we get out
m Slope — how much y changes per unit of x
b Y-intercept — the output when x(input) is zero.

Example: take y = 2x + 1 and Plug in different input:
x = 1 → y = 3
x = 2 → y = 5
x = 3 → y = 7

Neural networks use the same idea

Inside a neural network, a single neuron does this:

y = wx + b

Enter fullscreen mode Exit fullscreen mode

w Weight — behaves exactly like slope (m)
b Bias — behaves exactly like the y-intercept

The only difference: the variable names changed. The math is the same.

What does weight actually do?

Suppose an AI is predicting a student's exam score. It has three inputs:

  • Study hours
  • Hours of sleep
  • Hours of phone usage

Do all three affect the score equally? No.

  1. Study hours matter the most
  2. Phone usage probably hurts
  3. Sleep helps a little.

So the formula for this prediction might look like:

score = 5(study) + 2(sleep) − 4(phone) + 10

interpretation:

  • Study hours have the highest positive weight (5) — they help the most
  • Sleep has a smaller positive weight (2) — it helps a little
  • Phone usage has a negative weight (−4) — it actively hurts the score
  • 10 is the bias — the model's default starting score before inputs are counted

But why say "weight" instead of "slope"?

neural networks have many inputs at once. Each input needs its own slope. When there are many of them, we call them weights.

y = wx + wx + wx + b

Enter fullscreen mode Exit fullscreen mode

Each input (x₁, x₂, x₃) has its own weight (w₁, w₂, w₃).
The name "weight" just means: the slope assigned to this particular input.

In model "training"

At the start, a model does not know the right weights. They are set randomly. So predictions are terrible:

random start — predictions are bad
y = 0.13x + 7.8

Training is the process of adjusting the weights and bias, little by little, until predictions get better:

getting closer
y = 2.4x + 1.1

much better
y = 3.0x + 0.5

Notice: both w and b are changing. Training adjusts both the weights and the bias to reduce prediction error. That is all training is.

Putting it all together: one neuron

A single neuron in a neural network does four things in order:

  • Multiply each input by its weight
  • Add all those results together
  • Add the bias
  • Pass the result through an activation function
z = wx + wx + b

Enter fullscreen mode Exit fullscreen mode

output = f(z)

Enter fullscreen mode Exit fullscreen mode

What is f(z) — the activation function?
After a neuron computes z = w₁x₁ + w₂x₂ + b, it passes z through a function called the activation function before outputting anything:

To understand why this exists, we need to understand one hard problem first.

The linearity problem
Every neuron computes a weighted sum — which is always a straight line. Stack many neurons together without an activation function, and we still get a straight line.

*The real world is not made of straight lines: *

  • recognizing faces
  • understanding language
  • diagnosing disease

none of these are linear

The activation function breaks the linearity. It bends or squashes the output in a nonlinear way.

So This is why activation functions exist. Without them, deep networks would have no advantage over a single straight line.