Practice
1. What is the time complexity of computing a confusion matrix for a binary classification problem with n predictions?
easy
Solution
Step 1: Analyze the operation
Computing a confusion matrix involves iterating over predictions once.Step 2: Determine complexity
Each prediction is checked once, leading to O(n) complexity.Final Answer:
Option C -> Option CQuick Check:
Confusion matrix computation is linear in predictions. [OK]
Hint: Confusion matrix computation is linear in predictions. [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. In a scenario where training time is critical, which approach is better for implementing early stopping?
medium
Solution
Step 1: Consider training time constraints
In time-critical scenarios, stopping early can save resources.Step 2: Choose the appropriate patience value
A small patience value allows for quicker termination if no improvement is seen, aligning with the need to save time.Final Answer:
Option A -> Option AQuick Check:
Small patience saves time in critical scenarios. [OK]
Hint: Small patience saves time in critical scenarios. [OK]
Common Mistakes:
4. You need to apply non-max suppression on a batch of images. Which approach is most efficient?
medium
Solution
Step 1: Consider independence of images
Each image's boxes are independent, so process them separately.Step 2: Evaluate efficiency
Concatenating boxes would mix unrelated data, and focusing on one image or thresholding scores misses other valid boxes.Final Answer:
Option A -> Option AQuick Check:
Process each image independently [OK]
Hint: Process each image independently [OK]
Common Mistakes:
5. How would you modify the Mini-Batch SGD with Momentum to handle sparse data more efficiently?
medium
Solution
Step 1: Identify the challenge with sparse data
Sparse data often leads to many zero gradients, making full updates inefficient.Step 2: Choose the appropriate modification
Lazy updates only update non-zero elements, reducing unnecessary computations and improving efficiency.Final Answer:
Option D -> Option DQuick Check:
Use lazy updates for sparse data efficiency [OK]
Hint: Use lazy updates for sparse data efficiency [OK]
Common Mistakes:
