GATE 2025 DA – Question 42
Consider the neural network shown in the figure with
inputs: $u, v$
weights: $a, b, c, d, e, f$
output: $y$
$R$ denotes the ReLU function, $R(x) = \max(0, x)$.
[Figure: A network with inputs u and v. The first hidden ReLU unit receives $a$ from $u$ and $b$ from $v$, the second hidden ReLU unit receives $c$ from $u$ and $d$ from $v$. The output ReLU unit receives $e$ from the first hidden unit and $f$ from the second, and gives $y$.]
Given $u = 2, v = 3$,
$a = 1, b = 1, c = 1, d = -1, e = 4, f = -1$,
which one of the following is correct?

Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) $\frac{\partial y}{\partial a} = 8$, $\frac{\partial y}{\partial f} = 0$
Explanation
The first hidden unit gets $au + bv = 2 + 3 = 5$ and outputs $R(5) = 5$. The second gets $cu + dv = 2 - 3 = -1$ and outputs $R(-1) = 0$. The output unit gets $e \cdot 5 + f \cdot 0 = 20$, so $y = R(20) = 20$. By the chain rule, $\frac{\partial y}{\partial a} = 1 \cdot e \cdot 1 \cdot u = 4 \times 2 = 8$, because every ReLU on the path is active. For $f$, $\frac{\partial y}{\partial f} = 1 \cdot h_2 = 0$, since the second hidden output is 0.