BIT252 ยท 2082 ยท 10 marks
What is learning rule?How learning is done in ANN using back propagation algorithm?[2+8]
What is learning rule?How learning is done in ANN using back propagation algorithm?[2+8]
Quick answer
A learning rule is a method or procedure that modifies the weights and biases of a neural network in order to improve its performance on a given task. It defines how the network learns from training data by updating connection weights based on the error between the actual output and the desired output.
Learning Rule and Backpropagation in ANN
Part 1: What is a Learning Rule? [2 marks]
Common types of learning rules include:
- Hebbian Learning Rule - weights are updated based on the correlation of input and output activations
- Perceptron Learning Rule - weights are updated when the output is incorrect
- Delta (Widrow-Hoff) Rule - weights are updated proportional to the error
- Backpropagation Rule - generalized delta rule for multilayer networks
General form: $$\Delta w_{ij} = \eta \cdot \delta_j \cdot x_i$$ where $\eta$ is the learning rate, $\delta_j$ is the error signal, and $x_i$ is the input.
Part 2: Learning Using Backpropagation Algorithm [8 marks]
Overview
Backpropagation (BP) is a supervised learning algorithm used to train multilayer feedforward neural networks. It works by:
- Forward pass - computing the output
- Backward pass - propagating the error backward and updating weights
Network Architecture
Consider a three-layer network:
- Input layer - nodes indexed $i$
- Hidden layer - nodes indexed $j$
- Output layer - nodes indexed $k$
Step-by-Step Backpropagation Algorithm
Step 1: Initialize Weights
Set all weights $w_{ij}$ and $w_{jk}$ to small random values (typically between -0.5 and 0.5).
Step 2: Forward Pass (Feed Forward)
At the hidden layer, compute the net input and activation for each hidden neuron $j$:
$$net_j = \sum_i w_{ij} \cdot x_i + b_j$$
$$y_j = f(net_j) = \frac{1}{1 + e^{-net_j}} \quad \text{(sigmoid activation)}$$
At the output layer, compute the net input and activation for each output neuron $k$:
$$net_k = \sum_j w_{jk} \cdot y_j + b_k$$
$$o_k = f(net_k) = \frac{1}{1 + e^{-net_k}}$$
Step 3: Compute Output Error
For each output neuron $k$, compute the error signal $\delta_k$:
$$E = \frac{1}{2} \sum_k (t_k - o_k)^2$$
where $t_k$ is the target (desired) output and $o_k$ is the actual output.
The error gradient at the output layer:
$$\delta_k = (t_k - o_k) \cdot f'(net_k)$$
For sigmoid activation: $f'(net_k) = o_k(1 - o_k)$
$$\boxed{\delta_k = (t_k - o_k) \cdot o_k(1 - o_k)}$$
Step 4: Backpropagate Error to Hidden Layer
Compute the error signal $\delta_j$ for each hidden neuron $j$:
$$\delta_j = \left(\sum_k \delta_k \cdot w_{jk}\right) \cdot f'(net_j)$$
$$\boxed{\delta_j = \left(\sum_k \delta_k \cdot w_{jk}\right) \cdot y_j(1 - y_j)}$$
The error is propagated backward from output to hidden layer using the weights.
Step 5: Update Weights
Update weights between hidden and output layer:
$$\Delta w_{jk} = \eta \cdot \delta_k \cdot y_j$$
$$w_{jk}^{new} = w_{jk}^{old} + \Delta w_{jk}$$
Update weights between input and hidden layer:
$$\Delta w_{ij} = \eta \cdot \delta_j \cdot x_i$$
$$w_{ij}^{new} = w_{ij}^{old} + \Delta w_{ij}$$
where $\eta$ is the learning rate (typically 0.01 to 0.9).
Step 6: Repeat
Repeat Steps 2 to 5 for all training patterns until the total error $E$ is minimized below a threshold or the maximum number of epochs is reached.
Summary Diagram
Input Layer Hidden Layer Output Layer
x_i ---w_ij---> y_j ---w_jk---> o_k
|
Error = (t_k - o_k)
|
<--- delta_j <--- delta_k (backpropagated)
Weight update Weight update
Key Points
| Aspect | Detail |
|---|---|
| Type | Supervised learning |
| Direction | Forward (compute output) + Backward (update weights) |
| Activation | Sigmoid (differentiable) |
| Error function | Mean Squared Error (MSE) |
| Weight update | Gradient Descent |
| Learning rate $\eta$ | Controls step size of weight update |
Advantages and Limitations
Advantages:
- Can learn complex nonlinear mappings
- Works for multilayer networks
Limitations:
- May get stuck in local minima
- Slow convergence for large networks
- Requires labeled training data
- Sensitive to learning rate choice
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.