- while nb_validated() < nb_to_create:
- (
- new_c_quizzes,
- nb_correct,
- ave_seq_logproba,
- ) = quizz_machine.gang_create_c_quizzes(
- nb=nb_to_create,
- nb_models_for_generation=args.nb_models_for_generation,
- models=models,
- mode=args.generation_mode,
- min_ave_seq_logproba=min_ave_seq_logproba,
- n_epoch=n_epoch,
- result_dir=args.result_dir,
- )
+ # ------------------------------------------------------------
+
+ standard_validity = lambda nb_correct: torch.logical_and(
+ nb_correct >= args.min_to_validate, nb_correct <= args.max_to_validate
+ )
+
+ file_name = os.path.join(args.result_dir, f"culture_c_quiz_{n_epoch:04d}_logp.dat")
+ with open(file_name, "w") as logp_file:
+ while valid_c_quizzes(recorded, standard_validity).size(0) < nb_to_create:
+ # Select a model at random to generate the new quizzes