Interactive learning demo Back to selected work
Interactive lesson · The Fire Triangle

Teach a Neural Network What Fire Needs

Heat, fuel, and oxygen must all be present for fire. Train this small network to discover that relationship one example at a time.

No machine-learning background needed. Success means watching a wrong guess improve after you teach the correct rule.

Live network map

See the lesson move through the network

3 inputs · direct connection · 1 output
+ Positive weight − Negative weight

Tap a condition above or on the map to switch it between present and missing.

Try it: click or tap an input circle to switch that condition between present (1) and missing (0). Thicker lines have more influence.

Math behind this step Waiting for a prediction
Start hereAdd each condition’s vote, then turn the total into an output confidence.
See the technical equationz = Σ(wᵢxᵢ) + bŷ = σ(z)

Choose conditions and make a prediction to see the network’s calculation in everyday language.

The simple idea

Each condition gets a vote. The network adds those votes to its starting opinion, then converts the total into a percentage.

Guided experiment

Train the network by giving it examples

A neural network learns from correction, not from being handed the rule. Complete the four steps, then repeat them with different fire conditions.

Next action Choose a Fire Triangle scenario to begin. 0 training examples completed
🔥Fire0 examples
○No oxygen0 examples
○No fuel0 examples
○No heat0 examples
★0 cyclesBalanced training
1

Choose the conditions

Start with all three ingredients present, or experiment by clicking the input circles directly on the map. A circle switches between present (1) and missing (0).

2

Ask for a prediction

The network combines the conditions currently shown on the map and returns a confidence. Try one prediction, toggle a map input, then predict again to compare.

Network confidence - Choose conditions, then predict.
3

Tell it the correct answer

First choose conditions and make a prediction. Then the Fire Triangle will provide the correct answer.

Correct answerWaiting…
Manual target controls
4

Watch what changed

The network measures how far off it was, traces the mistake backward, and adjusts each useful connection. Now toggle a map input and predict again to test the new behavior.

Before—→After— Train an example to see the confidence move.

Waiting for your first prediction

Choose a fire scenario above to begin.

Inputs

Edit input names, values, and correction strength manually

Adjust the conditions manually. For this lesson, keep each value between 0 and 1.

Correction strength controls how boldly the network changes after a mistake. The default 0.3 is easy to see while remaining stable.

Optional lab: change the network yourself

The guided Fire Triangle lesson works without these controls. Open them when you want to experiment beyond the walkthrough.

Experimental flattened-grid input

This turns grid cells into ordinary numeric inputs. It helps demonstrate input shape, but it is not a true convolutional neural network (CNN).

Architecture

What the network is changing

Importance (weight)

Each connection stores how strongly one value should support or oppose the next neuron or output. Training changes that importance after mistakes.

Starting opinion (bias)

This is the neuron's tendency before any condition votes are added. Training adjusts it too.

Confidence converter (activation)

Sigmoid turns each combined score into a 0–100% signal. Only the final layer produces the named output confidences.

Tracing the mistake backward (backpropagation)

The network compares every output with its correct answer, assigns responsibility through the hidden layers, then adjusts from the outputs back toward the inputs.

Open technical inspector

Optional: inspect or edit every number after you understand the guided training loop.

Weights and biases

These values update after every training example.

Training history