+ nb_validated = valid_c_quizzes(recorded, standard_validity).size(0)
+
+ log_string(
+ f"keep c_quizzes model {model_for_generation.id} kept {nv} nb_accumulated {nb_validated} / {nb_to_create}"
+ )
+
+ # store the new c_quizzes which have been validated
+
+ new_c_quizzes = valid_c_quizzes(recorded, standard_validity)
+
+ quizz_machine.store_c_quizzes(new_c_quizzes[:nb_for_train], for_train=True)
+ quizz_machine.store_c_quizzes(new_c_quizzes[nb_for_train:], for_train=False)
+
+ # save a bunch of images to investigate what quizzes with a
+ # certain nb of correct predictions look like
+
+ for n in range(len(models) + 1):
+ s = (
+ "_validated"
+ if n >= args.min_to_validate and n <= args.max_to_validate
+ else ""
+ )
+
+ q = valid_c_quizzes(recorded, criteria=lambda nb_correct: nb_correct == n)[:72]
+
+ if q.size(0) > 0:
+ quizz_machine.save_quizzes(
+ args.result_dir, f"culture_c_quiz_{n_epoch:04d}_N{n}{s}", q
+ )