Page 6 of 8~112 min topic

Deep learning

Instrument the two-layer XOR network

Page 6 adds signals that distinguish bad input from component failure in the two-layer XOR network.

~14 min this pageTesting and observability

1Learn the idea

Read

Emit stage signals

Instrument the two-layer XOR network so a run records enough structure to debug offline: counts, latency if relevant, pass/fail of all four XOR cases correct after training, and a stable stage name. Redact secrets and raw credentials from every event.

Read

Emit and assert

activations=[[0,0],[0,1],[1,0],[0,0]]
coverage=[sum(row[j]>0 for row in activations)/len(activations) for j in range(2)]
print({'hidden_coverage':coverage}); assert min(coverage)>0

Expected evidence: stage evidence for observability. Prefer JSON or structured text you can grep in CI over prose logs for deep-learning-basics.

Read

Lock signals with a regression test

Turn one historical failure—especially vanishing updates from saturated activations—into a test that fails if the signal disappears for the two-layer XOR network. Observability without a failing test is optional decoration; observability with a test is part of the deep-learning-basics artifact.

Read

Lab notebook: signal schema

Draft a three-field event for the two-layer XOR network: stage, ok, and one domain field derived from all four XOR cases correct after training; single-neuron baseline fails. Add fixture_id or docs_version when content can change. Explicitly list fields that must never appear (tokens, passwords, raw prompts) because scaling the toy net's accuracy language to production vision claims is in scope for this lab.

Wire one assertion that fails if the two-layer XOR network event is missing after a run. Observability that cannot fail a test will not survive contact with a busy deep-learning-basics repository.

Read

Worked judgment

Imagine a teammate opens only your event stream after a bad deploy. Could they tell whether XOR four-row table was wrong, whether vanishing updates from saturated activations, or reporting train accuracy only returned, or whether scaling the toy net's accuracy language to production vision claims slipped through? If not, rename fields until those three stories are distinguishable.

Read

Why this stage matters for the two-layer XOR network

At the testing and observability 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 structured event schema locked by a test 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.

Glossary: deep learning · Glossary: loss function

Previous · Next

Go deeper

Before you start

Why this matters

Write the single log line or metric event that would tell you whether a bad result came from input vs implementation for the two-layer XOR network. If your line could not tell them apart, redesign it before coding.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Can input faults be distinguished from component faults in the event?
2. Are secrets redacted from logs?
3. Is there a test that fails if the signal vanishes?
4. Does the event still reference the decision: show why a hidden layer is required for XOR while keeping the net tiny?

All responses are required.