From: François Fleuret Date: Thu, 15 Aug 2024 15:00:16 +0000 (+0200) Subject: Update. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=40da350f3a4c1f6b98d56e4895fb3a45cd100391;p=culture.git Update. --- 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 ######################################################################