+ ##################################################
+ # If all the models are good enough, generate new quizzes and
+ # re-compute the test errors
+
+ if min([m.main_test_accuracy for m in models]) >= args.accuracy_to_make_c_quizzes:
+ create_c_quizzes(
+ models,
+ quiz_machine,
+ nb_for_train=args.nb_new_c_quizzes_for_train,
+ nb_for_test=args.nb_new_c_quizzes_for_test,
+ )
+
+ filename = "c_quizzes.pth"
+ quiz_machine.save_c_quizzes(os.path.join(args.result_dir, filename))
+ log_string(f"wrote {filename}")
+
+ # Force one epoch of training
+ for model in models:
+ model.main_test_accuracy = 0.0
+