Artificial intelligence often works by using many small math units called artificial neurons. Each neuron takes in numbers, gives some inputs more importance than others, and produces an output. When many neurons are connected, they form a neural network that can learn patterns in data.
This matters because neural networks help power tools like image recognition, language translation, recommendations, and scientific data analysis.
A weight is a number that controls how strongly one input affects a neuron. During training, the network compares its prediction with the correct answer, measures the error, and adjusts the weights to improve. Repeating this process with many examples helps the model learn useful relationships instead of being programmed with every rule by hand.
The basic idea combines computer science, algebra, and statistics.
Key Facts
- A neuron computes a weighted sum: z = w1x1 + w2x2 + ... + b.
- The activation function changes the weighted sum into the neuron output: a = f(z).
- A weight w tells how strongly an input x affects a prediction.
- A bias b shifts the neuron output, similar to the y-intercept in a line.
- Prediction error can be measured by loss, such as squared error: loss = (predicted - actual)^2.
- Training updates weights to reduce loss, often using a rule like new weight = old weight - learning rate × gradient.
Vocabulary
- Artificial neuron
- An artificial neuron is a math unit that combines inputs with weights, adds a bias, and produces an output.
- Weight
- A weight is a number that shows how important an input is to a neuron or model prediction.
- Bias
- A bias is an added number that shifts a neuron's result before the activation function is applied.
- Activation function
- An activation function is a rule that converts a neuron's weighted sum into an output signal.
- Training
- Training is the process of adjusting weights and biases so a model makes better predictions on examples.
Common Mistakes to Avoid
- Treating weights as fixed facts is wrong because weights are learned values that change during training.
- Ignoring the bias term is wrong because the bias can shift the neuron's output even when inputs are small or zero.
- Assuming bigger weights are always better is wrong because large weights can overemphasize one input and may cause poor predictions on new data.
- Thinking a neural network memorizes all answers is wrong because the goal is to learn patterns that generalize to examples it has not seen before.
Practice Questions
- 1 A neuron has inputs x1 = 3 and x2 = 2, weights w1 = 0.5 and w2 = -1, and bias b = 4. Find z = w1x1 + w2x2 + b.
- 2 A model predicts 0.8 for an example whose actual value is 1.0. Use loss = (predicted - actual)^2 to calculate the squared error.
- 3 A network performs very well on its training examples but poorly on new examples. Explain what this suggests about the weights and how collecting more varied data or using a simpler model might help.