1. Gyanastra
  2. Artificial Intelligence
  3. Artificial Neural Networks
  4. Learning Paradigms and Activation Functions
Free lesson, no account needed 11 min read 26 practice questions after it
Asked in past papers6 times
  • ISRO2017
  • UGC NET20192017201420122005

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 (x,d)(x,d). 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 xx, 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 SS, actions AA, transition probabilities, rewards, and discount factor γ\gamma.
  • Error-correction learning is supervised: weights change in proportion to the error d−yd-y. 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: f(x)=1/(1+e−x)f(x)=1/(1+e^{-x}), range (0,1)(0,1), derivative f(1−f)f(1-f). It is differentiable but saturates for large ∣x∣|x|.
  • Tanh: f(x)=tanh⁡(x)f(x)=\tanh(x), range (−1,1)(-1,1), zero-centred, derivative 1−f(x)21-f(x)^2. It is a scaled and shifted sigmoid.
  • ReLU: f(x)=max⁡(0,x)f(x)=\max(0,x), range [0,∞)[0,\infty), derivative 11 for x>0x>0, 00 for x<0x<0. 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 w⋅x+b=0w\cdot x+b=0.
    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

  1. A neuron first computes a weighted sum. Use the convention z=∑iwixi+b,y=f(z),z=\sum_i w_i x_i+b,\qquad y=f(z), where bb is bias. If a question writes threshold θ\theta, the equivalent net input is ∑iwixi−θ\sum_i w_i x_i-\theta.
  2. In supervised training, initialise weights, present an input, compute yy, compare with target dd, and update weights to reduce the error. Repeat for many examples until the error is small or a fixed number of epochs is reached.
  3. For a single perceptron, the decision boundary is w⋅x+b=0w\cdot x+b=0. 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.
  4. 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 w←w−α ∂E/∂ww\leftarrow w-\alpha\,\partial E/\partial w.
  5. For the delta/LMS rule with a linear output y=w⋅xy=w\cdot x, define E=12(d−y)2E=\tfrac12(d-y)^2. Then ∂E∂wi=−(d−y)xi,\frac{\partial E}{\partial w_i}=-(d-y)x_i, so wi←wi+α(d−y)xiw_i\leftarrow w_i+\alpha(d-y)x_i. This explains why the delta rule has a plus sign while the general gradient-descent formula has a minus sign.
  6. In competitive learning, compute similarity or distance between input xx and each unit weight. Select the winner kk, for example k=arg⁡min⁡j∥x−wj∥k=\arg\min_j\|x-w_j\|, and move the winner toward the input: wk←wk+η(x−wk)w_k\leftarrow w_k+\eta(x-w_k). In SOM, neighbouring units are also moved slightly.
  7. In reinforcement learning, the agent observes state sts_t, chooses action ata_t, receives reward rt+1r_{t+1}, and moves to state st+1s_{t+1}. It learns a policy that maximises expected discounted return, not a target output for each action.
  8. 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.
Figure. Notice the cycle: z=sum wx+b and y=f(z) are computed, y is compared with target d, error e=d-y updates weights, and the process repeats.

Formulas

  • Use dd = desired target, yy = actual output, η\eta or α\alpha = learning rate, wiw_i = weight on input xix_i, bb = bias.

  • Net input: z=∑iwixi+bz=\sum_i w_i x_i+b, y=f(z)y=f(z).

  • Decision boundary: ∑iwixi+b=0\sum_i w_i x_i+b=0.

  • Squared error: E=12(d−y)2E=\tfrac12(d-y)^2; total over patterns: E=12∑p(dp−yp)2E=\tfrac12\sum_p(d_p-y_p)^2.

  • General gradient descent: w←w−α∂E∂ww\leftarrow w-\alpha\frac{\partial E}{\partial w}.

  • Delta/LMS update for linear output: wi←wi+α(d−y)xiw_i\leftarrow w_i+\alpha(d-y)x_i.

  • Perceptron/error-correction update: wi←wi+η(d−y)xiw_i\leftarrow w_i+\eta(d-y)x_i; bias update uses input 11.

  • Hebbian rule: Δwij=ηxiyj\Delta w_{ij}=\eta x_i y_j, or wij←wij+ηxiyjw_{ij}\leftarrow w_{ij}+\eta x_i y_j.

  • Competitive winner update: wk←wk+η(x−wk)w_k\leftarrow w_k+\eta(x-w_k).

  • Sigmoid: f(x)=11+e−xf(x)=\frac{1}{1+e^{-x}}, f′(x)=f(x)(1−f(x))f'(x)=f(x)(1-f(x)).

  • Generalised logistic: f(x)=11+e−axf(x)=\frac{1}{1+e^{-ax}}, f′(x)=af(x)(1−f(x))f'(x)=a f(x)(1-f(x)); at x=0x=0, f′(0)=a/4f'(0)=a/4.

  • Tanh: f(x)=tanh⁡x=ex−e−xex+e−xf(x)=\tanh x=\frac{e^x-e^{-x}}{e^x+e^{-x}}, f′(x)=1−f(x)2f'(x)=1-f(x)^2, f(0)=0f(0)=0, f′(0)=1f'(0)=1.

  • ReLU: f(x)=max⁡(0,x)f(x)=\max(0,x); f′(x)=1f'(x)=1 for x>0x>0, 00 for x<0x<0.

  • Leaky ReLU: f(x)=xf(x)=x for x>0x>0, f(x)=αxf(x)=\alpha x for x≤0x\le0; derivative is 11 or α\alpha.

  • Softmax for class ii: fi=ezi∑jezjf_i=\frac{e^{z_i}}{\sum_j e^{z_j}}.

  • Gaussian/RBF activation: f(x)=exp⁡ ⁣(−(x−c)22σ2)f(x)=\exp\!\left(-\frac{(x-c)^2}{2\sigma^2}\right).

  • Discounted return in reinforcement learning: Gt=∑k=0∞γkRt+k+1G_t=\sum_{k=0}^{\infty}\gamma^k R_{t+k+1}.

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 f(x)=11+e−xf(x)=\frac{1}{1+e^{-x}}, find f(ln⁡3)f(\ln 3) and f′(ln⁡3)f'(\ln 3).
First, e−ln⁡3=eln⁡(1/3)=1/3e^{-\ln 3}=e^{\ln(1/3)}=1/3. So f(ln⁡3)=11+1/3=14/3=34f(\ln 3)=\frac{1}{1+1/3}=\frac{1}{4/3}=\frac34.
Then f′=f(1−f)=34⋅14=316f'=f(1-f)=\frac34\cdot\frac14=\frac{3}{16}. Final answer: f=34f=\frac34, derivative =316=\frac{3}{16}.

Example 3 (perceptron output). A perceptron has weights w=[0.5,−0.2,0.1]w=[0.5,-0.2,0.1], bias b=0b=0, input x=[1,2,−2]x=[1,2,-2], and sign activation. Compute output using sign⁡(z)=1\operatorname{sign}(z)=1 if z>0z>0, −1-1 if z<0z<0.
z=0.5(1)+(−0.2)(2)+0.1(−2)=0.5−0.4−0.2=−0.1z=0.5(1)+(-0.2)(2)+0.1(-2)=0.5-0.4-0.2=-0.1. Since z<0z<0, output is −1-1. Final answer: −1-1.

Example 4 (delta rule). Given d=1d=1, y=0.4y=0.4, x=(1,2)x=(1,2), α=0.1\alpha=0.1, old weights w=(0.2,−0.1)w=(0.2,-0.1). Apply the delta rule.
Error d−y=0.6d-y=0.6. Update vector is α(d−y)x=0.1(0.6)(1,2)=(0.06,0.12)\alpha(d-y)x=0.1(0.6)(1,2)=(0.06,0.12).
New weights: w1=0.2+0.06=0.26w_1=0.2+0.06=0.26, w2=−0.1+0.12=0.02w_2=-0.1+0.12=0.02. Final answer: (0.26,0.02)(0.26,0.02).

Example 5 (decision boundary). Can a single perceptron with step activation solve AND, where output is 1 only for (1,1)(1,1)? Use z=x1+x2−1.5z=x_1+x_2-1.5, output 1 if z>0z>0.
For (0,0)(0,0): z=−1.5z=-1.5, output 0. For (0,1)(0,1): z=−0.5z=-0.5, output 0. For (1,0)(1,0): z=−0.5z=-0.5, output 0. For (1,1)(1,1): z=0.5z=0.5, output 1. The boundary is x1+x2−1.5=0x_1+x_2-1.5=0, a straight line, so AND is linearly separable. Final answer: yes, for AND; XOR would require a nonlinear boundary or hidden layer.

Comparison

ParadigmInformation availableTeacher or criticTypical examplesTrap
SupervisedLabeled target dd for input xxTeacherPerceptron, MLP with backprop, delta/LMSMLP is supervised; SOM is not
UnsupervisedInput xx onlyNoneSOM, clustering networksNo target output, not reward
ReinforcementScalar reward or penaltyCriticAgent in an MDPNot told correct action
HebbianCorrelation of pre/post activitiesNone in standard formHebb networkIt is not supervised in standard form
CompetitiveSimilarity/distance to inputNoneWinner-take-all, SOMOnly winner mainly updates
Error-correctionError d−yd-yTeacherPerceptron, delta, LMS, backpropDelta and LMS are supervised
ActivationFormulaRangeDerivativeUse/trap
Linearf(x)=xf(x)=x(−∞,∞)(-\infty,\infty)11Hidden linear layers add no nonlinear power
Binary step11 if x>0x>0, 00 otherwise{0,1}\{0,1\}0 except undefined at thresholdNot differentiable
Sign11 if x>0x>0, −1-1 if x<0x<0{−1,1}\{-1,1\}0 except undefined at 0Perceptron output
Sigmoid11+e−x\frac{1}{1+e^{-x}}(0,1)(0,1)f(1−f)f(1-f)Saturates, vanishing gradient
Tanhtanh⁡x\tanh x(−1,1)(-1,1)1−f21-f^2Zero-centred but still saturates
ReLUmax⁡(0,x)\max(0,x)[0,∞)[0,\infty)1 for x>0x>0, 0 for x<0x<0Dying ReLU for negatives
Leaky ReLUxx or αx\alpha x(−∞,∞)(-\infty,\infty)1 or α\alphaKeeps small negative slope
Softmaxezi/∑jezje^{z_i}/\sum_j e^{z_j}(0,1)(0,1), sum 1full JacobianMutually exclusive multiclass output
Gaussian/RBFexp⁡(−(x−c)2/(2σ2))\exp(-(x-c)^2/(2\sigma^2))(0,1](0,1]bell-shapedLocal radial response
Ramp0 below 0, xx between 0 and 1, 1 above 1[0,1][0,1]0, 1, or 0Piecewise linear
Network/modelLearning typeBoundary/capabilityXOR
Single perceptronSupervisedLinear onlyNo
MLP with nonlinear hidden layer and backpropSupervisedNonlinearYes
RBF networkUsually supervised for classificationNonlinearYes
SOMUnsupervised competitiveClustering/topologyNot a classifier
Hopfield networkAssociative memory, not supervisedEnergy-based recallNot the standard XOR solver

Revision summary

  1. Supervised = teacher and labeled target; unsupervised = no target; reinforcement = critic and reward.
  2. Perceptron, delta, LMS, and backprop are supervised error-correction methods.
  3. MLP is supervised; SOM is unsupervised; Hopfield is not supervised.
  4. Reinforcement learning is formalized as an MDP with states and actions.
  5. Delta rule updates weights by the difference between desired and actual output.
  6. Gradient descent for minimisation uses a minus sign; delta rule appears with a plus sign because the derivative already carries the minus.
  7. Sigmoid range is (0,1)(0,1); tanh range is (−1,1)(-1,1); ReLU range is [0,∞)[0,\infty).
  8. Sigmoid derivative is f(1−f)f(1-f); tanh derivative is 1−tanh⁡2x1-\tanh^2x.
  9. Binary step and sign are not differentiable; their derivative is zero except at the threshold.
  10. Softmax outputs are nonnegative and sum to 1; use it for mutually exclusive classes.
  11. Single perceptron cannot solve XOR; nonlinear hidden units or RBF can.
  12. 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 1/(1+e−x)1/(1+e^{-x}), the sigmoid derivative, or the derivative of a scaled sigmoid such as 1/(1+e−2x)1/(1+e^{-2x}).
  • 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: w(t+1)=w(t)−α ∂E/∂ww(t+1)=w(t)-\alpha\,\partial E/\partial w.
    Do not use plus with a bare gradient.
  • Decision-boundary questions ask for w1x1+w2x2+b=0w_1x_1+w_2x_2+b=0 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 f(0)=0.5f(0)=0.5 and f(1−f)=0.25f(1-f)=0.25 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.

Pages 1–2 of 2