Machine Learning Basics
A small neural network with inputs x₁ = 1 and x₂ = 2 has two hidden neurons h₁ = ReLU(x₁ + x₂ − 1) and h₂ = ReLU(x₁ − 2x₂ + 1), and output y = 2h₁ + 3h₂ + 1. What is the value of y?
- A−1
- B5
- C7
Show answer and explanation
Answer: B. 5
ReLU is an activation function that outputs its input unchanged when positive and 0 when the input is 0 or less. h₁ = ReLU(1 + 2 − 1) = ReLU(2) = 2 and h₂ = ReLU(1 − 4 + 1) = ReLU(−2) = 0, so y = 2 × 2 + 3 × 0 + 1 = 5. Computing layer by layer from the input to the output in this way is called the forward pass (forward propagation).
- A. This is 2 × 2 + 3 × (−2) + 1 = −1, computed with h₂ = −2 without applying ReLU.
- B. Correct. h₁ = 2 and h₂ = 0, so y = 2 × 2 + 3 × 0 + 1 = 5.
- C. This is 2 × 3 + 1 = 7, with h₁ = 3 and h₂ = 0 obtained by forgetting the hidden-layer biases (−1 and +1).