quiz_machine.problem.save_quizzes_as_image(
args.result_dir, f"test_{n_epoch}_{model.id}.png", quizzes=quizzes
)
- result = predict_full(model, quizzes, local_device=local_device)
+ result = predict_full(model=model, input=quizzes, local_device=local_device)
quiz_machine.problem.save_quizzes_as_image(
args.result_dir, f"test_{n_epoch}_{model.id}_predict_full.png", quizzes=result
)
######################################################################
-def evaluate_quizzes(c_quizzes, models, fraction_with_hints, local_device):
+def evaluate_quizzes(quizzes, models, fraction_with_hints, local_device):
nb_correct, nb_wrong = 0, 0
for model in models:
model = copy.deepcopy(model).to(local_device).eval()
result = predict_full(
model=model,
- quizzes=c_quizzes,
+ input=c_quizzes,
fraction_with_hints=fraction_with_hints,
local_device=local_device,
)
):
c_quizzes = c_quizzes.to(local_device)
- to_keep, nb_correct, nb_wrong = evaluate_quizzes(c_quizzes, models, local_device)
+ to_keep, nb_correct, nb_wrong = evaluate_quizzes(
+ quizzes=c_quizzes, models=models, local_device=local_device
+ )
if solvable_only:
c_quizzes = c_quizzes[to_keep]