Question 1: Single choice
mediumAI-checkedLearning TheoryWhat is wrong with this 5-fold cross-validation of a PyTorch network? (train runs some epochs of
SGD on the given data, starting from the model's current weights.)
model = make_model()
scores = []
for train_idx, val_idx in KFold(n_splits=5, shuffle=True).split(X):
train(model, X[train_idx], y[train_idx])
scores.append(evaluate(model, X[val_idx], y[val_idx]))
print(sum(scores) / len(scores))