上一片里,机器人算出分数 z 后,把决定权交给了一位“门卫”。这一片把门卫拆开看:为什么少了它,网络再深也没用。Last leaf, the robot scored its inputs and handed the score to a “gatekeeper”. This leaf opens up that gatekeeper — and shows why without it, depth alone buys you nothing.
第 1 步:门卫三兄弟Step 1: Meet the three gatekeepers
先认识三位门卫——它们处理分数的方式完全不同。Three gatekeepers — each handles a score completely differently.
分数卡片从传送带上送进来:老大 ReLU 把负分直接弹回去(归零),正分原样放行;老二 Sigmoid 像一台压扁机,不管多大的分数都压进 0~1,正好当概率用;老三 Step 是拨杆开关——大于 0 就开,否则就关,非黑即白。Score cards roll in on the belt: ReLU (the bouncer) throws negatives back to zero and passes positives untouched; Sigmoid (the squeezer) presses any score into 0–1, perfect as a probability; Step (the toggle) is all-or-nothing — above zero opens, otherwise shuts.
你可能会想:直接用分数不行吗,为什么非要门卫“掰”一下?You might ask: why not use the score directly — why does something have to “bend” it?
第 2 步:没有门卫,就是一块直板Step 2: Without gates, it's a straight plank
因为“乘一乘、加一加”是直线运算:没有门卫,叠一百层也等于一层,再深也只是那块爬不上去的直板。门卫的“掰弯”(负的归零、分数压扁、啪一下开关)让路线能弯、能折——能弯,才学得会复杂形状:认脸、画圆、听懂话,全靠它。Multiplying and adding is straight-line math: with no gates, a hundred stacked layers equal one layer — still the rigid plank the robot slides back down. The gate's bend (zeroing negatives, squeezing scores, flipping a switch) lets the path curve and fold — and only a path that bends can learn complex shapes: faces, circles, speech.
那这三位在真实的网络里,谁在哪儿值班?So who stands where on duty in a real network?
第 3 步:值班表Step 3: The duty roster
中间层几乎清一色 ReLU——又快又稳,成千上万个一起守夜;出口看任务:二选一用 Sigmoid,多选一用 Softmax(它的多分类版),把分数变成“是猫 92%”这样的概率。Step 最早出道(第一代感知机就用它),如今退居教科书。Hidden layers run almost entirely on ReLU — fast, stable, thousands on night shift at once. The output layer depends on the job: Sigmoid for two-way choices, Softmax (its multi-class cousin) for many-way ones, turning scores into “92% cat”. Step was the original gatekeeper of the first perceptron — now comfortably retired to textbooks.
🎮 你来当调度员(30 秒)🎮 Your turn: desk duty (30 seconds)
道理讲完了。先拖分数滑块,看三兄弟各自的值班表现;再接下面 4 张工单,把每张分给正确的门卫。Theory done. First drag the score slider to watch all three on duty; then take 4 work orders and assign each to the right gatekeeper.
一句话记住它:激活函数 = 网络里的“掰弯器”;没有它,再深也只是直线。三兄弟分工:ReLU 守中间层、Sigmoid 管出口概率、Step 教科书元老。Remember it in one line: an activation is the network's bender — without it, depth stays straight. ReLU guards hidden layers, Sigmoid turns scores into output probabilities, Step is the textbook elder.
ReLU:负分归零、正分放行(max(0, z)),中间层主力ReLU: negatives to zero, positives pass — the hidden-layer workhorseSigmoid:把分数压进 0~1 当概率;多分类版叫 SoftmaxSigmoid: squeezes scores into 0–1 probabilities; Softmax for many classesStep:非黑即白,最早的开关,现在退居教科书Step: all-or-nothing, the original switch, now retired to textbooks
内容参考 OpenStax 等公开教材,多来源核对 · AI 生成、人工审核 · 发现错误欢迎指正,帮这片叶子长得更好。Based on OpenStax and other open textbooks, cross-checked across sources · AI-generated, human-reviewed · Spotted a mistake? Tell us — help this leaf grow.