From 07c065e77f1d2a775814ec402752a4a8eb6c7574 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Fleuret?= Date: Thu, 11 Jul 2024 08:40:39 +0200 Subject: [PATCH] Update. --- grids.py | 9 +++++++++ main.py | 2 ++ problem.py | 3 +++ 3 files changed, 14 insertions(+) diff --git a/grids.py b/grids.py index d1653ee..20a964b 100755 --- a/grids.py +++ b/grids.py @@ -942,6 +942,15 @@ class Grids(problem.Problem): nrow, ) + def save_some_examples(self, result_dir): + nb, nrow = 72, 4 + for t in self.all_tasks(): + print(t.__name__) + prompts, answers = self.generate_prompts_and_answers_(nb, tasks=[t]) + self.save_quizzes( + result_dir, t.__name__, prompts[:nb], answers[:nb], nrow=nrow + ) + ###################################################################### diff --git a/main.py b/main.py index e6806d4..5956be5 100755 --- a/main.py +++ b/main.py @@ -253,6 +253,8 @@ elif args.problem == "grids": else: raise ValueError +problem.save_some_examples(args.result_dir) + quiz_machine = quiz_machine.QuizMachine( problem=problem, nb_train_samples=args.nb_train_samples, diff --git a/problem.py b/problem.py index 617b2a8..7eeb6b4 100755 --- a/problem.py +++ b/problem.py @@ -88,3 +88,6 @@ class Problem: prompts, answers = prompts[:-k], answers[:-k] return prompts, answers + + def save_some_examples(self, result_dir): + pass -- 2.39.5