1. University MCA (AI/ML) Semester 2
  2. CAB212
  3. Unit 6

CAB212 · Unit 6: Evaluation and practice

Perceptron and a first neural network

7 practice questions

Key points

  • Perceptron = linear classifier
  • Cannot learn XOR alone
  • ReLU is the default hidden activation
  • Backpropagation uses the chain rule

A perceptron computes y = step(w.x + b): output 1 if the weighted sum is non-negative, else 0. It learns with the rule w := w + eta (t - y) x. It converges only if the classes are linearly separable; a single perceptron cannot learn XOR.

A multilayer perceptron (MLP) stacks layers of neurons with non-linear activation functions:

ActivationFormulaNotes
Sigmoid1/(1+e^-z)(0,1); vanishing gradients
Tanh(e^z - e^-z)/(e^z + e^-z)(-1,1); zero-centred
ReLUmax(0, z)Fast; default in hidden layers
Softmaxe^zi / sum(e^zj)Output probabilities over classes

Training uses forward pass (compute outputs), a loss function, backpropagation (chain rule to compute gradients), and a gradient-descent optimiser. Without non-linear activations, any stack of layers collapses to a single linear model.

Worked example: a perceptron with w = (1, 1) and b = -1.5 outputs 1 only when both inputs are 1, which is logical AND. Its weighted sum for input (1,1) is 0.5, so output is 1.

Exam pitfall: XOR needs at least one hidden layer.

Try two questions

Question 1 · Tier 3, Apply

Why are non-linear activation functions needed in an MLP?

  1. They make the network smaller and cheaper
  2. They remove the need for a loss function
  3. Without them stacked layers reduce to a single linear map
  4. They are required only for feature scaling
Show the answer

C. Composition of linear functions is linear.

Question 2 · Tier 3, Apply

Backpropagation computes gradients using the:

  1. Central limit theorem
  2. Bayes rule
  3. Pigeonhole principle
  4. Chain rule
Show the answer

D. It propagates derivatives backward through layers.