All demos

Neural Net Training

Neural net basics
Gradient descent activity

Watch gradient descent discover a rule

This network starts with imperfect weights and improves by comparing its answers with the target table. Training changes the connection strengths a little at a time to reduce loss.

Try this
  1. Choose a starting-weight option and inspect the initial results.
  2. Train one round and watch loss, accuracy, and weights change.
  3. Compare the results, then repeat the same cycle with the three-input model below.

Training Goal

Gradient descent

Use gradient descent to learn the same cereal and salsa rule. The model should accept either food alone and reject both foods together or neither food.

Choose starting weights, train in rounds, and watch the probabilities, loss, and connection strengths change.

Training Controls

Soft neurons
Epoch 0
Loss 0.000
Correct 0 of 4

Trainable Network

Editable weights
Inputs Outputs Cereal: 0 Salsa: 0 h1 sum 0, out 0 h2 sum 0, out 0 Accept p 0.00 Reject p 0.00

Training Results

0 of 4 correct

Click a row or toggle an input box to inspect one case. The table uses the current weights and probabilities.

Accept probability comes from comparing the Accept score with the Reject score; it is higher when Accept is winning by more.

Cereal Salsa Target Accept probability Network says Match

Selected Row

Adding One More Input

Three inputs

This second model adds chips, which makes the rule less like a single simple switch. The network has to learn that chips are fine with salsa, but not with cereal.

Repeat the same cycle: set a starting point, train, then use the eight-row result table to see what changed.

Three-Input Training Controls

Gradient descent
Epoch 0
Loss 0.000
Correct 0 of 8

Three-Input Network

Editable weights
Inputs Outputs Cereal: 0 Salsa: 0 Chips: 0 h1 sum 0, out 0 h2 sum 0, out 0 h3 sum 0, out 0 Accept p 0.00 Reject p 0.00

Three-Input Results

0 of 8 correct

Click a row or toggle input boxes to inspect one food combination. Training tries to lower loss across all eight rows.

Accept probability comes from comparing the Accept score with the Reject score; it is higher when Accept is winning by more.

Cereal Salsa Chips Target Accept probability Network says Match

Selected Row