Deep learning
Ship and explain the two-layer XOR network
Page 8 packages proved vs unproved evidence so another engineer can run, trust, or reject the two-layer XOR network.
1Learn the idea
Read
Assemble the ship record
A shippable lab artifact includes: how to run it, the metric result (all four XOR cases correct after training; single-neuron baseline fails), the failure you can still reproduce (vanishing updates from saturated activations, or reporting train accuracy only), the security gate for scaling the toy net's accuracy language to production vision claims, and a rollback note. The user decision it supports remains: show why a hidden layer is required for XOR while keeping the net tiny.
Read
Freeze the evidence
def predict(a,b): return int(max(0,a-b)+max(0,b-a)>=.5)
cases={(0,0):0,(0,1):1,(1,0):1,(1,1):0}
assert all(predict(*x)==y for x,y in cases.items())
print('XOR network ready')
Expected evidence: stage evidence for mastery ship. Store this beside the fixture version so scores remain meaningful after content changes in deep-learning-basics.
Read
Explain limits without apology
State operating limits for the two-layer XOR network in plain language: fixture size, offline vs live dependencies, and what would require a new eval set. Shipping deep-learning-basics is honest scoping, not maximal confidence language.
Read
Lab notebook: proved vs unproved
Fill this table in your notes for the two-layer XOR network:
- Proved on
XOR four-row table: … - Unproved beyond the fixture: …
- Metric that blocks release: all four XOR cases correct after training; single-neuron baseline fails
- Failure still reproducible: vanishing updates from saturated activations, or reporting train accuracy only
- Security gate: scaling the toy net's accuracy language to production vision claims
- Rollback: …
Ship the narrative only when the unproved list is honest. Reviewers trust narrow claims that support show why a hidden layer is required for XOR while keeping the net tiny more than maximal language that collapses under the first production oddity.
Read
Worked judgment
Hand your ship note to a peer and ask them to recreate a proved/unproved ship note with rollback without watching you type. If they cannot, your evidence is still tribal knowledge. Tighten the run command and the metric line until a stranger can validate the two-layer XOR network against XOR four-row table.
Read
Why this stage matters for the two-layer XOR network
At the mastery and shipping 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 a proved/unproved ship note with rollback 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
List two things this chapter proved on the fixture and two things it did not prove about the two-layer XOR network. If you cannot name the gaps, you are not ready to ship the narrative—even if the code runs.
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.