# Written by Francois Fleuret <francois@fleuret.org>
-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
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)
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
##############################
correct_parts=correct_parts,
)
- return main_test_accuracy
+ return test_accuracy
######################################################################