Question 1: Single choice
hardAI-checkedPyTorchA trained model was saved with torch.save(old.state_dict(), "mlp.params"). Its class is:
class MLP(nn.Module):
def __init__(self, num_outputs=10):
super().__init__()
self.hidden = nn.Linear(20, 256)
self.output = nn.Linear(256, num_outputs)
def forward(self, X):
return self.output(torch.relu(self.hidden(X)))
You build new = MLP(num_outputs=5) and load sd = torch.load("mlp.params"). Which call copies
the trained hidden layer into new and leaves the new 5-class output layer at its random
initialization?