Page 1 of 8~112 min topic

Neural nets by building

Frame the single-neuron trainer experiment

Page 1 sets a falsifiable claim for the single-neuron logic-gate trainer before any implementation work begins.

~14 min this pageExperiment brief

1Try it yourself

Playground

Neural nets by building

Start with one neuron, then flip to a tiny 2-layer net — watch the decision field.

z = 0.90 · sigmoid = 0.71 (yes)

2Learn the idea

Read

Name the deliverable and claim

Success is not “I followed the tutorial.” Success is producing evidence that: after training, AND (or OR) inputs map to the expected 0/1 outputs. The accepted input is narrow on purpose: binary input pairs, target gate outputs, learning rate, epochs. That narrowness is what lets you inspect every field and prevents a toy demo from being narrated as a production system.

Record the baseline you must beat: untrained weight predictions on the gate table. If the finished artifact cannot beat that baseline on the fixture below, stop and revise the claim before writing more code.

Read

Inventory the fixture

samples=[((0,0),0),((0,1),1),((1,0),1),((1,1),1)]
print(samples)

Expected evidence: the four OR truth-table pairs. Treat the printout as a claim about this fixture, not as proof that the toolchain merely started.

Read

Spot misleading success early

For the single-neuron logic-gate trainer, a decorative win often looks like a clean run that never checks final predictions match gate table; loss decreases across epochs. Write the metric down now so later pages cannot redefine success after the fact. Also note the operational threat you will eventually gate on: hard-coding 'trained' weights without a verifiable training loop.

Read

Lab notebook: claim before code

For neural-nets-by-building, write the claim on a sticky note in this exact shape: “Given binary input pairs, target gate outputs, learning rate, epochs, the single-neuron trainer will …”. Fill the ellipsis with the observable part of: after training, AND (or OR) inputs map to the expected 0/1 outputs. Tape the baseline beside it: untrained weight predictions on the gate table. If someone later replaces your metric with a vibe check, the sticky note is how you push back.

Also sketch the one-sentence user story: a person uses this output to learn weights for a linearly separable gate by gradient steps you can print. If that sentence needs a dashboard, a model zoo, or five services, the lab scope is too wide—shrink the fixture (AND gate truth table) until the story fits on one screen.

Read

Worked judgment

Decide now whether live network calls are allowed on page 1. For this lab they usually are not; inventory and contracts should run offline against AND gate truth table. Note the metric you will eventually require (final predictions match gate table; loss decreases across epochs) so page 4 cannot invent a softer target. The characteristic failure to keep in mind is learning rate so large weights diverge, or claiming XOR success with one neuron.

Read

Why this stage matters for the single-neuron trainer

At the experiment brief 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 a falsifiable claim and baseline written before coding 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.

Glossary: deep learning · Glossary: gradient descent

Next

Go deeper

Before you start

Why this matters

On paper, write the user decision this lab supports: learn weights for a linearly separable gate by gradient steps you can print. Then write one sentence naming what could look successful while actually being wrong for this claim—focus on learning rate so large weights diverge, or claiming XOR success with one neuron. Keep both sentences beside the fixture inventory you run next.

Check your understanding

Page assessment

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

1. What exact claim can this fixture disprove?
2. Which baseline prevents a decorative success story?
3. What result would make you stop before implementation?
4. Did you name the metric (final predictions match gate table) up front?

All responses are required.