Solvingmcq
Solvingmcq
4,
what is the neuron's output?
a) 0.310
b) 0.401
c) 0.490
d) 0.599
[Hint: Use f(x)=11+e−xf(x)=1+e−x1]
3. A neural network uses ReLU activation. If the weighted sum input to a neuron is -0.7, what
is its output?
a) -0.7
b) 0
c) 0.7
d) 1
4. Given the hyperbolic tangent (tanh) output at x = 0.5 is 0.462, what is its derivative at the
same point?
a) 0.786
b) 0.652
c) 0.540
[Hint: f′(x)=1−tanh2(x)f′(x)=1−tanh2(x)]
d) 0.213
5. In a neural network, the error derivative w.r.t. a weight wijwij is calculated as -0.12. If the
learning rate (α) is 0.1, what is the weight update ΔwijΔwij?
a) -0.012
b) 0.012
c) -1.2
d) 0.12
6. A neuron’s output is 0.8 (binary sigmoid), and the target is 1. What is the error signal (δ)
for this neuron?
a) 0.2
b) -0.16
c) 0.128
d) -0.2
8. Which activation function is typically used in the output layer for MNIST digit
classification?
a) ReLU
b) Sigmoid
c) Softmax
d) Tanh
NumPy Operations
9. Given arrays A = np.array([1, 2, 3]) and B = np.array([4, 5, 6]), what does np.dot(A,
B) return?
a) 32
b) [4, 10, 18]
c) 14
d) Error
10. Which NumPy function replaces all elements >5 in array X with 0?
a) np.replace(X, X>5, 0)
b) X[X > 5] = 0
c) np.where(X > 5, 0, X)
d) Both b and c
11. Given weight vector w=[0.2,0.6]w=[0.2,0.6] and input x=[0.4,0.8]x=[0.4,0.8], what is the
squared Euclidean distance?
a) 0.04
b) 0.08
c) 0.10
d) 0.20
12. If the learning rate is 0.3 and the difference between input and weight is 0.5, what is the
weight update?
a) 0.15
b) 0.30
c) 0.03
d) 1.5
Answer Key
1. b) 0.401
2. c) 0.462
3. b) 0
4. a) 0.786
5. b) 0.012
6. b) -0.16
7. b) (784,)
8. c) Softmax
9. a) 32
11. b) 0.08
12. a) 0.15
13. a) 3.6
Basic Operations
Matrix Operations
4. For matrices X = np.array([[1, 2], [3, 4]]) and Y = np.array([[5, 6], [7, 8]]), what is np.dot(X,
Y)?
a) [[19, 22], [43, 50]]
b) [[6, 8], [10, 12]]
c) [[5, 12], [21, 32]]
d) [[7, 10], [15, 22]]
Array Manipulation
7. Given arr = np.array([10, 20, 30, 40]), what does arr[1:3] return?
a) [20, 30]
b) [10, 20]
c) [20, 30, 40]
d) [30, 40]
11. Given arr = np.array([1, 2, np.nan, 4]), how do you compute the mean ignoring NaN?
a) np.mean(arr)
b) np.nanmean(arr)
c) arr.mean(skipna=True)
d) np.mean(arr[~np.isnan(arr)])
Answer Key
1. a) [3, 5, 7]
2. a) [5, 7, 9]
6. c) np.multiply()
7. a) [20, 30]
9. a) [0, 1, 0, 1]
10. a) [3, 7]
11. b) np.nanmean(arr)