Practice
Solution
Step 1: Understand the context of normalization techniques.
Batch Normalization relies on batch statistics, which can be unstable with small batch sizes. Layer Normalization uses layer statistics, making it more stable for small batches or online learning.Step 2: Eliminate wrong options.
When the model is trained on a very large batch size. is incorrect because large batch sizes are suitable for Batch Normalization. When the model has a very deep architecture. is incorrect because depth doesn't directly affect the choice between these normalizations. When the model is trained on a balanced dataset. is irrelevant to normalization choice.Final Answer:
Option B -> Option BQuick Check:
Layer Norm for small batches or online learning. [OK]
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]
import numpy as np
from sklearn.metrics import accuracy_score
y_true = np.array([1, 0, 1, 1, 0])
y_pred = np.array([0, 0, 1, 0, 0])
accuracy = accuracy_score(y_true, y_pred)
print(f'Accuracy: {accuracy:.2f}')
Solution
Step 1: Calculate accuracy
Compare y_true and y_pred: only 2 out of 5 predictions are correct.Step 2: Compute accuracy
Accuracy = 2/5 = 0.40.Final Answer:
Option A -> Option AQuick Check:
Count correct predictions, divide by total [OK]
Solution
Step 1: Analyze pooling impact
Without pooling, feature maps remain large, increasing model complexity and risk of overfitting.Step 2: Eliminate wrong options
Pooling layers are too aggressive, losing important features is incorrect because aggressive pooling would reduce overfitting. Pooling layers are applied after every convolutional layer is incorrect as regular pooling helps reduce overfitting. Pooling layers use a large stride, reducing model complexity is incorrect because large strides reduce complexity, not increase it.Final Answer:
Option B -> Option BQuick Check:
No pooling increases overfitting risk. [OK]
Solution
Step 1: Identify symptoms of overfitting.
Overfitting occurs when a model learns noise instead of the signal.Step 2: Determine the cause related to model complexity.
Too many parameters can lead to overfitting by capturing noise.Final Answer:
Option B -> Option BQuick Check:
Overfitting often means too complex a model. [OK]
