Learning objectives
Students will be able to:
-
01
Weight × input + bias
Calculate a node's output as the weight times the input plus the bias, and connect the weight to slope and the bias to the starting value.
-
02
Negative weights
Explain why a weight is negative when the output goes down as the input goes up.
-
03
Making a decision
Describe how an activation function holds any negative value at zero, so a network can switch something off.
Prerequisite knowledge
Before starting, students should be comfortable with:
- Multiplying and adding with negative numbers, such as -1 × 6 + 4.
- Multiplying a decimal by a whole number, such as 0.75 × 4.
- Seeing a rule like "$2 to start plus $0.75 a mile" as a starting amount plus a rate. Students who know y = mx + b will see it at once; those who don't will meet it here.
- Clicking, and typing a number, on a computer or tablet. Students can share one device between two.
Finding y = mx + b · 45–60 minutes
Class Activity
Introduction for students
Ask the class where AI has made a prediction for them today: a map's arrival time, a recommended video, a phone finishing a sentence. Each comes from a neural network, and today the class will find out that the core of one is an equation they already know.
Pose a problem without a computer. "A bus costs $2.00 to board and $0.75 for each mile. What does a 4-mile ride cost?" Students will get $5.00. Write it on the board as 0.75 × 4 + 2 = 5, and then as y = mx + b. Explain that a network writes the same thing as weight × input + bias.
Open The Zoo Visitors Predictor 02 on the board and name its parts: the input value on the left, the connection's weight, and the output value on the right. Beside each output is its target output, the real answer the network should match.
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 of the network: its prediction.
- Target output
- The real answer. The network's output should match it.
- Activation function
- A rule applied to a node's value. Here, it turns any negative value into zero.
Guiding the activity
Change the weight
Pairs open The Zoo Visitors Predictor 02. The network thinks each hour of sunshine brings 200 visitors, but the targets say 240. Students click the weight, change it to 240, and step through all four inputs. When an output matches its target, the double lines between them turn green.
Add a bias
Next, The Bus Fare Calculator 01, which only asks students to observe. The weight is 0.75 and the bias is 2. Before each step, ask partners to predict the fare: $2.75, $3.50, $4.25, $5.00. Point out that the bias is added to every fare, the way b moves every point of a line up by the same amount.
Hold it at zero
The Ice Cream Sales Predictor has a weight of 1 and a bias of -60, and an activation function. At 70 degrees the node works out 70 - 60 = 10 ice creams. At 50 degrees it works out -10, and the activation function turns that into 0: no one sells negative ice creams. Ask students to find the temperature where sales begin (60 degrees).
Set the frost warning
Last, The Frost Warning Detector asks students to set both the weight and the bias. The warning grows as it gets colder, so coach with questions: "As the temperature goes up, does the warning go up or down? So is the weight positive or negative?" The answer is a weight of -1 and a bias of 4. At 6 degrees the node works out -2, and the activation function holds it at zero.
-
The Zoo Visitors Predictor 02
This network predicts how many people visit a zoo based on the amount of sunshine. The input value is the hours of sunshine. The output value is the number of visitors. Right now, this network thinks each hour of sunshine brings 200 visitors. Edit the connection's weight so that each hour of sunshine brings 240 visitors.
Open lesson -
The Bus Fare Calculator 01
This network predicts the bus fare based on the number of miles traveled. The input value is the number of miles. The output value is the bus fare. It costs $2.00 to board the bus and $0.75 for each mile traveled. Observe how the bias adds the cost of boarding to every fare, then repeat with the other input values.
Open lesson -
The Ice Cream Sales Predictor
This network predicts ice cream sales based on the temperature outside. The input value is the temperature. The output value is the ice creams sold. None are sold below 60 degrees. Its activation function sets any negative value to zero after the bias is added. Observe how the activation function works as you step through the inputs.
Open lesson -
The Frost Warning Detector
This network warns gardeners about frost. The input value is the temperature. The output value is the warning level, which grows below 4 degrees. Edit the weight and bias so the output values match the target values. The activation function holds anything below zero at zero.
Open lesson
Post-activity discussion
-
Which part of the network is like the slope, and which is like the y-intercept?
Listen for The weight is the slope: how much the output changes for each unit of input. The bias is the starting value, the output when the input is zero.
-
Why does the frost warning need a negative weight?
Listen for Because the warning goes up as the temperature goes down.
-
What would the frost warning say at 6 degrees without its activation function?
Listen for -2, which means nothing for a warning. The activation function lets the network switch the warning off.
-
You set every weight and bias today. How could a computer find them on its own?
Listen for By comparing its outputs with the targets, measuring how far off it is, and nudging each number to make that error smaller, over and over. That is how AI learns.
Wrap up
Finish with a two-question exit ticket. First: "A node has a weight of 3 and a bias of -5. What is its output for an input of 4?" (7). Second: "What is its output for an input of 1, with an activation function that turns negatives into zero?" (3 - 5 = -2, so 0).
Close by connecting back to the start: the networks behind a map or a chatbot are made of millions of these same weight × input + bias calculations, each followed by an activation function. Students can keep exploring at iinnoo.app, where every lesson is free and needs no account.
Ready to bring iiNNoo to your classroom?
Questions or ideas? Email us at support@iinnoo.app.
Start Learning How AI Learns