result = input.clone()
ar_mask = result.new_zeros(result.size())
ar_mask[:, self.height * self.width :] = 1
- result *= 1-ar_mask
+ result *= 1 - ar_mask
masked_inplace_autoregression(model, self.batch_size, result, ar_mask)
mazes, paths = self.seq2map(result)
nb_correct += maze.path_correctness(mazes, paths).long().sum()
result = input.clone()
ar_mask = result.new_zeros(result.size())
ar_mask[:, self.height * self.width :] = 1
- result *= 1-ar_mask
+ result *= 1 - ar_mask
masked_inplace_autoregression(model, self.batch_size, result, ar_mask)
mazes, paths = self.seq2map(input)
_, predicted_paths = self.seq2map(result)
maze.save_image(
- f"result_{n_epoch:04d}.png",
+ os.path.join(args.result_dir, f"result_{n_epoch:04d}.png"),
mazes,
paths,
predicted_paths,