Practice
1. What is the time complexity of computing the forward pass for a single layer in a neural network using NumPy?
easy
Solution
Step 1: Identify operations
Forward pass involves matrix-vector multiplication.Step 2: Determine complexity
Matrix-vector multiplication is O(n) where n is the number of neurons.Final Answer:
Option B -> Option BQuick Check:
Matrix-vector multiplication is O(n) [OK]
Hint: Matrix-vector multiplication is O(n) [OK]
Common Mistakes:
2. What is the time complexity of updating the embeddings for a single word pair in the Skip-Gram model with negative sampling?
easy
Solution
Step 1: Identify the operations involved
Updating embeddings involves computing gradients and updating weights for the target word and k negative samples.Step 2: Determine the complexity
Each update involves a constant number of operations per sample, leading to O(k) complexity where k is the number of negative samples.Final Answer:
Option A -> Option AQuick Check:
Complexity is O(k) due to k negative samples [OK]
Hint: Complexity is O(k) due to k negative samples [OK]
Common Mistakes:
3. You implemented Robust Scaling but your model's performance dropped. What is the most likely cause?
medium
Solution
Step 1: Understand Robust Scaling
Robust Scaling uses the median and IQR, which reduces the influence of outliers.Step 2: Identify the Issue
If outliers are important, reducing their influence can harm model performance.Final Answer:
Option D -> Option DQuick Check:
Robust Scaling reduces outlier impact. [OK]
Hint: Robust Scaling reduces outlier impact. [OK]
Common Mistakes:
4. You implemented an ROC curve but the AUC is unexpectedly low. What is the most likely cause?
medium
Solution
Step 1: Analyze AUC behavior
AUC measures the ability to distinguish between classes. Random predictions result in an AUC of 0.5.Step 2: Eliminate wrong options
The model predictions are perfectly calibrated. would result in a high AUC, Options C and D would lead to undefined or trivial ROC curves.Final Answer:
Option B -> Option BQuick Check:
Random predictions lead to low AUC [OK]
Hint: Random predictions lead to low AUC [OK]
Common Mistakes:
5. How can you optimize the mAP calculation for a large dataset with thousands of images and bounding boxes?
hard
Solution
Step 1: Identify the Bottleneck
Calculating IoU for many boxes is computationally expensive.Step 2: Evaluate Optimization Strategies
Use parallel processing to compute IoU for each image: Parallel processing can significantly speed up IoU calculations. Reduce the number of bounding boxes by increasing the confidence threshold: Reducing boxes might miss important detections. Precompute IoU values for all possible box pairs: Precomputing is infeasible due to combinatorial explosion. Use a more efficient data structure for storing bounding boxes: Efficient data structures help but don't address computation directly.Final Answer:
Option A -> Option AQuick Check:
Parallelize IoU for large datasets [OK]
Hint: Parallelize IoU for large datasets [OK]
Common Mistakes:
