# dots = False
grid_gray = 240
- thickness = 0
+ thickness = 1
background_gray = 240
dots = False
######################################################################
def vocabulary_size(self):
- # warnings.warn("hack +4 to keep the vocabulary size unchanged", RuntimeWarning)
- # return self.nb_colors+4
- return self.nb_colors
+ warnings.warn("hack +4 to keep the vocabulary size unchanged", RuntimeWarning)
+ return self.nb_colors + 4
+ # return self.nb_colors
def grid2img(self, x, scale=15, grids=True):
m = torch.logical_and(x >= 0, x < self.nb_colors).long()
def evaluate_quizzes(quizzes, models, with_hints, local_device):
nb_correct, nb_wrong = 0, 0
+ quizzes = quizzes.to(local_device)
for model in models:
model = copy.deepcopy(model).to(local_device).eval()
quizzes=train_c_quizzes,
models=models,
with_hints=False,
- local_device=local_device,
+ local_device=main_device,
)
+ nb_correct = nb_correct.to("cpu")
test_c_quizzes = train_c_quizzes[nb_correct >= args.nb_have_to_be_correct]