def record_new_c_quizzes(models, quiz_machine, nb_for_train, nb_for_test):
nb_validated, nb_to_validate = 0, nb_for_train + nb_for_test
- nb_to_generate_per_iteration = nb_to_validate
+ nb_generated, nb_to_generate_per_iteration = 0, nb_to_validate
start_time = time.perf_counter()
procedure=c_quizzes_procedure,
)
+ nb_generated += c_quizzes.size(0)
+
# We discard the trivial ones, according to a criterion
# specific to the world quizzes (e.g. B=f(B))
e = "???"
log_string(
- f"keep c_quizzes model {model_for_generation.id} validated {nb_validated} / {nb_to_generate_per_iteration} ({100*nb_validated/nb_to_generate_per_iteration:.02f}%) nb_accumulated {nb_validated} / {nb_to_validate} (finishes {e} -- {int((nb_validated * 3600)/duration)}/h)"
+ f"keep c_quizzes model {model_for_generation.id} validated nb_validated {nb_validated} / {nb_to_validate} (finishes {e} -- {int((nb_validated * 3600)/duration)}/h) proportion_kept {nb_validated * 100 / nb_generated:.02f}%"
)
for s in range(teaching_count.size(0)):
"proba " + " ".join([f"{x.exp().item():.02f}" for x in l])
)
- filename = f"culture_c_quiz_{n_epoch:04d}.png"
+ filename = f"culture_c_quiz_{n_epoch:04d}_{model.id:02d}.png"
quiz_machine.problem.save_quizzes_as_image(
args.result_dir, filename, c_quizzes, comments=comments
)