Grades 6–8

The Equation Inside an AI

Inside every neural network is an equation you already know.

Where did AI predict for you today?

πŸ—ΊοΈ

Maps

Your arrival time.

πŸ“Ί

Videos

The next video to watch.

πŸ’¬

Texting

The rest of your sentence.

Each of these comes from a neural network. Let's find out what is at its core.

Middle School Β· Grades 6–8

Ride the bus

A bus costs $2.00 to board and $0.75 for each mile. What does a 4-mile ride cost?

0.75 Γ— 4 + 2 = ?$5.00
fare =0.75Γ—4 miles+2
y =mΓ—x+b
output =weightΓ—input+bias

Middle School Β· Grades 6–8

Inside a neural network

0.75 4 miles 5 dollarsbias 2 5 target

Weight

Multiplies the input, like the slope m.

Bias

Added after multiplying, like the starting value b.

Target output

The real answer the output should match.

Middle School Β· Grades 6–8

Key vocabulary

Neural network
A kind of AI that makes predictions by passing numbers along connections, multiplying and adding them.
Input value
The number that goes into the network, such as the miles ridden.
Weight
The number on a connection. The input is multiplied by it, like the slope m.
Bias
A number added after multiplying, like the starting value b.
Output value
The number that comes out: the network's prediction.
Target output
The real answer. The output should match it.
Activation function
A rule applied to a node's value. Here, it turns any negative value into zero.

Middle School Β· Grades 6–8

Activity 1

Weight and bias

The Zoo Visitors Predictor 02 Forward Propagation tab β†—

The network says each hour of sun brings 200 visitors. The targets say 240.

Change the weight until every output's lines turn green.

The Bus Fare Calculator 01 Forward Propagation tab β†—

Weight 0.75, bias 2. Predict each fare before you step.

miles1234
fare?$2.75?$3.50?$4.25?$5.00

Middle School Β· Grades 6–8

Activity 2

Hold it at zero

The Ice Cream Sales Predictor Forward Propagation tab β†—

Weight 1, bias -60, and an activation function that turns any negative value into zero.

70 degrees: 1 Γ— 70 - 60 = 10 ice creams
50 degrees: 1 Γ— 50 - 60 = ?-10 β†’ 0

No one sells negative ice creams!

At what temperature do sales begin?

Middle School Β· Grades 6–8

Challenge

Set the frost warning

The Frost Warning Detector Forward Propagation tab β†—

This time, you set both the weight and the bias. The warning should grow as it gets colder, and switch off when it's warm.

  1. As the temperature goes up, does the warning go up or down?
  2. So is the weight positive or negative?
  3. What bias makes the warning switch off at the right temperature?

Middle School Β· Grades 6–8

Discussion

  1. Which part of the network is like the slope, and which is like the y-intercept?
  2. Why does the frost warning need a negative weight?
  3. What would the frost warning say at 6 degrees without its activation function?
  4. You set every weight and bias today. How could a computer find them on its own?

Middle School Β· Grades 6–8

Exit ticket

A node has a weight of 3 and a bias of -5.

  1. What is its output for an input of 4?
  2. What is its output for an input of 1, with an activation function that turns negatives into zero?

The AI behind a map or a chatbot is millions of these same calculations. Keep exploring at iinnoo.app.

Middle School Β· Grades 6–8