Deep Learning · TEE · section

F23 Q2a

Final examination December 2023 fully solved

Question

Question (10 marks). A feedforward network has inputs 1,2; hidden nodes 3,4; outputs 5,6. Weights: w13 = −2, w23 = 3, w14 = 4, w24 = −1, w35 = 1, w45 = −1, w36 = −1, w46 = 1; all biases 0. All nodes 3–6 use step(z) = 1 if z≥0 else 0. Find(y5, y6) for inputs(0,0), (1,0), (0,1), (1,1).

Answer — step by step

Given

A feedforward network has inputs 1,2.

hidden nodes 3,4.

outputs 5,6.

Weights: w13 = −2, w23 = 3, w14 = 4, w24 = −1, w35 = 1, w45 = −1, w36 = −1, w46 = 1.

all biases 0.

All nodes 3–6 use step(z) = 1 if z≥0 else 0.

Find(y5, y6) for inputs(0,0), (1,0), (0,1), (1,1).

To find

Write every row of the truth table and the requested network output.

Formula — which one and why

Threshold logic. Compute the weighted sum for every binary input combination and apply the threshold rule exactly. Hidden neurons can provide separate threshold decisions before the output combines them.

step(z) returns 1 at or above zero unless the question specifies a strict inequality; otherwise it returns 0.

z=\sum_iw_ix_i+bLaTeX: z=\sum_iw_ix_i+b
\operatorname{step}(z)=\begin{cases}1&z\ge0\\0&z<0\end{cases}LaTeX: \operatorname{step}(z)=\begin{cases}1&z\ge0\\0&z<0\end{cases}

Yaad rakhne ka cue: Har input row ka sum nikalo, phir threshold lagao.

Solution — step by step

Use exactly the printed step: output 1 if z≥0, otherwise 0. In particular, step(0) = 1. The equations are z₃ = −2x₁+3x₂, z₄ = 4x₁−x₂, z₅ = h₃−h₄, z₆ = −h₃+h₄.

Step 1: Input(0,0). z₃ = −2 × 0+3 × 0 = 0; h₃ = 1. z₄ = 4 × 0−0 = 0; h₄ = 1. z₅ = 1−1 = 0; y₅ = 1. z₆ = −1+1 = 0; y₆ = 1. Final pair = (1,1).

Step 2: Input(1,0). z₃ = −2 × 1+3 × 0 = -2; h₃ = 0. z₄ = 4 × 1−0 = 4; h₄ = 1. z₅ = 0−1 = -1; y₅ = 0. z₆ = −0+1 = 1; y₆ = 1. Final pair = (0,1).

Step 3: Input(0,1). z₃ = −2 × 0+3 × 1 = 3; h₃ = 1. z₄ = 4 × 0−1 = -1; h₄ = 0. z₅ = 1−0 = 1; y₅ = 1. z₆ = −1+0 = -1; y₆ = 0. Final pair = (1,0).

Step 4: Input(1,1). z₃ = −2 × 1+3 × 1 = 1; h₃ = 1. z₄ = 4 × 1−1 = 3; h₄ = 1. z₅ = 1−1 = 0; y₅ = 1. z₆ = −1+1 = 0; y₆ = 1. Final pair = (1,1).