Grades 3–5

How a Computer Makes a Prediction

For three days, we open up an AI and see what's inside. Spoiler: it's mostly multiplication.

Day 1

Inputs, weights and outputs

Computers make predictions

A prediction is a guess about something we don't know yet, made from something we do know.

🌧️

Weather

The weather app says it will rain.

πŸ“Ί

Videos

A video site picks your next video.

πŸ’¬

Words

A phone guesses your next word.

Where has a computer made a prediction for you?

Elementary School Β· Grades 3–5

Let's make a prediction

A zoo gets more visitors when it's sunny.

1 hour of sun β†’ 200 visitors
3 hours of sun β†’ ?600 visitors

How did you know? You multiplied 3 Γ— 200.

That is exactly what a neural network does!

Elementary School Β· Grades 3–5

Inside a neural network

200 3 hours of sun ?600 visitors

Input value

The number that goes in: 3 hours of sun.

Weight

The number on the connection. The input is multiplied by it.

Output value

The number that comes out: the prediction.

Elementary School Β· Grades 3–5

Words to know

AI
Computer programs that do things that usually take human thinking.
Prediction
A guess about something we don't know yet.
Neural network
A kind of AI that passes numbers along connections and multiplies them.
Input value
The number that goes into the network.
Weight
The number on a connection. The input is multiplied by it.
Output value
The number that comes out: the network's prediction.

Elementary School Β· Grades 3–5

Activity

Predict the cricket chirps

The Cricket Chirp Predictor Forward Propagation tab β†—

Crickets chirp faster when it's warm: 6 more chirps for every degree. So the weight is 6.

  1. Work out the output on paper.
  2. Type in your prediction.
  3. Step on to check.
6 15 degrees ?90 chirps

Say your multiplication out loud to your partner!

Elementary School Β· Grades 3–5

Spot the pattern

degrees15202530
chirps90120150180

What do you add each time? Why does that work?

Each input is 5 degrees warmer, and 5 Γ— 6 = 30.

Elementary School Β· Grades 3–5

Let's talk

  1. What are the three parts of the network we used today?
  2. What would the cricket network say at 10 degrees?
  3. What would change if crickets chirped 7 times a minute for each degree?

Elementary School Β· Grades 3–5

Day 2

Fixing a network that's wrong

Today the weights are wrong!

πŸ€”

Output value

The network's guess.

🎯

Target output

The real answer: what actually happened.

βœ…

A match

When the guess and the real answer match, the lines turn green.

Your job: fix the weights!

Elementary School Β· Grades 3–5

Words to know

Target output
The real answer. The output should match it.
Tuning
Changing a weight, a little at a time, until the outputs match the targets.

Elementary School Β· Grades 3–5

Activity

Fix the phone battery

The Phone Battery Predictor Forward Propagation tab β†—

The weight is wrong! A 1-hour video really uses 12% of the battery.

  1. Click the weight. Change it.
  2. Step through all four videos.
  3. Green lines mean it matches!
5 1 hours 5 battery % 12 target

Too big or too small? Should the weight go up or down?

Elementary School Β· Grades 3–5

Activity

Two outputs, two weights

The Smoothie Stand Predictor Forward Propagation tab β†—

One input, the temperature, now makes two predictions: smoothies and popsicles.

Each output has its own weight. Find both!

11 1 degrees 1 smoothies 1 popsicles

Elementary School Β· Grades 3–5

Share the shortcut

Did you find a faster way than guessing? Some people divide the target by the input.

12 Γ· 1 = ?12

Would that still work with two inputs?

Elementary School Β· Grades 3–5

Let's talk

  1. How did you know which way to change the weight?
  2. Why test all four inputs, not just one?
  3. What did you do each time you got it wrong?

Elementary School Β· Grades 3–5

Day 3

Two inputs at once

Two inputs at once

What decides how many butterflies visit a garden? Often more than one thing.

Multiply each input by its weight, then add.

3 Γ— 1 + 4 Γ— 2 = ?11
12 3 flower beds 4 bushes ?11 butterflies

Elementary School Β· Grades 3–5

Words to know

Input values
The numbers that go in. A network can have more than one.
Connection
The line that carries a number from an input to an output.
Total
Each input times its weight, added together.

Elementary School Β· Grades 3–5

Activity 1

One weight to change

The Butterfly Count Predictor Forward Propagation tab β†—

Make each bush count twice as much as each flower bed.

  1. The flower bed weight is already 1.
  2. What should the bush weight be? Change it.
  3. Check it works for all four gardens.

Elementary School Β· Grades 3–5

Activity 2

Both weights to find

The Tomato Harvest Predictor Forward Propagation tab β†—

Find the weight for each hour of sun and each liter of water. Both are between 0 and 1.

Β½

0.5 is a half

Like half a pizza.

ΒΌ

0.25 is a quarter

Like a quarter of a pizza.

1

One at a time

Change one weight, then check.

Elementary School Β· Grades 3–5

Done early?

What does each weight mean?

The Honey Harvest Predictor Sample Networks tab β†—

The Honey Harvest Predictor has two weights: 0.28 and 0.45.

0.28: ?kilograms of honey for each flower nearby
0.45: ?kilograms for each day in the month

Elementary School Β· Grades 3–5

Let's talk

  1. In the tomato garden, which matters more: an hour of sun or a liter of water?
  2. What does a bigger weight tell us about an input?
  3. Why was this harder than one input?

Elementary School Β· Grades 3–5

Design your own network

Pick something to predict from your own life, like minutes of reading and pages read.

  1. Choose the input it depends on.
  2. Choose a weight.
  3. Work out the output for two different inputs.
  4. Share it with the class!

Elementary School Β· Grades 3–5

How does a computer make a prediction?

It multiplies each input by a weight and adds them up.

It gets better by checking its answers and adjusting its weights.

Keep exploring at iinnoo.app

Elementary School Β· Grades 3–5