Deep learning
Debug vanishing updates from saturated activations in the two-layer XOR network
Page 5 reproduces and repairs the characteristic failure of the two-layer XOR network: vanishing updates from saturated activations, or reporting train accuracy only.
1Learn the idea
Read
Reproduce before you repair
Do not start with a speculative fix for the two-layer XOR network. Force the failure on purpose, save the before output, then change one cause at a time. Retries are allowed only for transient conditions—not for bad input that will fail forever on deep-learning-basics.
Read
Force the failure
def checked_dot(row,weights):
if len(row)!=len(weights): raise ValueError(f'shape {len(row)} != {len(weights)}')
return sum(a*b for a,b in zip(row,weights))
try: checked_dot([1,0],[1,2,3])
except ValueError as e: print(e)
Expected evidence: dead or dimensionally broken network. If you cannot reproduce on demand, you do not yet control the failure mode for deep-learning-basics.
Read
Repair with a reviewable diff
After repair, rerun the exact reproduction command. Keep the failing fixture as a regression seed for the observability page. For the two-layer XOR network, remember the claim you are restoring: two-layer net reaches XOR solutions that a single neuron cannot.
Read
Lab notebook: reproduce on command
Store a one-command reproduction for: vanishing updates from saturated activations, or reporting train accuracy only. The command should use XOR four-row table or a minimal mutant of it. Paste the failing output into notes/failure-before.txt (or your shell scrollback as copied text). After the fix, paste notes/failure-after.txt and keep both.
Retries belong only on transient faults. If the failure is bad input, a bad allowlist, or a logic bug in the two-layer XOR network, retrying will amplify cost without repairing trust around show why a hidden layer is required for XOR while keeping the net tiny.
Read
Worked judgment
Classify the failure as prevent, detect, contain, or recover—using this lab’s language, not a generic poster. For deep-learning-basics, the first fix should usually be detect+prevent at the boundary, because vanishing updates from saturated activations, or reporting train accuracy only is cheaper to stop early than to explain in production prose.
Read
Why this stage matters for the two-layer XOR network
At the debugging stage for deep-learning-basics, the job is narrower than finishing a product demo. You are creating one progressive evidence piece about XOR four-row table that later pages inherit without redefining success. Keep that fixture small enough to inspect by hand, keep outputs copy-pasteable as text, and refuse to narrate this baseline as if it were a production SLA: single-neuron XOR attempt recorded as failing.
For this page specifically, success looks like before/after evidence for the characteristic failure while still centering the user decision to show why a hidden layer is required for XOR while keeping the net tiny. If you cannot point to a file, command, or assertion that proves that for the two-layer XOR network, stay on this page instead of advancing.
Go deeper
Before you start
Why this matters
Describe the smallest fixture that triggers vanishing updates from saturated activations. Predict the first visible symptom (exception, wrong label, silent empty success). You will compare that prediction with the reproduction below.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.