Practice
Solution
Step 1: Identify the role of each gate in LSTM.
The forget gate determines what information to discard from the cell state.Step 2: Eliminate wrong options.
The input gate decides what new information to store, the output gate decides what to output, and the activation function is not a gate.Final Answer:
Option A -> Option AQuick Check:
Forget gate discards info in LSTM. [OK]
import torch
optimizer = torch.optim.SGD(model.parameters(), lr=0.1)
for epoch in range(10):
for data, target in dataloader:
optimizer.zero_grad()
output = model(data)
loss = loss_fn(output, target)
loss.backward()
optimizer.step()
print(optimizer.param_groups[0]['lr'])What will be printed after the loop?Solution
Step 1: Understand the code.
The learning rate is set to 0.1 and not changed in the loop.Step 2: Check for learning rate updates.
SGD without a scheduler keeps the learning rate constant.Final Answer:
Option C -> Option CQuick Check:
SGD without scheduler keeps lr constant. [check]
Solution
Step 1: Analyze potential causes of performance issues
Data discrepancies are a common cause of unexpected model performance.Step 2: Eliminate less likely causes
Incorrect dataset usage is more likely than versioning or packaging issues.Final Answer:
Option D -> Option DQuick Check:
Check dataset consistency [OK]
Solution
Step 1: Consider computational efficiency.
Filter methods are computationally inexpensive as they do not involve training models.Step 2: Eliminate wrong options.
Wrapper methods and recursive feature elimination are computationally intensive. Embedded methods require model training, which can be resource-heavy.Final Answer:
Option D -> Option DQuick Check:
Filter = low cost, no model. [OK]
Solution
Step 1: Identify Potential Causes
Naive Bayes assumes feature independence, so correlation can degrade performance.Step 2: Eliminate Other Causes
The model has too many parameters. is incorrect because Naive Bayes is not parameter-heavy. The features are not normalized. is incorrect because normalization is not critical for Naive Bayes. The dataset is too small. is incorrect because Naive Bayes can work well with small datasets.Final Answer:
Option A -> Option AQuick Check:
Correlated features degrade Naive Bayes. [[check]]
