Practice
1. In the context of Word2Vec, which of the following best describes the purpose of the 'skip-gram' model?
easy
Solution
Step 1: Understand skip-gram model purpose
The skip-gram model in Word2Vec is designed to predict surrounding words given a target word.Step 2: Eliminate wrong options
Predicts the next word in a sequence given the previous words. describes a language model task, Clusters words into predefined categories. is about clustering, and Generates a sequence of words from a given context. is about sequence generation, none of which are the purpose of skip-gram.Final Answer:
Option D -> Option DQuick Check:
Skip-gram predicts context from target [OK]
Hint: Skip-gram predicts context from target [OK]
Common Mistakes:
2.
import numpy as np
y_true = np.array([3, -0.5, 2, 7])
y_pred = np.array([2.5, 0.0, 2, 8])
mae = np.mean(np.abs(y_true - y_pred))
print(mae)What is the output of this code snippet?easy
Solution
Step 1: Calculate the absolute errors.
Errors are [0.5, 0.5, 0, 1].Step 2: Compute the mean of absolute errors.
Mean is (0.5 + 0.5 + 0 + 1) / 4 = 0.625.Final Answer:
Option A -> Option AQuick Check:
Sum errors, divide by count. [OK]
Hint: Sum absolute errors, divide by count. [OK]
Common Mistakes:
3. A continually learning model is showing degraded performance over time. What is the most likely cause?
medium
Solution
Step 1: Identify symptoms of degraded performance.
Continual learning models can overfit to recent data, especially if not managed properly.Step 2: Eliminate other causes.
The model is not receiving enough new data. is incorrect because lack of data would not cause degradation but stagnation. The model's architecture is too simple. is incorrect because architecture simplicity would limit initial performance, not degrade it over time. The model's learning rate is too high. is incorrect because a high learning rate would cause instability, not gradual degradation.Final Answer:
Option A -> Option AQuick Check:
Degradation often means overfitting. [OK]
Hint: Degradation often means overfitting. [OK]
Common Mistakes:
4. When deploying a model to production, which trade-off is most critical to consider?
medium
Solution
Step 1: Identify the key trade-off in production.
In production, inference latency is crucial as it affects user experience.Step 2: Eliminate less relevant trade-offs.
Model accuracy vs. training time is more relevant during development, not deployment. Data size vs. interpretability and feature engineering vs. hyperparameter tuning are less critical in production.Final Answer:
Option B -> Option BQuick Check:
Latency impacts user experience in production. [OK]
Hint: Latency impacts user experience in production. [OK]
Common Mistakes:
5. You need to design a model for a task involving both spatial and temporal hierarchies. Which approach is most suitable?
hard
Solution
Step 1: Identify task requirements
The task requires capturing both spatial and temporal hierarchies, which suggests a hybrid approach.Step 2: Eliminate wrong options
Use a shallow CNN for spatial features and a separate RNN for temporal features. is incorrect because separate models may not capture interactions. Use a shallow RNN for temporal features and ignore spatial features. is incorrect because it ignores spatial features. Use a deep CNN for spatial features and ignore temporal features. is incorrect because it ignores temporal features.Final Answer:
Option A -> Option AQuick Check:
Hybrid models for spatial-temporal tasks. [OK]
Hint: Hybrid models for spatial-temporal tasks. [OK]
Common Mistakes:
