From 7cc9d20fbf195eeec10d171b280089929b30659a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Fleuret?= Date: Thu, 23 Mar 2023 09:48:55 +0100 Subject: [PATCH] Update --- beaver.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/beaver.py b/beaver.py index dca97cc..bd17365 100755 --- a/beaver.py +++ b/beaver.py @@ -312,15 +312,17 @@ def oneshot(gpt, task): scores = scores.reshape(-1, task.height, task.width) mazes = mazes.reshape(-1, task.height, task.width) targets = targets.reshape(-1, task.height, task.width) + filename = ( + f"oneshot_{args.oneshot_input}_{args.oneshot_output}_{n_epoch:04d}.png" + ) maze.save_image( - os.path.join( - args.result_dir, - f"oneshot_{args.oneshot_input}_{args.oneshot_output}_{n_epoch:04d}.png", - ), + os.path.join(args.result_dir, filename), mazes=mazes, score_paths=scores, score_truth=targets, ) + log_string(f"wrote {filename}") + # ------------------- gpt.train(t) @@ -471,13 +473,15 @@ class TaskMaze(Task): mazes, paths = self.seq2map(input) _, predicted_paths = self.seq2map(result) + filename = f"result_{n_epoch:04d}.png" maze.save_image( - os.path.join(args.result_dir, f"result_{n_epoch:04d}.png"), + os.path.join(args.result_dir, filename), mazes=mazes, target_paths=paths, predicted_paths=predicted_paths, path_correct=maze.path_correctness(mazes, predicted_paths), ) + log_string(f"wrote {filename}") model.train(t) -- 2.39.5