The GATE Grind

GATE 2024 DA – Question 43

Machine Learning · Multi-layer perceptron and feed-forward neural networks · 2 marks · Multiple choice

Consider the two neural networks (NNs) shown in Figures 1 and 2, with ReLU activation ($ReLU(z) = \max\{0, z\}, \forall z \in \mathbb{R}$). $\mathbb{R}$ denotes the set of real numbers. The connections and their corresponding weights are shown in the Figures. The biases at every neuron are set to 0. For what values of $p, q, r$ in Figure 2 are the two NNs equivalent, when $x_1, x_2, x_3$ are positive?

[Figure 1: a network with 3 inputs $x_1, x_2, x_3$, a first hidden layer of 3 neurons with every connection of weight 1, a second hidden layer of 2 neurons with every connection of weight 2, and an output neuron with weights 3 and 3. Figure 2: the three inputs connect directly to one output neuron with the weights $p$, $q$ and $r$.]

Diagram for GATE 2024 DA question 43
  1. $p = 36, q = 24, r = 24$
  2. $p = 24, q = 24, r = 36$
  3. $p = 18, q = 36, r = 24$
  4. $p = 36, q = 36, r = 36$

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) $p = 36, q = 36, r = 36$

Explanation

With all inputs positive, every ReLU receives a positive input and so acts as the identity. Each neuron of the first hidden layer outputs $x_1 + x_2 + x_3 = S$. Each neuron of the second layer outputs $2(S + S + S) = 6S$. The output is $3 \times 6S + 3 \times 6S = 36S = 36x_1 + 36x_2 + 36x_3$. So $p = q = r = 36$.