Welcome to building neural networks from scratch! We're starting with the smallest building block: a single neuron.
Think of a neuron as a tiny function that takes in information, processes it, and gives you an answer.
In math, you can think of a neuron as a function:
f(a, b, c)
Engagement Message
Ready to see how this works?
A neuron receives multiple inputs—like different pieces of information. Imagine you're deciding whether to go outside based on temperature, rain, and wind.
Each input is a number:
f(temperature, rain, wind)
Engagement Message
What are some other decisions where you consider multiple factors?
Not all inputs matter equally! A neuron assigns a weight to each input.
Mathematically, this looks like:
f(w₁ × a, w₂ × b, w₃ × c)
Engagement Message
Which factor would you give the highest weight when deciding to go outside?
There's one more component: bias. Think of bias as the neuron's starting opinion before considering any inputs.
Now our function looks like:
f(w₁ × a, w₂ × b, w₃ × c) + b
Engagement Message
Do you tend to be more of a homebody or an adventurer?
Now for the calculation! A neuron multiplies each input by its weight, adds them up, then adds the bias.
This is called a dot product:
(a × w₁) + (b × w₂) + (c × w₃) + b
Engagement Message
In your own words, what does the dot product tell the neuron?
The result from our calculation is just a number—but neurons usually pass this through an activation function to make the final decision.
For now, let's focus on getting that basic calculation right:
output = (a × w₁) + (b × w₂) + bias
Engagement Message
Ready to practice with some real numbers?
Type
Fill In The Blanks
Markdown With Blanks
Let's calculate a neuron's output! A neuron has 2 inputs: temperature (70°F) and rain (0 = no rain). The weights are 0.5 for temperature and -2 for rain. The bias is -10.
Complete the calculation:
Suggested Answers
- 0.5
- -2
- -10
- 25
