This commit is contained in:
Dobromir Popov 2025-02-02 00:58:23 +02:00
parent f8c1d95a25
commit 08f26785ea

View File

@ -99,7 +99,8 @@ def save_checkpoint(model, epoch, reward, last_dir=LAST_DIR, best_dir=BEST_DIR):
# Remove the worst checkpoint.
os.remove(os.path.join(best_dir, min_file))
if add_to_best:
best_filename = f"best_{reward:.4f}_epoch_{epoch}_{timestamp}.pt"
# best_filename = f"best_{reward:.4f}_epoch_{epoch}_{timestamp}.pt"
best_filename = f"best_epoch_{epoch}.pt"
best_path = os.path.join(best_dir, best_filename)
torch.save({
"epoch": epoch,