Artificial Intelligence · Artificial Neural Networks
Learning Paradigms and Activation Functions
Overview
This lesson covers how artificial neural networks learn and how neurons transform their weighted inputs.
Learning paradigms describe the type of feedback available during training: labeled targets, no targets, rewards, local correlations, or competition.
Activation functions decide whether and how a neuron fires, and their range and derivative control training behaviour.
The topic sits in the Artificial Neural Networks area of the syllabus and follows basic ideas of vectors, dot products, classification, and elementary derivatives.
Learn the definitions, formulas, ranges, derivatives, and network examples together, because exam questions often mix learning paradigms with activation-function properties.
Key concepts
- Supervised learning uses labeled input-output pairs . A teacher supplies the desired response.
Examples: perceptron, delta rule/LMS, multilayer perceptron (MLP) trained by backpropagation, and supervised radial basis function (RBF) networks. - Unsupervised learning uses only input data , with no desired output. It discovers clusters, densities, associations, or topology. Standard example: Self-Organizing Feature Map (SOM), also called Kohonen network.
- Reinforcement learning uses a scalar reward or penalty from the environment. The learner is an agent interacting with an environment; it is not told the correct action.
It is formalized as a Markov Decision Process (MDP) with states , actions , transition probabilities, rewards, and discount factor . - Error-correction learning is supervised: weights change in proportion to the error . Perceptron learning, Delta learning, and LMS learning (Least Mean Squares / Widrow-Hoff) fall in this category.
- Hebbian learning increases a weight when pre-synaptic and post-synaptic activities are correlated. It is local and, in standard form, unsupervised.
- Competitive learning uses winner-take-all: the unit most similar to the input is the winner, and mainly its weights move toward the input. SOM uses competitive learning plus neighbourhood updates.
- Backpropagation is supervised learning for multilayer networks.
A forward pass computes outputs from source/input layer to sink/output layer; then errors are propagated backward from sink to source, and weights are updated by gradient descent. - Activation functions introduce nonlinearity. Without a nonlinear hidden activation, a multilayer feedforward network collapses to an equivalent linear function.
- Sigmoid/logistic: , range , derivative . It is differentiable but saturates for large .
- Tanh: , range , zero-centred, derivative . It is a scaled and shifted sigmoid.
- ReLU: , range , derivative for , for . It avoids positive-side saturation but can suffer dying ReLU.
- Softmax converts a vector of scores into a probability distribution: nonnegative outputs summing to 1. It is used for mutually exclusive multiclass output, not as a standard hidden-layer scalar activation.
- A single perceptron creates only a linear decision boundary .
It solves linearly separable functions such as AND and OR, but not XOR. A multilayer network with nonlinear hidden units, or an RBF network, can solve XOR.
How it works
- A neuron first computes a weighted sum. Use the convention where is bias. If a question writes threshold , the equivalent net input is .
- In supervised training, initialise weights, present an input, compute , compare with target , and update weights to reduce the error. Repeat for many examples until the error is small or a fixed number of epochs is reached.
- For a single perceptron, the decision boundary is . Points on one side give one output and points on the other side give the other output.
This is why a perceptron can implement AND and OR but not XOR: XOR points cannot be separated by one straight line. - For multilayer backpropagation, the forward pass computes activations layer by layer. The loss, usually squared error or cross-entropy, is computed at the output.
The backward pass applies the chain rule from output layer to input layer, and gradient descent updates each weight as . - For the delta/LMS rule with a linear output , define . Then so . This explains why the delta rule has a plus sign while the general gradient-descent formula has a minus sign.
- In competitive learning, compute similarity or distance between input and each unit weight. Select the winner , for example , and move the winner toward the input: . In SOM, neighbouring units are also moved slightly.
- In reinforcement learning, the agent observes state , chooses action , receives reward , and moves to state . It learns a policy that maximises expected discounted return, not a target output for each action.
- Choose an activation by its output range and derivative. Step/sign units are for threshold logic but are not differentiable. Sigmoid and tanh are differentiable but saturate.
ReLU is simple and fast but has zero gradient for negative inputs. Softmax is for multiclass probabilities.
Drawing the diagram…
Formulas
-
Use = desired target, = actual output, or = learning rate, = weight on input , = bias.
-
Net input: , .
-
Decision boundary: .
-
Squared error: ; total over patterns: .
-
General gradient descent: .
-
Delta/LMS update for linear output: .
-
Perceptron/error-correction update: ; bias update uses input .
-
Hebbian rule: , or .
-
Competitive winner update: .
-
Sigmoid: , .
-
Generalised logistic: , ; at , .
-
Tanh: , , , .
-
ReLU: ; for , for .
-
Leaky ReLU: for , for ; derivative is or .
-
Softmax for class : .
-
Gaussian/RBF activation: .
-
Discounted return in reinforcement learning: .
Worked examples
Example 1 (match/statement type). Match each learning paradigm with the information used: Supervised, Unsupervised, Reinforcement, Hebbian.
Supervised uses labeled target outputs. Unsupervised uses input data only. Reinforcement uses reward or penalty from the environment. Hebbian uses correlation between pre- and post-synaptic activities. Final answer: Supervised—labeled targets; Unsupervised—no target; Reinforcement—reward; Hebbian—correlation.
Example 2 (two-step numeric). For , find and .
First, . So .
Then . Final answer: , derivative .
Example 3 (perceptron output). A perceptron has weights , bias , input , and sign activation. Compute output using if , if .
. Since , output is . Final answer: .
Example 4 (delta rule). Given , , , , old weights . Apply the delta rule.
Error . Update vector is .
New weights: , . Final answer: .
Example 5 (decision boundary). Can a single perceptron with step activation solve AND, where output is 1 only for ? Use , output 1 if .
For : , output 0. For : , output 0. For : , output 0. For : , output 1. The boundary is , a straight line, so AND is linearly separable. Final answer: yes, for AND; XOR would require a nonlinear boundary or hidden layer.
Comparison
| Paradigm | Information available | Teacher or critic | Typical examples | Trap |
|---|---|---|---|---|
| Supervised | Labeled target for input | Teacher | Perceptron, MLP with backprop, delta/LMS | MLP is supervised; SOM is not |
| Unsupervised | Input only | None | SOM, clustering networks | No target output, not reward |
| Reinforcement | Scalar reward or penalty | Critic | Agent in an MDP | Not told correct action |
| Hebbian | Correlation of pre/post activities | None in standard form | Hebb network | It is not supervised in standard form |
| Competitive | Similarity/distance to input | None | Winner-take-all, SOM | Only winner mainly updates |
| Error-correction | Error | Teacher | Perceptron, delta, LMS, backprop | Delta and LMS are supervised |
| Activation | Formula | Range | Derivative | Use/trap |
|---|---|---|---|---|
| Linear | Hidden linear layers add no nonlinear power | |||
| Binary step | if , otherwise | 0 except undefined at threshold | Not differentiable | |
| Sign | if , if | 0 except undefined at 0 | Perceptron output | |
| Sigmoid | Saturates, vanishing gradient | |||
| Tanh | Zero-centred but still saturates | |||
| ReLU | 1 for , 0 for | Dying ReLU for negatives | ||
| Leaky ReLU | or | 1 or | Keeps small negative slope | |
| Softmax | , sum 1 | full Jacobian | Mutually exclusive multiclass output | |
| Gaussian/RBF | bell-shaped | Local radial response | ||
| Ramp | 0 below 0, between 0 and 1, 1 above 1 | 0, 1, or 0 | Piecewise linear |
| Network/model | Learning type | Boundary/capability | XOR |
|---|---|---|---|
| Single perceptron | Supervised | Linear only | No |
| MLP with nonlinear hidden layer and backprop | Supervised | Nonlinear | Yes |
| RBF network | Usually supervised for classification | Nonlinear | Yes |
| SOM | Unsupervised competitive | Clustering/topology | Not a classifier |
| Hopfield network | Associative memory, not supervised | Energy-based recall | Not the standard XOR solver |
Revision summary
- Supervised = teacher and labeled target; unsupervised = no target; reinforcement = critic and reward.
- Perceptron, delta, LMS, and backprop are supervised error-correction methods.
- MLP is supervised; SOM is unsupervised; Hopfield is not supervised.
- Reinforcement learning is formalized as an MDP with states and actions.
- Delta rule updates weights by the difference between desired and actual output.
- Gradient descent for minimisation uses a minus sign; delta rule appears with a plus sign because the derivative already carries the minus.
- Sigmoid range is ; tanh range is ; ReLU range is .
- Sigmoid derivative is ; tanh derivative is .
- Binary step and sign are not differentiable; their derivative is zero except at the threshold.
- Softmax outputs are nonnegative and sum to 1; use it for mutually exclusive classes.
- Single perceptron cannot solve XOR; nonlinear hidden units or RBF can.
- In standard texts Hebbian learning is unsupervised; when a question asks for the standard unsupervised network example, SOM is the expected answer.
Previous-year exam insights
- Direct identification questions ask whether MLP, SOM, Hopfield, backpropagation, or SOM is supervised or unsupervised.
Check for labeled targets first. - Formula questions ask for the standard sigmoid , the sigmoid derivative, or the derivative of a scaled sigmoid such as .
- Matching questions match learning modes with information type: labeled responses, partial reward, no desired response, or a priori design information.
- Numeric questions ask for perceptron output using sign activation, delta-rule weight update, or sigmoid/tanh derivative at a point.
Substitute carefully and follow the stated threshold convention. - Gradient-descent questions test the sign: .
Do not use plus with a bare gradient. - Decision-boundary questions ask for or whether AND, OR, XOR is linearly separable.
Plot or test the four Boolean points. - Assertion-reason questions test differentiability, saturation, vanishing gradients, dying ReLU, and softmax as a probability distribution.
- Code or numeric snippets often use and for the standard sigmoid; compute inside-out and round only at the end.
Practice at PARIKSHA
You are ready for the PARIKSHA tests of this sub-topic when you can:
- classify a given network as supervised, unsupervised, reinforcement, or associative memory and justify it.
- write the standard sigmoid, tanh, ReLU, softmax, and sign formulas with their ranges.
- compute sigmoid or tanh value and derivative at a simple point without a calculator.
- apply the perceptron/delta update to a small weight vector and input vector.
- test whether a Boolean function such as AND, OR, or XOR is linearly separable.
- identify a sigmoid from a parametrised expression and distinguish it from Gaussian or ramp.
- explain why a linear hidden activation cannot increase representational power.
- match learning paradigms with teacher, critic, labeled target, reward, or no target.
- state the effect of saturation and dying ReLU on gradients.
- solve a small MDP-style reinforcement-learning definition question using states, actions, and rewards.
Attempt the sub-topic test first; then attempt the subject test.