Neural nets by building
Measure whether the single-neuron trainer works
Page 4 turns “it ran” into executable checks for the single-neuron logic-gate trainer.
1Learn the idea
Read
Make the metric executable
Translate the claim into assertions or a tiny eval harness. The metric to protect is: final predictions match gate table; loss decreases across epochs. Always record the denominator (how many cases) beside any rate. A percentage without a denominator is marketing, not measurement.
Read
Run the checks
pred=[0.06,0.98,0.98,1.0]; truth=[0,1,1,1]
labels=[int(p>=.5) for p in pred]
assert labels==truth
print('accuracy',sum(a==b for a,b in zip(labels,truth))/4)
Expected evidence: neuron that will not learn OR. A passing assertion proves only the behavior it names; broader usefulness still needs the chapter’s full limits.
Read
Say what the metric does not prove
Be explicit: beating the baseline (untrained weight predictions on the gate table) on this fixture does not prove behavior under learning rate so large weights diverge, or claiming XOR success with one neuron. Label observations separately from conclusions so the next page inherits honest evidence about the single-neuron trainer.
Read
Lab notebook: denominator discipline
Compute final predictions match gate table; loss decreases across epochs with the denominator written beside the rate every time. For this chapter, the evaluation set is intentionally tiny; that is allowed only if you say so in the evidence. Compare against untrained weight predictions on the gate table before celebrating.
Add one negative case aimed at learning rate so large weights diverge, or claiming XOR success with one neuron. A suite with only happy cases cannot protect the single-neuron trainer when the characteristic failure appears in review.
Read
Worked judgment
If a check is expensive or flaky, shrink it until it is deterministic on AND gate truth table. Flaky green builds teach the team to ignore gates. Record what this page does not prove so security-ops and mastery-ship inherit honest limits.
Read
Why this stage matters for the single-neuron trainer
At the evaluation stage for neural-nets-by-building, the job is narrower than finishing a product demo. You are creating one progressive evidence piece about AND gate truth 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: untrained weight predictions on the gate table.
For this page specifically, success looks like metrics with explicit denominators and a negative case while still centering the user decision to learn weights for a linearly separable gate by gradient steps you can print. If you cannot point to a file, command, or assertion that proves that for the single-neuron trainer, stay on this page instead of advancing.
Read
Chapter consolidation 1
Return to the neural nets by building scenario and restate what this chapter proved on page validation.mdx. Name one metric, one ownership rule, and one regression test you will keep. Explain how this page connects to the previous page without repeating earlier paragraphs. If you cannot name a falsifier, the chapter is still a story rather than a controlled practice. Write the falsifier as an observable event with a threshold.
Read
Chapter consolidation 2
Return to the neural nets by building scenario and restate what this chapter proved on page validation.mdx. Name one metric, one ownership rule, and one regression test you will keep. Explain how this page connects to the previous page without repeating earlier paragraphs. If you cannot name a falsifier, the chapter is still a story rather than a controlled practice. Write the falsifier as an observable event with a threshold.
Read
Chapter consolidation 3
Return to the neural nets by building scenario and restate what this chapter proved on page validation.mdx. Name one metric, one ownership rule, and one regression test you will keep. Explain how this page connects to the previous page without repeating earlier paragraphs. If you cannot name a falsifier, the chapter is still a story rather than a controlled practice. Write the falsifier as an observable event with a threshold.
Go deeper
Before you start
Why this matters
Write one independent check that would catch a fake pass for this lab. Prefer a check tied to final predictions match gate table; loss decreases across epochs over a check that only asserts “no exception.”
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.