```interact
slider x1 range=0..1 step=0.05 default=0.7 label="输入 x₁"
slider tau range=0..1 step=0.05 default=0.9 label="目标值"
slider lr range=0.5..4 step=0.25 default=2 label="学习率（放大了好看清）"
timer t range=0..8 step=0.04 speed=40 label="训练"
computed tt = mod(t, 8)
step cap over tt: (0,"前向 · 先猜一次") -> (1.7,"对照目标 · 差距就是损失") -> (2.6,"反向 · 责任倒灌给每个权重") -> (4.8,"更新 · 每个权重挪 −lr·梯度") -> (5.9,"再前向 · 这次猜得更近")
computed h1 = 1 / (1 + exp(-(1.6*x1 - 0.32)))
computed h2 = 1 / (1 + exp(-(-1.1*x1 + 0.69)))
computed h3 = 1 / (1 + exp(-(0.8*x1 - 0.08)))
computed h4 = 1 / (1 + exp(-(0.5*x1 - 0.15)))
computed y = 1 / (1 + exp(-(1.5*h1 - 1.2*h2 + 1.0*h3 + 0.8*h4 - 0.6)))
computed dout = 2 * (y - tau) * y * (1 - y)
computed gv1 = dout * h1
computed dh1 = dout * 1.5 * h1 * (1 - h1)
computed gv2 = dout * h2
computed dh2 = dout * -1.2 * h2 * (1 - h2)
computed gv3 = dout * h3
computed dh3 = dout * 1.0 * h3 * (1 - h3)
computed gv4 = dout * h4
computed dh4 = dout * 0.8 * h4 * (1 - h4)
computed ga1 = dh1 * x1
computed gb1 = dh1 * 0.3
computed gc1 = dh1 * 0.5
computed ga2 = dh2 * x1
computed gb2 = dh2 * 0.3
computed gc2 = dh2 * 0.5
computed ga3 = dh3 * x1
computed gb3 = dh3 * 0.3
computed gc3 = dh3 * 0.5
computed ga4 = dh4 * x1
computed gb4 = dh4 * 0.3
computed gc4 = dh4 * 0.5
computed gmax = max(abs(gv1),abs(gv2),abs(gv3),abs(gv4),abs(ga1),abs(ga2),abs(ga3),abs(ga4),abs(gb1),abs(gb2),abs(gb3),abs(gb4),abs(gc1),abs(gc2),abs(gc3),abs(gc4),0.0001)
computed u = clamp((tt - 4.8) / 1, 0, 1)
computed v1n = 1.5 - lr * gv1
computed wv1 = 0.4 + 1.5 * abs(lerp(1.5, v1n, u))
computed v2n = -1.2 - lr * gv2
computed wv2 = 0.4 + 1.5 * abs(lerp(-1.2, v2n, u))
computed v3n = 1.0 - lr * gv3
computed wv3 = 0.4 + 1.5 * abs(lerp(1.0, v3n, u))
computed v4n = 0.8 - lr * gv4
computed wv4 = 0.4 + 1.5 * abs(lerp(0.8, v4n, u))
computed a1n = 1.6 - lr * ga1
computed wa1 = 0.4 + 1.5 * abs(lerp(1.6, a1n, u))
computed a2n = -1.1 - lr * ga2
computed wa2 = 0.4 + 1.5 * abs(lerp(-1.1, a2n, u))
computed a3n = 0.8 - lr * ga3
computed wa3 = 0.4 + 1.5 * abs(lerp(0.8, a3n, u))
computed a4n = 0.5 - lr * ga4
computed wa4 = 0.4 + 1.5 * abs(lerp(0.5, a4n, u))
computed b1n = -0.9 - lr * gb1
computed wb1 = 0.4 + 1.5 * abs(lerp(-0.9, b1n, u))
computed b2n = 1.3 - lr * gb2
computed wb2 = 0.4 + 1.5 * abs(lerp(1.3, b2n, u))
computed b3n = -0.6 - lr * gb3
computed wb3 = 0.4 + 1.5 * abs(lerp(-0.6, b3n, u))
computed b4n = 1.0 - lr * gb4
computed wb4 = 0.4 + 1.5 * abs(lerp(1.0, b4n, u))
computed c1n = 0.7 - lr * gc1
computed wc1 = 0.4 + 1.5 * abs(lerp(0.7, c1n, u))
computed c2n = 0.4 - lr * gc2
computed wc2 = 0.4 + 1.5 * abs(lerp(0.4, c2n, u))
computed c3n = 1.2 - lr * gc3
computed wc3 = 0.4 + 1.5 * abs(lerp(1.2, c3n, u))
computed c4n = -1.3 - lr * gc4
computed wc4 = 0.4 + 1.5 * abs(lerp(-1.3, c4n, u))
computed h1n = 1 / (1 + exp(-(a1n*x1 + b1n*0.3 + c1n*0.5 - 0.4)))
computed h2n = 1 / (1 + exp(-(a2n*x1 + b2n*0.3 + c2n*0.5 + 0.1)))
computed h3n = 1 / (1 + exp(-(a3n*x1 + b3n*0.3 + c3n*0.5 - 0.5)))
computed h4n = 1 / (1 + exp(-(a4n*x1 + b4n*0.3 + c4n*0.5 + 0.2)))
computed yn = 1 / (1 + exp(-(v1n*h1n + v2n*h2n + v3n*h3n + v4n*h4n - 0.6)))
computed fbx = lerp(70, 470, clamp((tt - 0.3) / 1.4, 0, 1)) - 12
computed fbo = tt >= 0.3 && tt < 1.7 ? 0.1 : 0
computed bbx = lerp(470, 70, clamp((tt - 2.6) / 2.1, 0, 1)) - 12
computed bbo = tt >= 2.6 && tt < 4.7 ? 0.12 : 0
computed gbx = lerp(70, 470, clamp((tt - 5.9) / 1.4, 0, 1)) - 12
computed gbo = tt >= 5.9 && tt < 7.3 ? 0.1 : 0
computed fA = tt >= 1.2 ? 1 : 0
computed yA = tt >= 1.7 ? 1 : 0
computed gA = tt >= 6.8 ? 1 : 0
computed yN = tt >= 7.3 ? 1 : 0
computed b2w = tt >= 2.6 && tt < 3.7 ? 1 : 0
computed b1w = tt >= 3.5 && tt < 4.8 ? 1 : 0
computed ov1 = b2w * (0.15 + 0.85 * abs(gv1) / gmax)
computed ov2 = b2w * (0.15 + 0.85 * abs(gv2) / gmax)
computed ov3 = b2w * (0.15 + 0.85 * abs(gv3) / gmax)
computed ov4 = b2w * (0.15 + 0.85 * abs(gv4) / gmax)
computed oa1 = b1w * (0.15 + 0.85 * abs(ga1) / gmax)
computed oa2 = b1w * (0.15 + 0.85 * abs(ga2) / gmax)
computed oa3 = b1w * (0.15 + 0.85 * abs(ga3) / gmax)
computed oa4 = b1w * (0.15 + 0.85 * abs(ga4) / gmax)
computed ob1 = b1w * (0.15 + 0.85 * abs(gb1) / gmax)
computed ob2 = b1w * (0.15 + 0.85 * abs(gb2) / gmax)
computed ob3 = b1w * (0.15 + 0.85 * abs(gb3) / gmax)
computed ob4 = b1w * (0.15 + 0.85 * abs(gb4) / gmax)
computed oc1 = b1w * (0.15 + 0.85 * abs(gc1) / gmax)
computed oc2 = b1w * (0.15 + 0.85 * abs(gc2) / gmax)
computed oc3 = b1w * (0.15 + 0.85 * abs(gc3) / gmax)
computed oc4 = b1w * (0.15 + 0.85 * abs(gc4) / gmax)
computed hg1 = tt < 5.9 ? fA * h1 : gA * h1n
computed dg1 = (b1w + b2w) > 0 ? 0.2 + 0.8 * abs(dh1) / gmax : 0
computed hg2 = tt < 5.9 ? fA * h2 : gA * h2n
computed dg2 = (b1w + b2w) > 0 ? 0.2 + 0.8 * abs(dh2) / gmax : 0
computed hg3 = tt < 5.9 ? fA * h3 : gA * h3n
computed dg3 = (b1w + b2w) > 0 ? 0.2 + 0.8 * abs(dh3) / gmax : 0
computed hg4 = tt < 5.9 ? fA * h4 : gA * h4n
computed dg4 = (b1w + b2w) > 0 ? 0.2 + 0.8 * abs(dh4) / gmax : 0
computed og = tt < 5.9 ? yA * y : yN * yn
computed rf = tt >= 1.7 && tt < 2.6 ? 0.4 + 0.4 * sin(tt * 12) : 0
computed py = 210 - 120 * y
computed ty = 210 - 120 * tau
computed ny = 210 - 120 * yn
computed yd = round(y, 2)
computed ynd = round(yn, 2)
computed ed = round((y - tau) * 100) / 100
computed imp = abs(yn - tau) < abs(y - tau) ? 1 : 0
computed impo = yN * imp
computed ovso = yN * (1 - imp)
template svg: <svg viewBox="0 0 560 320" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="反向传播——解剖一次训练步">
  <defs><linearGradient id="bpbg" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#12112a"/><stop offset="1" stop-color="#0c0b1d"/></linearGradient></defs>
  <rect x="0" y="0" width="560" height="320" rx="14" fill="url(#bpbg)"/>
  <text x="280" y="30" text-anchor="middle" font-size="13" letter-spacing="0.5" fill="#dfe3f7">{cap}</text>
  <rect x="{fbx}" y="48" width="24" height="216" rx="12" fill="#8b7cf8" opacity="{fbo}"/>
  <rect x="{bbx}" y="48" width="24" height="216" rx="12" fill="#ff9d5c" opacity="{bbo}"/>
  <rect x="{gbx}" y="48" width="24" height="216" rx="12" fill="#3ecf8e" opacity="{gbo}"/>
  <line x1="93" y1="90" x2="268" y2="70" stroke="#8b7cf8" stroke-width="{wa1}" opacity="0.3"/>
  <line x1="93" y1="90" x2="268" y2="70" stroke="#ff9d5c" stroke-width="2.4" opacity="{oa1}"/>
  <line x1="93" y1="90" x2="268" y2="125" stroke="#e0838f" stroke-width="{wa2}" opacity="0.3"/>
  <line x1="93" y1="90" x2="268" y2="125" stroke="#ff9d5c" stroke-width="2.4" opacity="{oa2}"/>
  <line x1="93" y1="90" x2="268" y2="180" stroke="#8b7cf8" stroke-width="{wa3}" opacity="0.3"/>
  <line x1="93" y1="90" x2="268" y2="180" stroke="#ff9d5c" stroke-width="2.4" opacity="{oa3}"/>
  <line x1="93" y1="90" x2="268" y2="235" stroke="#8b7cf8" stroke-width="{wa4}" opacity="0.3"/>
  <line x1="93" y1="90" x2="268" y2="235" stroke="#ff9d5c" stroke-width="2.4" opacity="{oa4}"/>
  <line x1="93" y1="150" x2="268" y2="70" stroke="#e0838f" stroke-width="{wb1}" opacity="0.3"/>
  <line x1="93" y1="150" x2="268" y2="70" stroke="#ff9d5c" stroke-width="2.4" opacity="{ob1}"/>
  <line x1="93" y1="150" x2="268" y2="125" stroke="#8b7cf8" stroke-width="{wb2}" opacity="0.3"/>
  <line x1="93" y1="150" x2="268" y2="125" stroke="#ff9d5c" stroke-width="2.4" opacity="{ob2}"/>
  <line x1="93" y1="150" x2="268" y2="180" stroke="#e0838f" stroke-width="{wb3}" opacity="0.3"/>
  <line x1="93" y1="150" x2="268" y2="180" stroke="#ff9d5c" stroke-width="2.4" opacity="{ob3}"/>
  <line x1="93" y1="150" x2="268" y2="235" stroke="#8b7cf8" stroke-width="{wb4}" opacity="0.3"/>
  <line x1="93" y1="150" x2="268" y2="235" stroke="#ff9d5c" stroke-width="2.4" opacity="{ob4}"/>
  <line x1="93" y1="210" x2="268" y2="70" stroke="#8b7cf8" stroke-width="{wc1}" opacity="0.3"/>
  <line x1="93" y1="210" x2="268" y2="70" stroke="#ff9d5c" stroke-width="2.4" opacity="{oc1}"/>
  <line x1="93" y1="210" x2="268" y2="125" stroke="#8b7cf8" stroke-width="{wc2}" opacity="0.3"/>
  <line x1="93" y1="210" x2="268" y2="125" stroke="#ff9d5c" stroke-width="2.4" opacity="{oc2}"/>
  <line x1="93" y1="210" x2="268" y2="180" stroke="#8b7cf8" stroke-width="{wc3}" opacity="0.3"/>
  <line x1="93" y1="210" x2="268" y2="180" stroke="#ff9d5c" stroke-width="2.4" opacity="{oc3}"/>
  <line x1="93" y1="210" x2="268" y2="235" stroke="#e0838f" stroke-width="{wc4}" opacity="0.3"/>
  <line x1="93" y1="210" x2="268" y2="235" stroke="#ff9d5c" stroke-width="2.4" opacity="{oc4}"/>
  <line x1="292" y1="70" x2="444" y2="150" stroke="#8b7cf8" stroke-width="{wv1}" opacity="0.3"/>
  <line x1="292" y1="70" x2="444" y2="150" stroke="#ff9d5c" stroke-width="2.4" opacity="{ov1}"/>
  <line x1="292" y1="125" x2="444" y2="150" stroke="#e0838f" stroke-width="{wv2}" opacity="0.3"/>
  <line x1="292" y1="125" x2="444" y2="150" stroke="#ff9d5c" stroke-width="2.4" opacity="{ov2}"/>
  <line x1="292" y1="180" x2="444" y2="150" stroke="#8b7cf8" stroke-width="{wv3}" opacity="0.3"/>
  <line x1="292" y1="180" x2="444" y2="150" stroke="#ff9d5c" stroke-width="2.4" opacity="{ov3}"/>
  <line x1="292" y1="235" x2="444" y2="150" stroke="#8b7cf8" stroke-width="{wv4}" opacity="0.3"/>
  <line x1="292" y1="235" x2="444" y2="150" stroke="#ff9d5c" stroke-width="2.4" opacity="{ov4}"/>
  <circle cx="80" cy="90" r="13" fill="#141a36" stroke="#7aa2ff" stroke-opacity="0.6" stroke-width="1.5"/>
  <circle cx="80" cy="90" r="9" fill="#9db4ff" opacity="{x1}"/>
  <circle cx="80" cy="150" r="13" fill="#141a36" stroke="#7aa2ff" stroke-opacity="0.6" stroke-width="1.5"/>
  <circle cx="80" cy="150" r="9" fill="#9db4ff" opacity="0.3"/>
  <circle cx="80" cy="210" r="13" fill="#141a36" stroke="#7aa2ff" stroke-opacity="0.6" stroke-width="1.5"/>
  <circle cx="80" cy="210" r="9" fill="#9db4ff" opacity="0.5"/>
  <circle cx="280" cy="70" r="12" fill="#141a36" stroke="#7aa2ff" stroke-opacity="0.6" stroke-width="1.5"/>
  <circle cx="280" cy="70" r="8" fill="#9db4ff" opacity="{hg1}"/>
  <circle cx="280" cy="70" r="16" fill="none" stroke="#ff9d5c" stroke-width="1.5" opacity="{dg1}"/>
  <circle cx="280" cy="125" r="12" fill="#141a36" stroke="#7aa2ff" stroke-opacity="0.6" stroke-width="1.5"/>
  <circle cx="280" cy="125" r="8" fill="#9db4ff" opacity="{hg2}"/>
  <circle cx="280" cy="125" r="16" fill="none" stroke="#ff9d5c" stroke-width="1.5" opacity="{dg2}"/>
  <circle cx="280" cy="180" r="12" fill="#141a36" stroke="#7aa2ff" stroke-opacity="0.6" stroke-width="1.5"/>
  <circle cx="280" cy="180" r="8" fill="#9db4ff" opacity="{hg3}"/>
  <circle cx="280" cy="180" r="16" fill="none" stroke="#ff9d5c" stroke-width="1.5" opacity="{dg3}"/>
  <circle cx="280" cy="235" r="12" fill="#141a36" stroke="#7aa2ff" stroke-opacity="0.6" stroke-width="1.5"/>
  <circle cx="280" cy="235" r="8" fill="#9db4ff" opacity="{hg4}"/>
  <circle cx="280" cy="235" r="16" fill="none" stroke="#ff9d5c" stroke-width="1.5" opacity="{dg4}"/>
  <circle cx="460" cy="150" r="18" fill="none" stroke="#e0838f" stroke-width="2" opacity="{rf}"/>
  <circle cx="460" cy="150" r="16" fill="#141a36" stroke="#ffd98a" stroke-opacity="0.7" stroke-width="1.5"/>
  <circle cx="460" cy="150" r="11" fill="#ffd98a" opacity="{og}"/>
  <line x1="520" y1="90" x2="520" y2="210" stroke="#3f4a78" stroke-width="1.5"/>
  <line x1="514" y1="{ty}" x2="526" y2="{ty}" stroke="#ffd98a" stroke-width="2.5"/>
  <text x="532" y="{ty}" dy="3" font-size="7.5" fill="#ffd98a">目标</text>
  <circle cx="520" cy="{py}" r="4" fill="#a795fb" opacity="{yA}"/>
  <circle cx="520" cy="{ny}" r="4" fill="#3ecf8e" opacity="{yN}"/>
  <text x="30" y="30" font-size="10" fill="#7c82a3" opacity="{yA}">预测 {yd} · 误差 {ed}</text>
  <text x="30" y="46" font-size="10" fill="#7fe0b2" opacity="{yN}">新预测 {ynd}</text>
  <text x="460" y="188" text-anchor="middle" font-size="8.5" fill="#8a93b8">预测值</text>
  <text x="460" y="115" text-anchor="middle" font-size="12" font-weight="700" fill="#7fe0b2" opacity="{impo}">更近了 ✓</text>
  <text x="460" y="115" text-anchor="middle" font-size="12" font-weight="700" fill="#ffd98a" opacity="{ovso}">冲过头了！</text>
  <text x="80" y="270" text-anchor="middle" font-size="9.5" letter-spacing="1.5" fill="#6f7ba3">输入层</text>
  <text x="280" y="270" text-anchor="middle" font-size="9.5" letter-spacing="1.5" fill="#6f7ba3">隐层</text>
  <text x="460" y="270" text-anchor="middle" font-size="9.5" letter-spacing="1.5" fill="#6f7ba3">输出层</text>
  <text x="280" y="300" text-anchor="middle" font-size="9" fill="#6f7ba3">真微积分 · 橙色亮度 = 每条权重的真实梯度 · 粗细按 −lr·∇ 挪动</text>
</svg>
```
