An introduction to the building blocks of deep learning: the artificial neuron and simple network architectures.
What if you could distill the complexity of human thought into a single mathematical equation? Every AI that recognizes your face or translates a language today began with one simple idea: the Perceptron.
In the 1950s, Frank Rosenblatt looked at the human brain and saw a network of switches. In biology, a neuron receives signals through dendrites, processes them in the cell body, and fires a signal down the axon if a certain threshold is met. The Perceptron is the mathematical equivalent. It takes multiple inputs , multiplies each by a weight (representing the strength of that connection), and adds a bias (the neuron's 'threshold' for firing). The result is the weighted sum , which is then passed through an activation function to determine the final output .
Let's calculate the weighted sum for a neuron with two inputs. 1. Inputs: 2. Weights: 3. Bias: 4. Formula: 5. Calculation:
Quick Check
In the perceptron model, what variable represents the 'strength' or 'importance' of an incoming signal?
Answer
The weight (w).
The weighted sum can be any number, but neurons in the brain usually 'fire' or 'don't fire.' To mimic this, we use activation functions. Without them, a neural network is just a giant linear equation, unable to learn complex patterns. Two modern favorites are ReLU and Tanh. ReLU (Rectified Linear Unit) is simple: if the input is negative, the output is zero; otherwise, it stays the same. Tanh (Hyperbolic Tangent) squashes any input into a range between and , making it useful for centering data.
Imagine our weighted sum is . Let's see how different functions react: 1. ReLU: . Since , the output is . 2. Tanh: . The output is approximately . 3. Notice how ReLU completely 'silences' the negative signal, while Tanh keeps it but scales it down.
Quick Check
If a neuron uses the ReLU activation function and its weighted sum is , what is the final output?
Answer
5.2
Why do we care about these functions? Real-world data is rarely a straight line. By using functions like Tanh or ReLU, we introduce non-linearity. This allows the network to learn 'bends' and 'curves' in data, such as the difference between a picture of a cat and a dog. The Bias term is also crucial here; it allows the activation function to shift left or right, giving the neuron more flexibility in when it decides to 'fire' regardless of the inputs.
Calculate the final output for a neuron using the ReLU activation function given: 1. Inputs: 2. Weights: 3. Bias: 4. Step 1 (Weighted Sum): 5. Step 2 (Activation):
Which part of the biological neuron is represented by the 'weights' in a perceptron?
What is the output of a ReLU activation function if the input is ?
The purpose of the bias () is to allow the activation function to shift, providing more flexibility in the neuron's firing threshold.
Review Tomorrow
In 24 hours, try to write down the formula for the weighted sum and sketch the shape of the ReLU function from memory.
Practice Activity
Try calculating the output of a perceptron with inputs , weights , and bias using both ReLU and Tanh.