Practice
1. In the context of Convolutional Neural Networks, what is the primary purpose of pooling layers?
easy
Solution
Step 1: Understand pooling layers
Pooling layers are used to reduce the spatial dimensions of feature maps, which helps in reducing computation and controlling overfitting.Step 2: Eliminate wrong options
To increase the size of the feature maps is incorrect because pooling reduces size, not increases it. To increase the number of channels in the feature maps is incorrect as pooling doesn't change the number of channels. To apply non-linear activation functions is incorrect because pooling doesn't apply non-linear activations.Final Answer:
Option A -> Option AQuick Check:
Pooling reduces spatial dimensions. [OK]
Hint: Pooling reduces spatial dimensions. [OK]
Common Mistakes:
2. In the context of K-Nearest Neighbors, what is the 'curse of dimensionality'?
easy
Solution
Step 1: Understand the curse of dimensionality
As dimensions increase, the volume of the space increases exponentially, making data sparse.Step 2: Eliminate wrong options
The model becomes more accurate as dimensions increase. is incorrect because accuracy typically decreases. The model requires less data as dimensions increase. is wrong because more data is needed. The model's complexity decreases with more dimensions. is incorrect as complexity often increases.Final Answer:
Option D -> Option DQuick Check:
High dimensions dilute distance meaning. [OK]
Hint: High dimensions dilute distance meaning. [OK]
Common Mistakes:
3. What will be the output shape of the following PyTorch code snippet?
import torch
rnn = torch.nn.RNN(input_size=10, hidden_size=20, num_layers=2)
input = torch.randn(5, 3, 10)
h0 = torch.randn(2, 3, 20)
output, hn = rnn(input, h0)
print(output.shape)easy
Solution
Step 1: Understand RNN output shape.
The output shape of an RNN is (seq_len, batch, hidden_size).Step 2: Apply to the given code.
Here, seq_len=5, batch=3, hidden_size=20, so the output shape is (5, 3, 20).Final Answer:
Option D -> Option DQuick Check:
RNN output: (seq_len, batch, hidden_size). [check]
Hint: RNN output: (seq_len, batch, hidden_size). [check]
Common Mistakes:
4. In the context of high-dimensional data, which of the following is a primary reason why the curse of dimensionality affects nearest neighbor algorithms?
easy
Solution
Step 1: Understand the curse of dimensionality.
In high dimensions, the distance between points becomes less informative.Step 2: Eliminate wrong options.
High-dimensional data increases the risk of overfitting. is about overfitting, not distance. High-dimensional data requires more computational resources. is about computation, not distance. High-dimensional data leads to more complex decision boundaries. is about decision boundaries, not distance.Final Answer:
Option A -> Option AQuick Check:
High dimensions dilute distance meaning. [OK]
Hint: High dimensions dilute distance meaning. [OK]
Common Mistakes:
5. In a multilingual context, how can you adapt Word2Vec embeddings to handle multiple languages effectively?
hard
Solution
Step 1: Evaluate multilingual strategies
Multilingual BERT is designed to handle multiple languages effectively, unlike Word2Vec.Step 2: Eliminate wrong options
Train separate Word2Vec models for each language and concatenate the embeddings. doesn't capture cross-lingual semantics. Use a shared vocabulary across languages and train a single Word2Vec model. is impractical due to vocabulary differences. Translate all text to a single language before training Word2Vec. loses language-specific nuances.Final Answer:
Option A -> Option AQuick Check:
Multilingual BERT for cross-language tasks [OK]
Hint: Multilingual BERT for cross-language tasks [OK]
Common Mistakes:
