Update.
authorFrançois Fleuret <francois@fleuret.org>
Tue, 25 Jun 2024 21:45:34 +0000 (23:45 +0200)
committerFrançois Fleuret <francois@fleuret.org>
Tue, 25 Jun 2024 21:45:34 +0000 (23:45 +0200)
main.py

diff --git a/main.py b/main.py
index cb28a7d..c5acea7 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -394,7 +394,10 @@ def create_c_quizzes(
             f"keep c_quizzes {to_keep.size(0)}/{new_c_quizzes.size(0)} ({to_keep.size(0)*100/new_c_quizzes.size(0):.02f}%) total {sum([ x.size(0) for x in kept])}/{nb_to_generate}"
         )
 
-    new_c_quizzes = torch.cat(kept, dim=0)[: nb_for_train + nb_for_test]
+    new_c_quizzes = torch.cat(kept, dim=0)
+    new_c_quizzes = new_c_quizzes[
+        torch.randperm(new_c_quizzes.size(0))[: nb_for_train + nb_for_test]
+    ]
 
     quizz_machine.store_c_quizzes(new_c_quizzes[:nb_for_train], for_train=True)
     quizz_machine.store_c_quizzes(new_c_quizzes[nb_for_train:], for_train=False)