states, actions, rewards = escape.generate_episodes(
nb_train_samples + nb_test_samples, height, width, T
)
- seq = escape.episodes2seq(states, actions, rewards)
+ seq = escape.episodes2seq(states, actions, rewards, lookahead_delta=5)
self.train_input = seq[:nb_train_samples].to(self.device)
self.test_input = seq[nb_train_samples:].to(self.device)
device=self.device,
)
- s, a, r = escape.seq2episodes(result, self.height, self.width)
- str = escape.episodes2str(s, a, r, unicode=True, ansi_colors=True)
+ s, a, r, lr = escape.seq2episodes(
+ result, self.height, self.width, lookahead=True
+ )
+ str = escape.episodes2str(
+ s, a, r, lookahead_rewards=lr, unicode=True, ansi_colors=True
+ )
filename = os.path.join(result_dir, f"test_seq_{n_epoch:04d}.txt")
with open(filename, "w") as f: