Back to the 2022 paper

Module 3: Classification Algorithms

20227m

What is ANN? Explain feed forward and back propagation algorithm with example.

Worked SolutionAI Assisted

Artificial Neural Network (ANN):

Computational model inspired by biological neurons. Network of interconnected units (neurons) that processes inputs via weighted sums and non-linear activations to learn mappings.

  • Neuron: net=∑wixi+bnet=\sum w_i x_i + b, y=f(net)y=f(net) where ff is activation (sigmoid 1/(1+e−net)1/(1+e^{-net}), tanh, ReLU max(0,net)max(0,net)).
  • Architecture: Input layer → one or more hidden layers → output layer. Fully connected. Depth determines representation power.

Feedforward Algorithm:
Information flows forward only, no cycles.

  1. Initialize weights small random.
  2. For each layer ll: a(l)=f(W(l)a(l−1)+b(l))a^{(l)}=f(W^{(l)}a^{(l-1)}+b^{(l)})
  3. At output, compute loss E=12∑(y−a(L))2E=\frac12\sum(y-a^{(L)})^2 or cross-entropy.
  4. Example: 2-input XOR with hidden 2 neurons: h1=sigmoid(w11x1+w12x2+b1)h_1=sigmoid(w_{11}x_1+w_{12}x_2+b_1), output=sigmoid(v1h1+v2h2+c)output=sigmoid(v_1h_1+v_2h_2+c).

Backpropagation Algorithm:
Efficient gradient computation via chain rule to train weights.

  1. Forward pass as above, store net,anet, a.
  2. Output error δ(L)=(y−a(L))f′(net(L))\delta^{(L)}=(y-a^{(L)})f'(net^{(L)})
  3. Propagate backward: δ(l)=(W(l+1)Tδ(l+1))⊙f′(net(l))\delta^{(l)}= (W^{(l+1)T}\delta^{(l+1)})\odot f'(net^{(l)})
  4. Gradients ∂E/∂W(l)=δ(l)a(l−1)T\partial E/\partial W^{(l)}=\delta^{(l)}a^{(l-1)T}
  5. Update W:=W+ηδaTW:=W+\eta\delta a^T, b:=b+ηδb:=b+\eta\delta (SGD).
  6. Iterate over epochs until convergence.

Example with numbers: Single neuron with sigmoid, input 0.5, target 1, w=0.3w=0.3, net=0.15net=0.15, o=0.537o=0.537, E=0.107E=0.107, δ=(0.463)∗0.248=0.115\delta=(0.463)*0.248=0.115, Δw=0.1∗0.115∗0.5=0.0057\Delta w=0.1*0.115*0.5=0.0057 → weight increases.

Feedforward computes prediction; backprop assigns blame and updates weights to reduce loss, enabling learning of non-linear boundaries.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.