)
log_string(
- f"keep c_quizzes model {model_for_generation.id} nb_accumulated {nb_validated} / {nb_to_create} (finish {e})"
+ f"keep c_quizzes model {model_for_generation.id} nb_accumulated {nb_validated} / {nb_to_create} (finishes {e})"
)
# store the new c_quizzes which have been validated
# s = " ".join([str(x.item()) for x in l])
# logp_file.write(s + "\n")
- quiz_machine.save_quiz_illustrations(args.result_dir, prefix, vq)
+ quiz_machine.save_quiz_illustrations(
+ args.result_dir, prefix, vq, show_part_to_predict=False
+ )
######################################################################
filename_prefix,
quizzes,
mistakes=None,
+ show_part_to_predict=True,
):
quizzes = quizzes.clone().to("cpu")
n_forward = quizzes[quizzes[:, 0] == self.token_forward]
assert n_forward.size(0) + backward.size(0) == quizzes.size(0)
quizzes[n_backward] = self.reverse_time(quizzes[n_backward])
- predicted_prompts = n_backward.long()
- predicted_answers = 1 - predicted_prompts
- if mistakes is not None:
- # 0/-1/+1 ~ not-to-predict / predicted wrong / predicted correct
- predicted_prompts *= mistakes.to("cpu")
- predicted_answers *= mistakes.to("cpu")
+ if show_part_to_predict:
+ predicted_prompts = n_backward.long()
+ predicted_answers = 1 - predicted_prompts
+ if mistakes is not None:
+ # 0/-1/+1 ~ not-to-predict / predicted wrong / predicted correct
+ predicted_prompts *= mistakes.to("cpu")
+ predicted_answers *= mistakes.to("cpu")
+ else:
+ # 0/2 ~ not-to-predict / to predict
+ predicted_prompts *= 2
+ predicted_answers *= 2
else:
- # 0/2 ~ not-to-predict / to predict
- predicted_prompts *= 2
- predicted_answers *= 2
+ predicted_prompts = None
+ predicted_answers = None
self.problem.save_quiz_illustrations(
result_dir,