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?
| fare = | 0.75 | Γ | 4 miles | + | 2 |
| y = | m | Γ | x | + | b |
| output = | weight | Γ | input | + | bias |
Middle School Β· Grades 6β8
Inside a neural network
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 network says each hour of sun brings 200 visitors. The targets say 240.
Change the weight until every output's lines turn green.
Weight 0.75, bias 2. Predict each fare before you step.
| miles | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| fare | ?$2.75 | ?$3.50 | ?$4.25 | ?$5.00 |
Middle School Β· Grades 6β8
Activity 2
Hold it at zero
Weight 1, bias -60, and an activation function that turns any negative value into zero.
No one sells negative ice creams!
At what temperature do sales begin?
Middle School Β· Grades 6β8
Challenge
Set the frost warning
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.
- As the temperature goes up, does the warning go up or down?
- So is the weight positive or negative?
- What bias makes the warning switch off at the right temperature?
Middle School Β· Grades 6β8
Discussion
- Which part of the network is like the slope, and which is like the y-intercept?
- Why does the frost warning need a negative weight?
- What would the frost warning say at 6 degrees without its activation function?
- 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.
- What is its output for an input of 4?
- 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