Update.
authorFrançois Fleuret <francois@fleuret.org>
Thu, 11 Jul 2024 06:40:39 +0000 (08:40 +0200)
committerFrançois Fleuret <francois@fleuret.org>
Thu, 11 Jul 2024 06:40:39 +0000 (08:40 +0200)
grids.py
main.py
problem.py

index d1653ee..20a964b 100755 (executable)
--- 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 (executable)
--- 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,
index 617b2a8..7eeb6b4 100755 (executable)
@@ -88,3 +88,6 @@ class Problem:
             prompts, answers = prompts[:-k], answers[:-k]
 
         return prompts, answers
+
+    def save_some_examples(self, result_dir):
+        pass