From 40da350f3a4c1f6b98d56e4895fb3a45cd100391 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Fleuret?= Date: Thu, 15 Aug 2024 17:00:16 +0200 Subject: [PATCH] Update. --- main.py | 3 ++- quiz_machine.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index e2e9a59..78defa6 100755 --- a/main.py +++ b/main.py @@ -8,7 +8,7 @@ # Written by Francois Fleuret -import math, sys, argparse, time, tqdm, os, datetime, warnings +import math, sys, argparse, time, tqdm, os, datetime, warnings, copy import torch, torchvision from torch import nn @@ -891,6 +891,7 @@ for k in range(args.nb_gpts): model.optimizer = torch.optim.Adam(model.parameters(), lr=args.learning_rate) model.test_accuracy = 0.0 + model.best_test_accuracy = 0.0 models.append(model) diff --git a/quiz_machine.py b/quiz_machine.py index 0bdaaec..6da9075 100755 --- a/quiz_machine.py +++ b/quiz_machine.py @@ -241,7 +241,7 @@ class QuizMachine: f"test_accuracy {n_epoch} model {model.id} val {nb_correct} / {nb_total}" ) - main_test_accuracy = nb_correct / nb_total + test_accuracy = nb_correct / nb_total ############################## @@ -259,7 +259,7 @@ class QuizMachine: correct_parts=correct_parts, ) - return main_test_accuracy + return test_accuracy ###################################################################### -- 2.39.5